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/rt_transition/lpr_lpr.ma".
16 include "basic_2/rt_computation/cpms_cpms.ma".
18 (* CONTEXT-SENSITIVE PARALLEL COMPUTATION FOR TERMS *************************)
20 (* Main properties **********************************************************)
22 (* Basic_1: was: pr3_t *)
23 (* Basic_1: includes: pr1_t *)
24 theorem cprs_trans: ∀G,L. Transitive … (cprs G L).
25 normalize /2 width=3 by trans_TC/ qed-.
27 (* Basic_1: was: pr3_confluence *)
28 (* Basic_1: includes: pr1_confluence *)
29 theorem cprs_conf: ∀G,L. confluent2 … (cprs G L) (cprs G L).
30 normalize /3 width=3 by cpr_conf, TC_confluent2/ qed-.
32 (* Basic_1: was: pr3_flat *)
33 theorem cprs_flat (h) (G) (L):
34 ∀T1,T2. ⦃G, L⦄ ⊢ T1 ➡*[h] T2 →
35 ∀V1,V2. ⦃G, L⦄ ⊢ V1 ➡*[h] V2 →
36 ∀I. ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ➡*[h] ⓕ{I}V2.T2.
37 #h #G #L #T1 #T2 #HT12 #V1 #V2 #H @(cprs_ind_dx … H) -V2
38 [ /2 width=3 by cprs_flat_dx/
39 | /3 width=3 by cpr_pair_sn, cprs_step_dx/
43 (* Advanced inversion lemmas ************************************************)
45 (* Basic_1: was pr3_gen_appl *)
46 lemma cprs_inv_appl1: ∀G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓐV1.T1 ➡* U2 →
47 ∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡* V2 & ⦃G, L⦄ ⊢ T1 ➡* T2 &
49 | ∃∃a,W,T. ⦃G, L⦄ ⊢ T1 ➡* ⓛ{a}W.T &
50 ⦃G, L⦄ ⊢ ⓓ{a}ⓝW.V1.T ➡* U2
51 | ∃∃a,V0,V2,V,T. ⦃G, L⦄ ⊢ V1 ➡* V0 & ⬆[0,1] V0 ≘ V2 &
52 ⦃G, L⦄ ⊢ T1 ➡* ⓓ{a}V.T &
53 ⦃G, L⦄ ⊢ ⓓ{a}V.ⓐV2.T ➡* U2.
54 #G #L #V1 #T1 #U2 #H @(cprs_ind … H) -U2 /3 width=5 by or3_intro0, ex3_2_intro/
56 [ #V0 #T0 #HV10 #HT10 #H destruct
57 elim (cpr_inv_appl1 … HU2) -HU2 *
58 [ #V2 #T2 #HV02 #HT02 #H destruct /4 width=5 by cprs_strap1, or3_intro0, ex3_2_intro/
59 | #a #V2 #W #W2 #T #T2 #HV02 #HW2 #HT2 #H1 #H2 destruct
60 lapply (cprs_strap1 … HV10 … HV02) -V0 #HV12
61 lapply (lsubr_cpr_trans … HT2 (L.ⓓⓝW.V1) ?) -HT2
62 /5 width=5 by cprs_bind, cprs_flat_dx, cpr_cprs, lsubr_beta, ex2_3_intro, or3_intro1/
63 | #a #V #V2 #W0 #W2 #T #T2 #HV0 #HV2 #HW02 #HT2 #H1 #H2 destruct
64 /5 width=10 by cprs_flat_sn, cprs_bind_dx, cprs_strap1, ex4_5_intro, or3_intro2/
66 | /4 width=9 by cprs_strap1, or3_intro1, ex2_3_intro/
67 | /4 width=11 by cprs_strap1, or3_intro2, ex4_5_intro/
71 (* Basic_1: was: pr3_strip *)
72 (* Basic_1: includes: pr1_strip *)
73 lemma cprs_strip: ∀G,L. confluent2 … (cprs G L) (cpr G L).
74 normalize /4 width=3 by cpr_conf, TC_strip1/ qed-.
76 lemma cprs_lpr_conf_dx: ∀G,L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ➡* T1 → ∀L1. ⦃G, L0⦄ ⊢ ➡ L1 →
77 ∃∃T. ⦃G, L1⦄ ⊢ T1 ➡* T & ⦃G, L1⦄ ⊢ T0 ➡* T.
78 #G #L0 #T0 #T1 #H @(cprs_ind … H) -T1 /2 width=3 by ex2_intro/
79 #T #T1 #_ #HT1 #IHT0 #L1 #HL01 elim (IHT0 … HL01)
80 #T2 #HT2 #HT02 elim (lpr_cpr_conf_dx … HT1 … HL01) -L0
81 #T3 #HT3 #HT13 elim (cprs_strip … HT2 … HT3) -T
82 /4 width=5 by cprs_strap2, cprs_strap1, ex2_intro/
85 lemma cprs_lpr_conf_sn: ∀G,L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ➡* T1 →
87 ∃∃T. ⦃G, L0⦄ ⊢ T1 ➡* T & ⦃G, L1⦄ ⊢ T0 ➡* T.
88 #G #L0 #T0 #T1 #HT01 #L1 #HL01 elim (cprs_lpr_conf_dx … HT01 … HL01) -HT01
89 /3 width=3 by lpr_cprs_trans, ex2_intro/