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.ma".
17 (* CONTEXT-SENSITIVE PARALLEL COMPUTATION ON TERMS **************************)
19 (* Basic_1: includes: pr3_pr2 *)
20 definition cprs: lenv → relation term ≝
23 interpretation "context-sensitive parallel computation (term)"
24 'PRedStar L T1 T2 = (cprs L T1 T2).
26 (* Basic eliminators ********************************************************)
28 lemma cprs_ind: ∀L,T1. ∀R:predicate term. R T1 →
29 (∀T,T2. L ⊢ T1 ➡* T → L ⊢ T ➡ T2 → R T → R T2) →
30 ∀T2. L ⊢ T1 ➡* T2 → R T2.
31 #L #T1 #R #HT1 #IHT1 #T2 #HT12 @(TC_star_ind … HT1 IHT1 … HT12) //
34 axiom cprs_ind_dx: ∀L,T2. ∀R:predicate term. R T2 →
35 (∀T1,T. L ⊢ T1 ➡ T → L ⊢ T ➡* T2 → R T → R T1) →
36 ∀T1. L ⊢ T1 ➡* T2 → R T1.
38 (* Basic properties *********************************************************)
40 (* Basic_1: was: pr3_refl *)
41 lemma cprs_refl: ∀L,T. L ⊢ T ➡* T.
44 lemma cprs_strap1: ∀L,T1,T,T2.
45 L ⊢ T1 ➡* T → L ⊢ T ➡ T2 → L ⊢ T1 ➡* T2.
48 (* Basic_1: was: pr3_step *)
49 lemma cprs_strap2: ∀L,T1,T,T2.
50 L ⊢ T1 ➡ T → L ⊢ T ➡* T2 → L ⊢ T1 ➡* T2.
53 (* Note: it does not hold replacing |L1| with |L2| *)
54 lemma cprs_lsubs_conf: ∀L1,T1,T2. L1 ⊢ T1 ➡* T2 →
55 ∀L2. L1 [0, |L1|] ≼ L2 → L2 ⊢ T1 ➡* T2.
59 lemma cprs_flat_dx: ∀I,L,V1,V2. L ⊢ V1 ➡ V2 → ∀T1,T2. L ⊢ T1 ➡* T2 →
60 L ⊢ ⓕ{I} V1. T1 ➡* ⓕ{I} V2. T2.
61 #I #L #V1 #V2 #HV12 #T1 #T2 #HT12 @(cprs_ind … HT12) -T2 /3 width=1/
63 @(cprs_strap1 … IHT2) -IHT2 /2 width=1/
66 (* Basic inversion lemmas ***************************************************)
68 (* Basic_1: was: pr3_gen_sort *)
69 lemma cprs_inv_sort1: ∀L,U2,k. L ⊢ ⋆k ➡* U2 → U2 = ⋆k.
70 #L #U2 #k #H @(cprs_ind … H) -U2 //
71 #U2 #U #_ #HU2 #IHU2 destruct
72 >(cpr_inv_sort1 … HU2) -HU2 //
75 (* Basic_1: was: pr3_gen_cast *)
76 lemma cprs_inv_cast1: ∀L,W1,T1,U2. L ⊢ ⓣW1.T1 ➡* U2 → L ⊢ T1 ➡* U2 ∨
77 ∃∃W2,T2. L ⊢ W1 ➡* W2 & L ⊢ T1 ➡* T2 & U2 = ⓣW2.T2.
78 #L #W1 #T1 #U2 #H @(cprs_ind … H) -U2 /3 width=5/
79 #U2 #U #_ #HU2 * /3 width=3/ *
80 #W #T #HW1 #HT1 #H destruct
81 elim (cpr_inv_cast1 … HU2) -HU2 /3 width=3/ *
82 #W2 #T2 #HW2 #HT2 #H destruct /4 width=5/
85 (* Basic_1: removed theorems 2: clear_pr3_trans pr3_cflat *)