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/cnf.ma".
16 include "basic_2/computation/tprs.ma".
18 (* CONTEXT-SENSITIVE PARALLEL COMPUTATION ON TERMS **************************)
20 (* Basic_1: includes: pr3_pr2 *)
21 definition cprs: lenv → relation term ≝
24 interpretation "context-sensitive parallel computation (term)"
25 'PRedStar L T1 T2 = (cprs L T1 T2).
27 (* Basic eliminators ********************************************************)
29 lemma cprs_ind: ∀L,T1. ∀R:predicate term. R T1 →
30 (∀T,T2. L ⊢ T1 ➡* T → L ⊢ T ➡ T2 → R T → R T2) →
31 ∀T2. L ⊢ T1 ➡* T2 → R T2.
32 #L #T1 #R #HT1 #IHT1 #T2 #HT12
33 @(TC_star_ind … HT1 IHT1 … HT12) //
36 lemma cprs_ind_dx: ∀L,T2. ∀R:predicate term. R T2 →
37 (∀T1,T. L ⊢ T1 ➡ T → L ⊢ T ➡* T2 → R T → R T1) →
38 ∀T1. L ⊢ T1 ➡* T2 → R T1.
39 #L #T2 #R #HT2 #IHT2 #T1 #HT12
40 @(TC_star_ind_dx … HT2 IHT2 … HT12) //
43 (* Basic properties *********************************************************)
45 (* Basic_1: was: pr3_refl *)
46 lemma cprs_refl: ∀L,T. L ⊢ T ➡* T.
49 lemma cprs_strap1: ∀L,T1,T,T2.
50 L ⊢ T1 ➡* T → L ⊢ T ➡ T2 → L ⊢ T1 ➡* T2.
53 (* Basic_1: was: pr3_step *)
54 lemma cprs_strap2: ∀L,T1,T,T2.
55 L ⊢ T1 ➡ T → L ⊢ T ➡* T2 → L ⊢ T1 ➡* T2.
58 (* Note: it does not hold replacing |L1| with |L2| *)
59 lemma cprs_lsubs_trans: ∀L1,T1,T2. L1 ⊢ T1 ➡* T2 →
60 ∀L2. L2 ≼ [0, |L1|] L1 → L2 ⊢ T1 ➡* T2.
64 (* Basic_1: was only: pr3_thin_dx *)
65 lemma cprs_flat_dx: ∀I,L,V1,V2. L ⊢ V1 ➡ V2 → ∀T1,T2. L ⊢ T1 ➡* T2 →
66 L ⊢ ⓕ{I} V1. T1 ➡* ⓕ{I} V2. T2.
67 #I #L #V1 #V2 #HV12 #T1 #T2 #HT12 @(cprs_ind … HT12) -T2 /3 width=1/
69 @(cprs_strap1 … IHT2) -IHT2 /2 width=1/
72 (* Basic_1: was: pr3_pr1 *)
73 lemma tprs_cprs: ∀T1,T2. T1 ➡* T2 → ∀L. L ⊢ T1 ➡* T2.
74 #T1 #T2 #H @(tprs_ind … H) -T2 /2 width=1/ /3 width=3/
77 (* Basic inversion lemmas ***************************************************)
79 (* Basic_1: was: pr3_gen_sort *)
80 lemma cprs_inv_sort1: ∀L,U2,k. L ⊢ ⋆k ➡* U2 → U2 = ⋆k.
81 #L #U2 #k #H @(cprs_ind … H) -U2 //
82 #U2 #U #_ #HU2 #IHU2 destruct
83 >(cpr_inv_sort1 … HU2) -HU2 //
86 (* Basic_1: was: pr3_gen_cast *)
87 lemma cprs_inv_cast1: ∀L,W1,T1,U2. L ⊢ ⓝW1.T1 ➡* U2 → L ⊢ T1 ➡* U2 ∨
88 ∃∃W2,T2. L ⊢ W1 ➡* W2 & L ⊢ T1 ➡* T2 & U2 = ⓝW2.T2.
89 #L #W1 #T1 #U2 #H @(cprs_ind … H) -U2 /3 width=5/
90 #U2 #U #_ #HU2 * /3 width=3/ *
91 #W #T #HW1 #HT1 #H destruct
92 elim (cpr_inv_cast1 … HU2) -HU2 /3 width=3/ *
93 #W2 #T2 #HW2 #HT2 #H destruct /4 width=5/
96 (* Basic_1: was: nf2_pr3_unfold *)
97 lemma cprs_inv_cnf1: ∀L,T,U. L ⊢ T ➡* U → L ⊢ 𝐍⦃T⦄ → T = U.
98 #L #T #U #H @(cprs_ind_dx … H) -T //
99 #T0 #T #H1T0 #_ #IHT #H2T0
100 lapply (H2T0 … H1T0) -H1T0 #H destruct /2 width=1/
103 lemma tprs_inv_cnf1: ∀T,U. T ➡* U → ⋆ ⊢ 𝐍⦃T⦄ → T = U.
104 /3 width=3 by tprs_cprs, cprs_inv_cnf1/ qed-.
106 (* Basic_1: removed theorems 10:
107 clear_pr3_trans pr3_cflat pr3_gen_bind
108 pr3_head_1 pr3_head_2 pr3_head_21 pr3_head_12
109 pr3_iso_appl_bind pr3_iso_appls_appl_bind pr3_iso_appls_bind