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/relocation/llpx_sn_tc.ma".
16 include "basic_2/computation/cprs_cprs.ma".
17 include "basic_2/computation/llprs.ma".
19 (* LAZY SN PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS ***********************)
21 (* Advanced properties ******************************************************)
23 lemma llprs_pair_dx: ∀G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ➡* V2 →
24 ∀I,T. ⦃G, L.ⓑ{I}V1⦄ ⊢ ➡*[T, 0] L.ⓑ{I}V2.
25 /2 width=1 by llpx_sn_TC_pair_dx/ qed.
27 (* Properties on context-sensitive parallel computation for terms ***********)
29 lemma llprs_cpr_trans: ∀G. s_r_transitive … (cpr G) (llprs G 0).
30 /3 width=5 by cprs_llpr_trans, s_r_trans_LTC2/ qed-.
32 (* Basic_1: was just: pr3_pr3_pr3_t *)
33 lemma llprs_cprs_trans: ∀G. s_rs_transitive … (cpr G) (llprs G 0).
34 #G @s_r_to_s_rs_trans @s_r_trans_LTC2
35 /3 width=5 by cprs_llpr_trans, s_rs_trans_TC1/ (**) (* full auto too slow *)
38 (* Note: this is an instance of a general theorem *)
39 lemma llprs_cprs_conf_dx: ∀G2,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ➡* U2 →
40 ∀L0. ⦃G2, L0⦄ ⊢ ➡*[T2, O] L2 → ⦃G2, L0⦄ ⊢ ➡*[U2, O] L2.
41 #G2 #L2 #T2 #U2 #HTU2 #L0 #H @(llprs_ind_dx … H) -L0 //
42 #L0 #L #HL0 #HL2 #IHL2 @(llprs_strap2 … IHL2) -IHL2
43 lapply (llprs_cprs_trans … HTU2 … HL2) -L2 #HTU2
44 /3 width=3 by cprs_llpr_trans, cprs_llpr_conf/
47 (* Note: this is an instance of a general theorem *)
48 lemma llprs_cpr_conf_dx: ∀G2,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ➡ U2 →
49 ∀L0. ⦃G2, L0⦄ ⊢ ➡*[T2, O] L2 → ⦃G2, L0⦄ ⊢ ➡*[U2, O] L2.
50 #G2 #L2 #T2 #U2 #HTU2 #L0 #H @(llprs_ind_dx … H) -L0 //
51 #L0 #L #HL0 #HL2 #IHL2 @(llprs_strap2 … IHL2) -IHL2
52 lapply (llprs_cpr_trans … HTU2 … HL2) -L2 #HTU2
53 /3 width=3 by cprs_llpr_trans, cprs_llpr_conf/
56 lemma llprs_cprs_conf_sn: ∀G,L0,L1,T0. ⦃G, L0⦄ ⊢ ➡*[T0, 0] L1 →
57 ∀T1. ⦃G, L0⦄ ⊢ T0 ➡* T1 →
58 ∃∃T. ⦃G, L0⦄ ⊢ T1 ➡* T & ⦃G, L1⦄ ⊢ T0 ➡* T.
59 #G #L0 #L1 #T0 #H @(llprs_ind_dx … H) -L0 /2 width=3 by ex2_intro/
60 #L0 #L #HL0 #HL1 #IHL1 #T1 #HT01 elim (cprs_llpr_conf_sn … HT01 … HL0)
61 #T2 #HT12 #HT02 elim (IHL1 … HT02) -IHL1 -HT02
62 lapply (cprs_trans … HT01 … HT12) #HT02
63 lapply (cprs_llpr_conf … HT02 … HL0) -HT02 -HL0
64 /4 width=5 by cprs_llpr_trans, cprs_trans, ex2_intro/
67 lemma llprs_cpr_conf_sn: ∀G,L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ➡ T1 →
68 ∀L1. ⦃G, L0⦄ ⊢ ➡*[T0, 0] L1 →
69 ∃∃T. ⦃G, L0⦄ ⊢ T1 ➡* T & ⦃G, L1⦄ ⊢ T0 ➡* T.
70 /3 width=3 by llprs_cprs_conf_sn, cpr_cprs/ qed-.
72 lemma cprs_bind2: ∀G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ➡* V2 →
73 ∀I,T1,T2. ⦃G, L.ⓑ{I}V2⦄ ⊢ T1 ➡* T2 →
74 ∀a. ⦃G, L⦄ ⊢ ⓑ{a,I}V1.T1 ➡* ⓑ{a,I}V2.T2.
75 /4 width=3 by llprs_cprs_trans, llprs_pair_dx, cprs_bind/ qed-.
77 (* Inversion lemmas on context-sensitive parallel computation for terms *****)
79 (* Basic_1: was: pr3_gen_abst *)
80 lemma cprs_inv_abst1: ∀a,G,L,W1,T1,U2. ⦃G, L⦄ ⊢ ⓛ{a}W1.T1 ➡* U2 →
81 ∃∃W2,T2. ⦃G, L⦄ ⊢ W1 ➡* W2 & ⦃G, L.ⓛW1⦄ ⊢ T1 ➡* T2 &
83 #a #G #L #V1 #T1 #U2 #H @(cprs_ind … H) -U2 /2 width=5 by ex3_2_intro/
84 #U0 #U2 #_ #HU02 * #V0 #T0 #HV10 #HT10 #H destruct
85 elim (cpr_inv_abst1 … HU02) -HU02 #V2 #T2 #HV02 #HT02 #H destruct
86 lapply (llprs_cpr_trans … HT02 (L.ⓛV1) ?)
87 /3 width=5 by llprs_pair_dx, cprs_trans, cprs_strap1, ex3_2_intro/
90 lemma cprs_inv_abst: ∀a,G,L,W1,W2,T1,T2. ⦃G, L⦄ ⊢ ⓛ{a}W1.T1 ➡* ⓛ{a}W2.T2 →
91 ⦃G, L⦄ ⊢ W1 ➡* W2 ∧ ⦃G, L.ⓛW1⦄ ⊢ T1 ➡* T2.
92 #a #G #L #W1 #W2 #T1 #T2 #H
93 elim (cprs_inv_abst1 … H) -H #W #T #HW1 #HT1 #H destruct /2 width=1 by conj/
96 (* Basic_1: was pr3_gen_abbr *)
97 lemma cprs_inv_abbr1: ∀a,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓓ{a}V1.T1 ➡* U2 → (
98 ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡* V2 & ⦃G, L.ⓓV1⦄ ⊢ T1 ➡* T2 &
101 ∃∃T2. ⦃G, L.ⓓV1⦄ ⊢ T1 ➡* T2 & ⇧[0, 1] U2 ≡ T2 & a = true.
102 #a #G #L #V1 #T1 #U2 #H @(cprs_ind … H) -U2 /3 width=5 by ex3_2_intro, or_introl/
104 [ #V0 #T0 #HV10 #HT10 #H destruct
105 elim (cpr_inv_abbr1 … HU02) -HU02 *
106 [ #V2 #T2 #HV02 #HT02 #H destruct
107 lapply (llprs_cpr_trans … HT02 (L.ⓓV1) ?)
108 /4 width=5 by llprs_pair_dx, cprs_trans, cprs_strap1, ex3_2_intro, or_introl/
110 lapply (llprs_cpr_trans … HT02 (L.ⓓV1) ?) -HT02
111 /4 width=3 by llprs_pair_dx, cprs_trans, ex3_intro, or_intror/
114 elim (lift_total U2 0 1) #U #HU2
115 lapply (cpr_lift … HU02 (L.ⓓV1) … HU01 … HU2) -U0
116 /4 width=3 by cprs_strap1, ldrop_drop, ex3_intro, or_intror/
120 (* Note: we loose lprs_cprs_conf_dx and derivatives:
121 lprs_cpr_conf_dx lprs_cprs_conf