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/cpr_lift.ma".
16 include "basic_2/reducibility/cpr_cpr.ma".
17 include "basic_2/reducibility/lcpr_cpr.ma".
18 include "basic_2/computation/cprs_lcpr.ma".
20 (* CONTEXT-SENSITIVE PARALLEL COMPUTATION ON TERMS **************************)
22 (* Advanced properties ******************************************************)
24 lemma cprs_abbr_dx: ∀L,V1,V2. L ⊢ V1 ➡ V2 → ∀T1,T2. L. ⓓV1 ⊢ T1 ➡* T2 →
25 L ⊢ ⓓV1. T1 ➡* ⓓV2. T2.
26 #L #V1 #V2 #HV12 #T1 #T2 #HT12 @(cprs_ind_dx … HT12) -T1
28 | #T1 #T #HT1 #_ #IHT1
29 @(cprs_strap2 … IHT1) -IHT1 /2 width=1/
33 lemma cpr_abbr: ∀L,V1,V2. L ⊢ V1 ➡ V2 → ∀T1,T2. L. ⓓV1 ⊢ T1 ➡ T2 →
34 L ⊢ ⓓV1. T1 ➡* ⓓV2. T2.
37 lemma cpr_abbr2: ∀L,V1,V2. L ⊢ V1 ➡ V2 → ∀T1,T2. L. ⓓV2 ⊢ T1 ➡ T2 →
38 L ⊢ ⓓV1. T1 ➡* ⓓV2. T2.
39 #L #V1 #V2 #HV12 #T1 #T2 #HT12
40 lapply (lcpr_cpr_trans (L. ⓓV1) … HT12) /2 width=1/
43 (* Basic_1: was: pr3_strip *)
44 lemma cprs_strip: ∀L,T1,T. L ⊢ T ➡* T1 → ∀T2. L ⊢ T ➡ T2 →
45 ∃∃T0. L ⊢ T1 ➡ T0 & L ⊢ T2 ➡* T0.
48 (* Advanced inversion lemmas ************************************************)
50 (* Basic_1: was pr3_gen_appl *)
51 lemma cprs_inv_appl1: ∀L,V1,T1,U2. L ⊢ ⓐV1. T1 ➡* U2 →
52 ∨∨ ∃∃V2,T2. L ⊢ V1 ➡* V2 & L ⊢ T1 ➡* T2 &
54 | ∃∃V2,W,T. L ⊢ V1 ➡* V2 &
55 L ⊢ T1 ➡* ⓛW. T & L ⊢ ⓓV2. T ➡* U2
56 | ∃∃V0,V2,V,T. L ⊢ V1 ➡* V0 & ⇧[0,1] V0 ≡ V2 &
57 L ⊢ T1 ➡* ⓓV. T & L ⊢ ⓓV. ⓐV2. T ➡* U2.
58 #L #V1 #T1 #U2 #H @(cprs_ind … H) -U2 /3 width=5/
60 [ #V0 #T0 #HV10 #HT10 #H destruct
61 elim (cpr_inv_appl1 … HU2) -HU2 *
62 [ #V2 #T2 #HV02 #HT02 #H destruct /4 width=5/
63 | #V2 #W2 #T #T2 #HV02 #HT2 #H1 #H2 destruct /4 width=7/
64 | #V #V2 #W0 #W2 #T #T2 #HV0 #HW02 #HT2 #HV2 #H1 #H2 destruct
65 @or3_intro2 @(ex4_4_intro … HV2 HT10) /2 width=3/ /3 width=1/ (**) (* explicit constructor. /5 width=8/ is too slow because TC_transitive gets in the way *)
72 (* Main propertis ***********************************************************)
74 (* Basic_1: was: pr3_confluence *)
75 theorem cprs_conf: ∀L,T1,T. L ⊢ T ➡* T1 → ∀T2. L ⊢ T ➡* T2 →
76 ∃∃T0. L ⊢ T1 ➡* T0 & L ⊢ T2 ➡* T0.
79 (* Basic_1: was: pr3_t *)
80 theorem cprs_trans: ∀L,T1,T. L ⊢ T1 ➡* T → ∀T2. L ⊢ T ➡* T2 → L ⊢ T1 ➡* T2.
83 (* Basic_1: was: pr3_flat *)
84 lemma cprs_flat: ∀I,L,T1,T2. L ⊢ T1 ➡* T2 → ∀V1,V2. L ⊢ V1 ➡* V2 →
85 L ⊢ ⓕ{I} V1. T1 ➡* ⓕ{I} V2. T2.
86 #I #L #T1 #T2 #HT12 #V1 #V2 #HV12 @(cprs_ind … HV12) -V2 /2 width=1/
88 @(cprs_trans … IHV1) -IHV1 /2 width=1/
91 lemma cprs_abbr: ∀L,V1,T1,T2. L. ⓓV1 ⊢ T1 ➡* T2 → ∀V2. L ⊢ V1 ➡* V2 →
92 L ⊢ ⓓV1. T1 ➡* ⓓV2. T2.
93 #L #V1 #T1 #T2 #HT12 #V2 #HV12 @(cprs_ind … HV12) -V2 /2 width=1/
95 @(cprs_trans … IHV1) -IHV1 /2 width=1/
98 (* Basic_1: was only: pr3_pr2_pr3_t pr3_wcpr0_t *)
99 lemma lcpr_cprs_trans: ∀L1,L2. L1 ⊢ ➡ L2 →
100 ∀T1,T2. L2 ⊢ T1 ➡* T2 → L1 ⊢ T1 ➡* T2.
101 #L1 #L2 #HL12 #T1 #T2 #H @(cprs_ind … H) -T2 //
103 @(cprs_trans … IHT2) /2 width=3/