1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "basic_2/unfold/tpss.ma".
16 include "basic_2/reducibility/tpr.ma".
18 (* CONTEXT-SENSITIVE PARALLEL REDUCTION ON TERMS ****************************)
20 (* Basic_1: includes: pr2_delta1 *)
21 definition cpr: lenv → relation term ≝
22 λL,T1,T2. ∃∃T. T1 ➡ T & L ⊢ T ▶* [0, |L|] T2.
25 "context-sensitive parallel reduction (term)"
26 'PRed L T1 T2 = (cpr L T1 T2).
28 (* Basic properties *********************************************************)
30 lemma cpr_intro: ∀L,T1,T,T2,d,e. T1 ➡ T → L ⊢ T ▶* [d, e] T2 → L ⊢ T1 ➡ T2.
33 (* Basic_1: was by definition: pr2_free *)
34 lemma cpr_tpr: ∀T1,T2. T1 ➡ T2 → ∀L. L ⊢ T1 ➡ T2.
37 lemma cpr_tpss: ∀L,T1,T2,d,e. L ⊢ T1 ▶* [d, e] T2 → L ⊢ T1 ➡ T2.
40 lemma cpr_refl: ∀L,T. L ⊢ T ➡ T.
43 (* Note: new property *)
44 (* Basic_1: was only: pr2_thin_dx *)
45 lemma cpr_flat: ∀I,L,V1,V2,T1,T2.
46 L ⊢ V1 ➡ V2 → L ⊢ T1 ➡ T2 → L ⊢ ⓕ{I} V1. T1 ➡ ⓕ{I} V2. T2.
47 #I #L #V1 #V2 #T1 #T2 * #V #HV1 #HV2 * /3 width=5/
50 lemma cpr_cast: ∀L,V,T1,T2.
51 L ⊢ T1 ➡ T2 → L ⊢ ⓝV. T1 ➡ T2.
52 #L #V #T1 #T2 * /3 width=3/
55 (* Note: it does not hold replacing |L1| with |L2| *)
56 (* Basic_1: was only: pr2_change *)
57 lemma cpr_lsubs_trans: ∀L1,T1,T2. L1 ⊢ T1 ➡ T2 →
58 ∀L2. L2 ≼ [0, |L1|] L1 → L2 ⊢ T1 ➡ T2.
59 #L1 #T1 #T2 * #T #HT1 #HT2 #L2 #HL12
60 lapply (tpss_lsubs_trans … HT2 … HL12) -HT2 -HL12 /3 width=4/
63 (* Basic inversion lemmas ***************************************************)
65 (* Basic_1: was: pr2_gen_csort *)
66 lemma cpr_inv_atom: ∀T1,T2. ⋆ ⊢ T1 ➡ T2 → T1 ➡ T2.
67 #T1 #T2 * #T #HT normalize #HT2
68 <(tpss_inv_refl_O2 … HT2) -HT2 //
71 (* Basic_1: was: pr2_gen_sort *)
72 lemma cpr_inv_sort1: ∀L,T2,k. L ⊢ ⋆k ➡ T2 → T2 = ⋆k.
74 >(tpr_inv_atom1 … H) -H #H
75 >(tpss_inv_sort1 … H) -H //
78 (* Basic_1: was: pr2_gen_cast *)
79 lemma cpr_inv_cast1: ∀L,V1,T1,U2. L ⊢ ⓝV1. T1 ➡ U2 → (
80 ∃∃V2,T2. L ⊢ V1 ➡ V2 & L ⊢ T1 ➡ T2 &
83 #L #V1 #T1 #U2 * #X #H #HU2
84 elim (tpr_inv_cast1 … H) -H /3 width=3/
85 * #V #T #HV1 #HT1 #H destruct
86 elim (tpss_inv_flat1 … HU2) -HU2 #V2 #T2 #HV2 #HT2 #H destruct /4 width=5/
89 (* Basic_1: removed theorems 6:
90 pr2_head_2 pr2_cflat pr2_gen_cflat clear_pr2_trans
91 pr2_gen_ctail pr2_ctail
92 Basic_1: removed local theorems 3:
93 pr2_free_free pr2_free_delta pr2_delta_delta