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/substitution/fqus_fqus.ma".
16 include "basic_2/unfold/lsstas_lift.ma".
17 include "basic_2/reduction/llpx_ldrop.ma".
18 include "basic_2/computation/cpxs.ma".
20 (* CONTEXT-SENSITIVE EXTENDED PARALLEL COMPUTATION ON TERMS *****************)
22 (* Advanced properties ******************************************************)
24 lemma lsstas_cpxs: ∀h,g,G,L,T1,T2,l1. ⦃G, L⦄ ⊢ T1 •* [h, g, l1] T2 →
25 ∀l2. ⦃G, L⦄ ⊢ T1 ▪ [h, g] l2 → l1 ≤ l2 → ⦃G, L⦄ ⊢ T1 ➡*[h, g] T2.
26 #h #g #G #L #T1 #T2 #l1 #H @(lsstas_ind_dx … H) -T2 -l1 //
27 #l1 #T #T2 #HT1 #HT2 #IHT1 #l2 #Hl2 #Hl12
28 lapply (lsstas_da_conf … HT1 … Hl2) -HT1
29 >(plus_minus_m_m (l2-l1) 1 ?)
30 [ /4 width=5 by cpxs_strap1, ssta_cpx, lt_to_le/
31 | /2 width=1 by monotonic_le_minus_r/
35 lemma cpxs_delta: ∀h,g,I,G,L,K,V,V2,i.
36 ⇩[i] L ≡ K.ⓑ{I}V → ⦃G, K⦄ ⊢ V ➡*[h, g] V2 →
37 ∀W2. ⇧[0, i+1] V2 ≡ W2 → ⦃G, L⦄ ⊢ #i ➡*[h, g] W2.
38 #h #g #I #G #L #K #V #V2 #i #HLK #H elim H -V2
39 [ /3 width=9 by cpx_cpxs, cpx_delta/
40 | #V1 lapply (ldrop_fwd_drop2 … HLK) -HLK
41 elim (lift_total V1 0 (i+1)) /4 width=12 by cpx_lift, cpxs_strap1/
45 lemma cpxs_llpx_conf: ∀h,g,G. s_r_confluent1 … (cpxs h g G) (llpx h g G 0).
46 /3 width=5 by llpx_cpx_conf, s_r_conf1_LTC1/ qed-.
48 (* Advanced inversion lemmas ************************************************)
50 lemma cpxs_inv_lref1: ∀h,g,G,L,T2,i. ⦃G, L⦄ ⊢ #i ➡*[h, g] T2 →
52 ∃∃I,K,V1,T1. ⇩[i] L ≡ K.ⓑ{I}V1 & ⦃G, K⦄ ⊢ V1 ➡*[h, g] T1 &
54 #h #g #G #L #T2 #i #H @(cpxs_ind … H) -T2 /2 width=1 by or_introl/
57 elim (cpx_inv_lref1 … HT2) -HT2 /2 width=1 by or_introl/
58 * /4 width=7 by cpx_cpxs, ex3_4_intro, or_intror/
59 | * #I #K #V1 #T1 #HLK #HVT1 #HT1
60 lapply (ldrop_fwd_drop2 … HLK) #H0LK
61 elim (cpx_inv_lift1 … HT2 … H0LK … HT1) -H0LK -T
62 /4 width=7 by cpxs_strap1, ex3_4_intro, or_intror/
66 (* Relocation properties ****************************************************)
68 lemma cpxs_lift: ∀h,g,G. l_liftable (cpxs h g G).
69 /3 width=10 by cpx_lift, cpxs_strap1, l_liftable_LTC/ qed.
71 lemma cpxs_inv_lift1: ∀h,g,G. l_deliftable_sn (cpxs h g G).
72 /3 width=6 by l_deliftable_sn_LTC, cpx_inv_lift1/
75 (* Properties on supclosure *************************************************)
77 lemma fqu_cpxs_trans: ∀h,g,G1,G2,L1,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ➡*[h, g] U2 →
78 ∀T1. ⦃G1, L1, T1⦄ ⊃ ⦃G2, L2, T2⦄ →
79 ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡*[h, g] U1 & ⦃G1, L1, U1⦄ ⊃ ⦃G2, L2, U2⦄.
80 #h #g #G1 #G2 #L1 #L2 #T2 #U2 #H @(cpxs_ind_dx … H) -T2 /2 width=3 by ex2_intro/
81 #T #T2 #HT2 #_ #IHTU2 #T1 #HT1 elim (fqu_cpx_trans … HT1 … HT2) -T
82 #T #HT1 #HT2 elim (IHTU2 … HT2) -T2 /3 width=3 by cpxs_strap2, ex2_intro/
85 lemma fquq_cpxs_trans: ∀h,g,G1,G2,L1,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ➡*[h, g] U2 →
86 ∀T1. ⦃G1, L1, T1⦄ ⊃⸮ ⦃G2, L2, T2⦄ →
87 ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡*[h, g] U1 & ⦃G1, L1, U1⦄ ⊃⸮ ⦃G2, L2, U2⦄.
88 #h #g #G1 #G2 #L1 #L2 #T2 #U2 #HTU2 #T1 #H elim (fquq_inv_gen … H) -H
89 [ #HT12 elim (fqu_cpxs_trans … HTU2 … HT12) /3 width=3 by fqu_fquq, ex2_intro/
90 | * #H1 #H2 #H3 destruct /2 width=3 by ex2_intro/
94 lemma fquq_lsstas_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃⸮ ⦃G2, L2, T2⦄ →
95 ∀U2,l1. ⦃G2, L2⦄ ⊢ T2 •*[h, g, l1] U2 →
96 ∀l2. ⦃G2, L2⦄ ⊢ T2 ▪ [h, g] l2 → l1 ≤ l2 →
97 ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡*[h, g] U1 & ⦃G1, L1, U1⦄ ⊃⸮ ⦃G2, L2, U2⦄.
98 /3 width=5 by fquq_cpxs_trans, lsstas_cpxs/ qed-.
100 lemma fqup_cpxs_trans: ∀h,g,G1,G2,L1,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ➡*[h, g] U2 →
101 ∀T1. ⦃G1, L1, T1⦄ ⊃+ ⦃G2, L2, T2⦄ →
102 ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡*[h, g] U1 & ⦃G1, L1, U1⦄ ⊃+ ⦃G2, L2, U2⦄.
103 #h #g #G1 #G2 #L1 #L2 #T2 #U2 #H @(cpxs_ind_dx … H) -T2 /2 width=3 by ex2_intro/
104 #T #T2 #HT2 #_ #IHTU2 #T1 #HT1 elim (fqup_cpx_trans … HT1 … HT2) -T
105 #U1 #HTU1 #H2 elim (IHTU2 … H2) -T2 /3 width=3 by cpxs_strap2, ex2_intro/
108 lemma fqus_cpxs_trans: ∀h,g,G1,G2,L1,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ➡*[h, g] U2 →
109 ∀T1. ⦃G1, L1, T1⦄ ⊃* ⦃G2, L2, T2⦄ →
110 ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡*[h, g] U1 & ⦃G1, L1, U1⦄ ⊃* ⦃G2, L2, U2⦄.
111 #h #g #G1 #G2 #L1 #L2 #T2 #U2 #HTU2 #T1 #H elim (fqus_inv_gen … H) -H
112 [ #HT12 elim (fqup_cpxs_trans … HTU2 … HT12) /3 width=3 by fqup_fqus, ex2_intro/
113 | * #H1 #H2 #H3 destruct /2 width=3 by ex2_intro/
117 lemma fqus_lsstas_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃* ⦃G2, L2, T2⦄ →
118 ∀U2,l1. ⦃G2, L2⦄ ⊢ T2 •*[h, g, l1] U2 →
119 ∀l2. ⦃G2, L2⦄ ⊢ T2 ▪ [h, g] l2 → l1 ≤ l2 →
120 ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡*[h, g] U1 & ⦃G1, L1, U1⦄ ⊃* ⦃G2, L2, U2⦄.
121 /3 width=7 by fqus_cpxs_trans, lsstas_cpxs/ qed-.