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/reducibility/fpr_cpr.ma".
16 include "basic_2/computation/cprs_lfprs.ma".
17 include "basic_2/computation/lfprs_ltprs.ma".
18 include "basic_2/computation/lfprs_fprs.ma".
20 (* CONTEXT-FREE PARALLEL COMPUTATION ON CLOSURES ****************************)
22 (* Advanced properties ******************************************************)
24 lemma fprs_flat_dx_tpr: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ➡* ⦃L2, T2⦄ → ∀V1,V2. V1 ➡ V2 →
25 ∀I. ⦃L1, ⓕ{I}V1.T1⦄ ➡* ⦃L2, ⓕ{I}V2.T2⦄.
26 #L1 #L2 #T1 #T2 #HT12 @(fprs_ind … HT12) -L2 -T2 /3 width=1/
27 #L #L2 #T #T2 #_ #HT2 #IHT2 #V1 #V2 #HV12 #I
28 lapply (IHT2 … HV12 I) -IHT2 -HV12 /3 width=6/
31 lemma fprs_bind2_minus: ∀I,L1,L2,V1,T1,U2. ⦃L1, -ⓑ{I}V1.T1⦄ ➡* ⦃L2, U2⦄ →
32 ∃∃V2,T2. ⦃L1.ⓑ{I}V1, T1⦄ ➡* ⦃L2.ⓑ{I}V2, T2⦄ &
34 #I #L1 #L2 #V1 #T1 #U2 #H @(fprs_ind … H) -L2 -U2 /2 width=4/
35 #L #L2 #U #U2 #_ #HU2 * #V #T #HT1 #H destruct
36 elim (fpr_bind2_minus … HU2) -HU2 /3 width=4/
39 lemma fprs_lift: ∀K1,K2,T1,T2. ⦃K1, T1⦄ ➡* ⦃K2, T2⦄ →
40 ∀d,e,L1. ⇩[d, e] L1 ≡ K1 →
41 ∀U1,U2. ⇧[d, e] T1 ≡ U1 → ⇧[d, e] T2 ≡ U2 →
42 ∃∃L2. ⦃L1, U1⦄ ➡* ⦃L2, U2⦄ & ⇩[d, e] L2 ≡ K2.
43 #K1 #K2 #T1 #T2 #HT12 @(fprs_ind … HT12) -K2 -T2
44 [ #d #e #L1 #HLK1 #U1 #U2 #HTU1 #HTU2
45 >(lift_mono … HTU2 … HTU1) -U2 /2 width=3/
46 | #K #K2 #T #T2 #_ #HT2 #IHT1 #d #e #L1 #HLK1 #U1 #U2 #HTU1 #HTU2
47 elim (lift_total T d e) #U #HTU
48 elim (IHT1 … HLK1 … HTU1 HTU) -K1 -T1 #L #HU1 #HKL
49 elim (fpr_lift … HT2 … HKL … HTU HTU2) -K -T -T2 /3 width=4/
53 (* Advanced inversion lemmas ************************************************)
55 lemma fprs_inv_pair1: ∀I,K1,L2,V1,T1,T2. ⦃K1.ⓑ{I}V1, T1⦄ ➡* ⦃L2, T2⦄ →
56 ∃∃K2,V2. ⦃K1, V1⦄ ➡* ⦃K2, V2⦄ &
57 ⦃K1, -ⓑ{I}V1.T1⦄ ➡* ⦃K2, -ⓑ{I}V2.T2⦄ &
59 #I #K1 #L2 #V1 #T1 #T2 #H @(fprs_ind … H) -L2 -T2 /2 width=5/
60 #L #L2 #T #T2 #_ #HT2 * #K #V #HV1 #HT1 #H destruct
61 elim (fpr_inv_pair1 … HT2) -HT2 #K2 #V2 #HV2 #HT2 #H destruct /3 width=5/
64 lemma fprs_inv_pair3: ∀I,L1,K2,V2,T1,T2. ⦃L1, T1⦄ ➡* ⦃K2.ⓑ{I}V2, T2⦄ →
65 ∃∃K1,V1. ⦃K1, V1⦄ ➡* ⦃K2, V2⦄ &
66 ⦃K1, -ⓑ{I}V1.T1⦄ ➡* ⦃K2, -ⓑ{I}V2.T2⦄ &
68 #I2 #L1 #K2 #V2 #T1 #T2 #H @(fprs_ind_dx … H) -L1 -T1 /2 width=5/
69 #L1 #L #T1 #T #HT1 #_ * #K #V #HV2 #HT2 #H destruct
70 elim (fpr_inv_pair3 … HT1) -HT1 #K1 #V1 #HV1 #HT1 #H destruct /3 width=5/
73 (* Advanced forward lemmas **************************************************)
75 lemma fprs_fwd_bind2_minus: ∀I,L1,L,V1,T1,T. ⦃L1, -ⓑ{I}V1.T1⦄ ➡* ⦃L, T⦄ → ∀b.
76 ∃∃V2,T2. ⦃L1, ⓑ{b,I}V1.T1⦄ ➡* ⦃L, ⓑ{b,I}V2.T2⦄ &
78 #I #L1 #L #V1 #T1 #T #H1 #b @(fprs_ind … H1) -L -T /2 width=4/
79 #L0 #L #T0 #T #_ #H0 * #W1 #U1 #HTU1 #H destruct
80 elim (fpr_fwd_bind2_minus … H0 b) -H0 /3 width=4/
83 lemma fprs_fwd_pair1_full: ∀I,K1,L2,V1,T1,T2. ⦃K1.ⓑ{I}V1, T1⦄ ➡* ⦃L2, T2⦄ →
84 ∀b. ∃∃K2,V2. ⦃K1, V1⦄ ➡* ⦃K2, V2⦄ &
85 ⦃K1, ⓑ{b,I}V1.T1⦄ ➡* ⦃K2, ⓑ{b,I}V2.T2⦄ &
87 #I #K1 #L2 #V1 #T1 #T2 #H #b
88 elim (fprs_inv_pair1 … H) -H #K2 #V2 #HV12 #HT12 #H destruct
89 elim (fprs_fwd_bind2_minus … HT12 b) -HT12 #W1 #U1 #HTU1 #H destruct /2 width=5/
92 lemma fprs_fwd_abst2: ∀a,L1,L2,V1,T1,U2. ⦃L1, ⓛ{a}V1.T1⦄ ➡* ⦃L2, U2⦄ → ∀b,I,W.
93 ∃∃V2,T2. ⦃L1, ⓑ{b,I}W.T1⦄ ➡* ⦃L2, ⓑ{b,I}W.T2⦄ &
95 #a #L1 #L2 #V1 #T1 #U2 #H #b #I #W @(fprs_ind … H) -L2 -U2 /2 width=4/
96 #L #L2 #U #U2 #_ #H2 * #V #T #HT1 #H destruct
97 elim (fpr_fwd_abst2 … H2 b I W) -H2 /3 width=4/
100 (* Properties on context-sensitive parallel computation for terms ***********)
102 lemma cprs_fprs: ∀L,T1,T2. L ⊢ T1 ➡* T2 → ⦃L, T1⦄ ➡* ⦃L, T2⦄.
103 #L #T1 #T2 #H @(cprs_ind … H) -T2 // /3 width=4/
106 (* Forward lemmas on context-sensitive parallel computation for terms *******)
108 lemma fprs_fwd_cprs: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ➡* ⦃L2, T2⦄ → L1 ⊢ T1 ➡* T2.
109 #L1 #L2 #T1 #T2 #H @(fprs_ind … H) -L2 -T2 //
110 #L #L2 #T #T2 #H1 #H2 #IH1
111 elim (fpr_inv_all … H2) -H2 #L0 #HL0 #HT2 #_ -L2
112 lapply (lfprs_cpr_trans L1 … HT2) -HT2 /3 width=3/
115 (* Advanced properties ******************************************************)
117 lamma fpr_bind_sn: ∀L1,L2,V1,V2. ⦃L1, V1⦄ ➡ ⦃L2, V2⦄ → ∀T1,T2. T1 ➡ T2 →
118 ∀a,I. ⦃L1, ⓑ{a,I}V1.T1⦄ ➡ ⦃L2, ⓑ{a,I}V2.T2⦄.
119 #L1 #L2 #V1 #V2 #H #T1 #T2 #HT12 #a #I
120 elim (fpr_inv_all … H) /3 width=4/
123 (* Advanced forward lemmas **************************************************)
125 lamma fpr_fwd_shift_bind_minus: ∀I1,I2,L1,L2,V1,V2,T1,T2.
126 ⦃L1, -ⓑ{I1}V1.T1⦄ ➡ ⦃L2, -ⓑ{I2}V2.T2⦄ →
127 ⦃L1, V1⦄ ➡ ⦃L2, V2⦄ ∧ I1 = I2.
128 * #I2 #L1 #L2 #V1 #V2 #T1 #T2 #H
129 elim (fpr_inv_all … H) -H #L #HL1 #H #HL2
130 [ elim (cpr_inv_abbr1 … H) -H *
131 [ #V #V0 #T #HV1 #HV0 #_ #H destruct /4 width=4/
132 | #T #_ #_ #H destruct
134 | elim (cpr_inv_abst1 … H Abst V2) -H
135 #V #T #HV1 #_ #H destruct /3 width=4/