]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpms.ma
severe bug found in parallel zeta
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / rt_computation / cpms.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "ground_2/lib/ltc.ma".
16 include "basic_2/notation/relations/predstar_6.ma".
17 include "basic_2/notation/relations/predstar_5.ma".
18 include "basic_2/rt_transition/cpm.ma".
19
20 (* T-BOUND CONTEXT-SENSITIVE PARALLEL RT-COMPUTATION FOR TERMS **************)
21
22 (* Basic_2A1: uses: scpds *)
23 definition cpms (h) (G) (L): relation3 nat term term ≝
24                              ltc … plus … (cpm h G L).
25
26 interpretation
27    "t-bound context-sensitive parallel rt-computarion (term)"
28    'PRedStar n h G L T1 T2 = (cpms h G L n T1 T2).
29
30 interpretation
31    "context-sensitive parallel r-computation (term)"
32    'PRedStar h G L T1 T2 = (cpms h G L O T1 T2).
33
34 (* Basic eliminators ********************************************************)
35
36 lemma cpms_ind_sn (h) (G) (L) (T2) (Q:relation2 …):
37                   Q 0 T2 →
38                   (∀n1,n2,T1,T. ⦃G, L⦄ ⊢ T1 ➡[n1, h] T → ⦃G, L⦄ ⊢ T ➡*[n2, h] T2 → Q n2 T → Q (n1+n2) T1) →
39                   ∀n,T1. ⦃G, L⦄ ⊢ T1 ➡*[n, h] T2 → Q n T1.
40 #h #G #L #T2 #Q @ltc_ind_sn_refl //
41 qed-.
42
43 lemma cpms_ind_dx (h) (G) (L) (T1) (Q:relation2 …):
44                   Q 0 T1 →
45                   (∀n1,n2,T,T2. ⦃G, L⦄ ⊢ T1 ➡*[n1, h] T → Q n1 T → ⦃G, L⦄ ⊢ T ➡[n2, h] T2 → Q (n1+n2) T2) →
46                   ∀n,T2. ⦃G, L⦄ ⊢ T1 ➡*[n, h] T2 → Q n T2.
47 #h #G #L #T1 #Q @ltc_ind_dx_refl //
48 qed-.
49
50 (* Basic inversion lemmas ***************************************************)
51
52 lemma cpms_inv_sort1 (n) (h) (G) (L): ∀X2,s. ⦃G, L⦄ ⊢ ⋆s ➡*[n, h] X2 → X2 = ⋆(((next h)^n) s).
53 #n #h #G #L #X2 #s #H @(cpms_ind_dx … H) -X2 //
54 #n1 #n2 #X #X2 #_ #IH #HX2 destruct
55 elim (cpm_inv_sort1 … HX2) -HX2 #H #_ destruct //
56 qed-.
57
58 (* Basic properties *********************************************************)
59
60 (* Basic_1: includes: pr1_pr0 *)
61 (* Basic_1: uses: pr3_pr2 *)
62 (* Basic_2A1: includes: cpr_cprs *)
63 lemma cpm_cpms (h) (G) (L): ∀n,T1,T2. ⦃G, L⦄ ⊢ T1 ➡[n, h] T2 → ⦃G, L⦄ ⊢ T1 ➡*[n, h] T2.
64 /2 width=1 by ltc_rc/ qed.
65
66 lemma cpms_step_sn (h) (G) (L): ∀n1,T1,T. ⦃G, L⦄ ⊢ T1 ➡[n1, h] T →
67                                 ∀n2,T2. ⦃G, L⦄ ⊢ T ➡*[n2, h] T2 → ⦃G, L⦄ ⊢ T1 ➡*[n1+n2, h] T2.
68 /2 width=3 by ltc_sn/ qed-.
69
70 lemma cpms_step_dx (h) (G) (L): ∀n1,T1,T. ⦃G, L⦄ ⊢ T1 ➡*[n1, h] T →
71                                 ∀n2,T2. ⦃G, L⦄ ⊢ T ➡[n2, h] T2 → ⦃G, L⦄ ⊢ T1 ➡*[n1+n2, h] T2.
72 /2 width=3 by ltc_dx/ qed-.
73
74 (* Basic_2A1: uses: cprs_bind_dx *)
75 lemma cpms_bind_dx (n) (h) (G) (L):
76                    ∀V1,V2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 →
77                    ∀I,T1,T2. ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ➡*[n, h] T2 →
78                    ∀p. ⦃G, L⦄ ⊢ ⓑ{p,I}V1.T1 ➡*[n, h] ⓑ{p,I}V2.T2.
79 #n #h #G #L #V1 #V2 #HV12 #I #T1 #T2 #H #a @(cpms_ind_sn … H) -T1
80 /3 width=3 by cpms_step_sn, cpm_cpms, cpm_bind/ qed.
81
82 lemma cpms_appl_dx (n) (h) (G) (L):
83                    ∀V1,V2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 →
84                    ∀T1,T2. ⦃G, L⦄ ⊢ T1 ➡*[n, h] T2 →
85                    ⦃G, L⦄ ⊢ ⓐV1.T1 ➡*[n, h] ⓐV2.T2.
86 #n #h #G #L #V1 #V2 #HV12 #T1 #T2 #H @(cpms_ind_sn … H) -T1
87 /3 width=3 by cpms_step_sn, cpm_cpms, cpm_appl/
88 qed.
89
90 lemma cpms_zeta (n) (h) (G) (L):
91                 ∀T1,T. ⬆*[1] T ≘ T1 →
92                 ∀V,T2. ⦃G, L⦄ ⊢ T ➡*[n, h] T2 → ⦃G, L⦄ ⊢ +ⓓV.T1 ➡*[n, h] T2.
93 #n #h #G #L #T1 #T #HT1 #V #T2 #H @(cpms_ind_dx … H) -T2
94 /3 width=3 by cpms_step_dx, cpm_cpms, cpm_zeta/
95 qed.
96
97 (* Basic_2A1: uses: cprs_zeta *)
98 lemma cpms_zeta_dx (n) (h) (G) (L):
99                    ∀T2,T. ⬆*[1] T2 ≘ T →
100                    ∀V,T1. ⦃G, L.ⓓV⦄ ⊢ T1 ➡*[n, h] T → ⦃G, L⦄ ⊢ +ⓓV.T1 ➡*[n, h] T2.
101 #n #h #G #L #T2 #T #HT2 #V #T1 #H @(cpms_ind_sn … H) -T1
102 /3 width=3 by cpms_step_sn, cpm_cpms, cpm_bind, cpm_zeta/
103 qed.
104
105 (* Basic_2A1: uses: cprs_eps *)
106 lemma cpms_eps (n) (h) (G) (L):
107                ∀T1,T2. ⦃G, L⦄ ⊢ T1 ➡*[n, h] T2 →
108                ∀V. ⦃G, L⦄ ⊢ ⓝV.T1 ➡*[n, h] T2.
109 #n #h #G #L #T1 #T2 #H @(cpms_ind_sn … H) -T1
110 /3 width=3 by cpms_step_sn, cpm_cpms, cpm_eps/
111 qed.
112
113 lemma cpms_ee (n) (h) (G) (L):
114               ∀U1,U2. ⦃G, L⦄ ⊢ U1 ➡*[n, h] U2 →
115               ∀T. ⦃G, L⦄ ⊢ ⓝU1.T ➡*[↑n, h] U2.
116 #n #h #G #L #U1 #U2 #H @(cpms_ind_sn … H) -U1 -n
117 [ /3 width=1 by cpm_cpms, cpm_ee/
118 | #n1 #n2 #U1 #U #HU1 #HU2 #_ #T >plus_S1
119   /3 width=3 by cpms_step_sn, cpm_ee/
120 ]
121 qed.
122
123 (* Basic_2A1: uses: cprs_beta_dx *)
124 lemma cpms_beta_dx (n) (h) (G) (L):
125                    ∀V1,V2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 →
126                    ∀W1,W2. ⦃G, L⦄ ⊢ W1 ➡[h] W2 →
127                    ∀T1,T2. ⦃G, L.ⓛW1⦄ ⊢ T1 ➡*[n, h] T2 →
128                    ∀p. ⦃G, L⦄ ⊢ ⓐV1.ⓛ{p}W1.T1 ➡*[n, h] ⓓ{p}ⓝW2.V2.T2.
129 #n #h #G #L #V1 #V2 #HV12 #W1 #W2 #HW12 #T1 #T2 #H @(cpms_ind_dx … H) -T2
130 /4 width=7 by cpms_step_dx, cpm_cpms, cpms_bind_dx, cpms_appl_dx, cpm_beta/
131 qed.
132
133 (* Basic_2A1: uses: cprs_theta_dx *)
134 lemma cpms_theta_dx (n) (h) (G) (L):
135                     ∀V1,V. ⦃G, L⦄ ⊢ V1 ➡[h] V →
136                     ∀V2. ⬆*[1] V ≘ V2 →
137                     ∀W1,W2. ⦃G, L⦄ ⊢ W1 ➡[h] W2 →
138                     ∀T1,T2. ⦃G, L.ⓓW1⦄ ⊢ T1 ➡*[n, h] T2 →
139                     ∀p. ⦃G, L⦄ ⊢ ⓐV1.ⓓ{p}W1.T1 ➡*[n, h] ⓓ{p}W2.ⓐV2.T2.
140 #n #h #G #L #V1 #V #HV1 #V2 #HV2 #W1 #W2 #HW12 #T1 #T2 #H @(cpms_ind_dx … H) -T2
141 /4 width=9 by cpms_step_dx, cpm_cpms, cpms_bind_dx, cpms_appl_dx, cpm_theta/
142 qed.
143
144 (* Basic properties with r-transition ***************************************)
145
146 (* Basic_1: was: pr3_refl *)
147 lemma cprs_refl: ∀h,G,L. reflexive … (cpms h G L 0).
148 /2 width=1 by cpm_cpms/ qed.
149
150 (* Basic_2A1: removed theorems 5:
151               sta_cprs_scpds lstas_scpds scpds_strap1 scpds_fwd_cprs
152               scpds_inv_lstas_eq
153 *)