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/notation/relations/predtystar_5.ma".
16 include "basic_2/rt_transition/cpx.ma".
18 (* UNCOUNTED CONTEXT-SENSITIVE PARALLEL RT-COMPUTATION FOR TERMS ************)
20 definition cpxs: sh → relation4 genv lenv term term ≝
21 λh,G. LTC … (cpx h G).
23 interpretation "uncounted context-sensitive parallel rt-computation (term)"
24 'PRedTyStar h G L T1 T2 = (cpxs h G L T1 T2).
26 (* Basic eliminators ********************************************************)
28 lemma cpxs_ind: ∀h,G,L,T1. ∀R:predicate term. R T1 →
29 (∀T,T2. ⦃G, L⦄ ⊢ T1 ⬈*[h] T → ⦃G, L⦄ ⊢ T ⬈[h] T2 → R T → R T2) →
30 ∀T2. ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 → R T2.
31 #h #L #G #T1 #R #HT1 #IHT1 #T2 #HT12
32 @(TC_star_ind … HT1 IHT1 … HT12) //
35 lemma cpxs_ind_dx: ∀h,G,L,T2. ∀R:predicate term. R T2 →
36 (∀T1,T. ⦃G, L⦄ ⊢ T1 ⬈[h] T → ⦃G, L⦄ ⊢ T ⬈*[h] T2 → R T → R T1) →
37 ∀T1. ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 → R T1.
38 #h #G #L #T2 #R #HT2 #IHT2 #T1 #HT12
39 @(TC_star_ind_dx … HT2 IHT2 … HT12) //
42 (* Basic properties *********************************************************)
44 lemma cpxs_refl: ∀h,G,L,T. ⦃G, L⦄ ⊢ T ⬈*[h] T.
45 /2 width=1 by inj/ qed.
47 lemma cpx_cpxs: ∀h,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ⬈[h] T2 → ⦃G, L⦄ ⊢ T1 ⬈*[h] T2.
48 /2 width=1 by inj/ qed.
50 lemma cpxs_strap1: ∀h,G,L,T1,T. ⦃G, L⦄ ⊢ T1 ⬈*[h] T →
51 ∀T2. ⦃G, L⦄ ⊢ T ⬈[h] T2 → ⦃G, L⦄ ⊢ T1 ⬈*[h] T2.
52 normalize /2 width=3 by step/ qed-.
54 lemma cpxs_strap2: ∀h,G,L,T1,T. ⦃G, L⦄ ⊢ T1 ⬈[h] T →
55 ∀T2. ⦃G, L⦄ ⊢ T ⬈*[h] T2 → ⦃G, L⦄ ⊢ T1 ⬈*[h] T2.
56 normalize /2 width=3 by TC_strap/ qed-.
58 (* Basic_2A1: was just: cpxs_sort *)
59 lemma cpxs_sort: ∀h,G,L,s,n. ⦃G, L⦄ ⊢ ⋆s ⬈*[h] ⋆((next h)^n s).
60 #h #G #L #s #n elim n -n /2 width=1 by cpx_cpxs/
61 #n >iter_S /2 width=3 by cpxs_strap1/
64 lemma cpxs_bind_dx: ∀h,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ⬈[h] V2 →
65 ∀I,T1,T2. ⦃G, L. ⓑ{I}V1⦄ ⊢ T1 ⬈*[h] T2 →
66 ∀p. ⦃G, L⦄ ⊢ ⓑ{p,I}V1.T1 ⬈*[h] ⓑ{p,I}V2.T2.
67 #h #G #L #V1 #V2 #HV12 #I #T1 #T2 #HT12 #a @(cpxs_ind_dx … HT12) -T1
68 /3 width=3 by cpxs_strap2, cpx_cpxs, cpx_pair_sn, cpx_bind/
71 lemma cpxs_flat_dx: ∀h,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ⬈[h] V2 →
72 ∀T1,T2. ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 →
73 ∀I. ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ⬈*[h] ⓕ{I}V2.T2.
74 #h #G #L #V1 #V2 #HV12 #T1 #T2 #HT12 @(cpxs_ind … HT12) -T2
75 /3 width=5 by cpxs_strap1, cpx_cpxs, cpx_pair_sn, cpx_flat/
78 lemma cpxs_flat_sn: ∀h,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ⬈[h] T2 →
79 ∀V1,V2. ⦃G, L⦄ ⊢ V1 ⬈*[h] V2 →
80 ∀I. ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ⬈*[h] ⓕ{I}V2.T2.
81 #h #G #L #T1 #T2 #HT12 #V1 #V2 #H @(cpxs_ind … H) -V2
82 /3 width=5 by cpxs_strap1, cpx_cpxs, cpx_pair_sn, cpx_flat/
85 lemma cpxs_pair_sn: ∀h,I,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ⬈*[h] V2 →
86 ∀T. ⦃G, L⦄ ⊢ ②{I}V1.T ⬈*[h] ②{I}V2.T.
87 #h #I #G #L #V1 #V2 #H @(cpxs_ind … H) -V2
88 /3 width=3 by cpxs_strap1, cpx_pair_sn/
91 lemma cpxs_zeta: ∀h,G,L,V,T1,T,T2. ⬆*[1] T2 ≡ T →
92 ⦃G, L.ⓓV⦄ ⊢ T1 ⬈*[h] T → ⦃G, L⦄ ⊢ +ⓓV.T1 ⬈*[h] T2.
93 #h #G #L #V #T1 #T #T2 #HT2 #H @(cpxs_ind_dx … H) -T1
94 /3 width=3 by cpxs_strap2, cpx_cpxs, cpx_bind, cpx_zeta/
97 lemma cpxs_eps: ∀h,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 →
98 ∀V. ⦃G, L⦄ ⊢ ⓝV.T1 ⬈*[h] T2.
99 #h #G #L #T1 #T2 #H @(cpxs_ind … H) -T2
100 /3 width=3 by cpxs_strap1, cpx_cpxs, cpx_eps/
103 (* Basic_2A1: was: cpxs_ct *)
104 lemma cpxs_ee: ∀h,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ⬈*[h] V2 →
105 ∀T. ⦃G, L⦄ ⊢ ⓝV1.T ⬈*[h] V2.
106 #h #G #L #V1 #V2 #H @(cpxs_ind … H) -V2
107 /3 width=3 by cpxs_strap1, cpx_cpxs, cpx_ee/
110 lemma cpxs_beta_dx: ∀h,p,G,L,V1,V2,W1,W2,T1,T2.
111 ⦃G, L⦄ ⊢ V1 ⬈[h] V2 → ⦃G, L.ⓛW1⦄ ⊢ T1 ⬈*[h] T2 → ⦃G, L⦄ ⊢ W1 ⬈[h] W2 →
112 ⦃G, L⦄ ⊢ ⓐV1.ⓛ{p}W1.T1 ⬈*[h] ⓓ{p}ⓝW2.V2.T2.
113 #h #p #G #L #V1 #V2 #W1 #W2 #T1 #T2 #HV12 * -T2
114 /4 width=7 by cpx_cpxs, cpxs_strap1, cpxs_bind_dx, cpxs_flat_dx, cpx_beta/
117 lemma cpxs_theta_dx: ∀h,p,G,L,V1,V,V2,W1,W2,T1,T2.
118 ⦃G, L⦄ ⊢ V1 ⬈[h] V → ⬆*[1] V ≡ V2 → ⦃G, L.ⓓW1⦄ ⊢ T1 ⬈*[h] T2 →
119 ⦃G, L⦄ ⊢ W1 ⬈[h] W2 → ⦃G, L⦄ ⊢ ⓐV1.ⓓ{p}W1.T1 ⬈*[h] ⓓ{p}W2.ⓐV2.T2.
120 #h #p #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 #HV1 #HV2 * -T2
121 /4 width=9 by cpx_cpxs, cpxs_strap1, cpxs_bind_dx, cpxs_flat_dx, cpx_theta/
124 (* Basic inversion lemmas ***************************************************)
126 (* Basic_2A1: wa just: cpxs_inv_sort1 *)
127 lemma cpxs_inv_sort1: ∀h,G,L,X2,s. ⦃G, L⦄ ⊢ ⋆s ⬈*[h] X2 →
128 ∃n. X2 = ⋆((next h)^n s).
129 #h #G #L #X2 #s #H @(cpxs_ind … H) -X2 /2 width=2 by ex_intro/
130 #X #X2 #_ #HX2 * #n #H destruct
131 elim (cpx_inv_sort1 … HX2) -HX2 #H destruct /2 width=2 by ex_intro/
132 @(ex_intro … (⫯n)) >iter_S //
135 lemma cpxs_inv_cast1: ∀h,G,L,W1,T1,U2. ⦃G, L⦄ ⊢ ⓝW1.T1 ⬈*[h] U2 →
136 ∨∨ ∃∃W2,T2. ⦃G, L⦄ ⊢ W1 ⬈*[h] W2 & ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 & U2 = ⓝW2.T2
137 | ⦃G, L⦄ ⊢ T1 ⬈*[h] U2
138 | ⦃G, L⦄ ⊢ W1 ⬈*[h] U2.
139 #h #G #L #W1 #T1 #U2 #H @(cpxs_ind … H) -U2 /3 width=5 by or3_intro0, ex3_2_intro/
140 #U2 #U #_ #HU2 * /3 width=3 by cpxs_strap1, or3_intro1, or3_intro2/ *
141 #W #T #HW1 #HT1 #H destruct
142 elim (cpx_inv_cast1 … HU2) -HU2 /3 width=3 by cpxs_strap1, or3_intro1, or3_intro2/ *
143 #W2 #T2 #HW2 #HT2 #H destruct
144 lapply (cpxs_strap1 … HW1 … HW2) -W
145 lapply (cpxs_strap1 … HT1 … HT2) -T /3 width=5 by or3_intro0, ex3_2_intro/