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/notation/relations/predstar_7.ma".
16 include "basic_2/rt_computation/fpbg.ma".
17 include "basic_2/rt_computation/cpms_fpbs.ma".
18 include "basic_2/dynamic/cnv.ma".
20 (* CONTEXT-SENSITIVE NATIVE VALIDITY FOR TERMS ******************************)
22 (* Inductive premises for the preservation results **************************)
24 definition cpsms (n) (h) (o): relation4 genv lenv term term ≝ λG,L,T1,T2.
25 ∃∃n1,n2,T. T1 ≛[h,o] T → ⊥ & ⦃G, L⦄ ⊢ T1 ➡[n1,h] T & ⦃G, L⦄ ⊢ T ➡*[n2,h] T2 & n1+n2 = n.
28 "context-sensitive parallel stratified t-bound rt-computarion (term)"
29 'PRedStar n h o G L T1 T2 = (cpsms n h o G L T1 T2).
31 definition IH_cnv_cpm_trans_lpr (a) (h): relation3 genv lenv term ≝
32 λG,L1,T1. ⦃G, L1⦄ ⊢ T1 ![a,h] →
33 ∀n,T2. ⦃G, L1⦄ ⊢ T1 ➡[n,h] T2 →
34 ∀L2. ⦃G, L1⦄ ⊢ ➡[h] L2 → ⦃G, L2⦄ ⊢ T2 ![a,h].
36 definition IH_cnv_cpms_trans_lpr (a) (h): relation3 genv lenv term ≝
37 λG,L1,T1. ⦃G, L1⦄ ⊢ T1 ![a,h] →
38 ∀n,T2. ⦃G, L1⦄ ⊢ T1 ➡*[n,h] T2 →
39 ∀L2. ⦃G, L1⦄ ⊢ ➡[h] L2 → ⦃G, L2⦄ ⊢ T2 ![a,h].
41 definition IH_cnv_cpm_conf_lpr (a) (h): relation3 genv lenv term ≝
42 λG,L0,T0. ⦃G, L0⦄ ⊢ T0 ![a,h] →
43 ∀n1,T1. ⦃G, L0⦄ ⊢ T0 ➡[n1,h] T1 → ∀n2,T2. ⦃G, L0⦄ ⊢ T0 ➡[n2,h] T2 →
44 ∀L1. ⦃G, L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[h] L2 →
45 ∃∃T. ⦃G, L1⦄ ⊢ T1 ➡*[n2-n1,h] T & ⦃G, L2⦄ ⊢ T2 ➡*[n1-n2,h] T.
47 definition IH_cnv_cpms_strip_lpr (a) (h): relation3 genv lenv term ≝
48 λG,L0,T0. ⦃G, L0⦄ ⊢ T0 ![a,h] →
49 ∀n1,T1. ⦃G, L0⦄ ⊢ T0 ➡*[n1,h] T1 → ∀n2,T2. ⦃G, L0⦄ ⊢ T0 ➡[n2,h] T2 →
50 ∀L1. ⦃G, L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[h] L2 →
51 ∃∃T. ⦃G, L1⦄ ⊢ T1 ➡*[n2-n1,h] T & ⦃G, L2⦄ ⊢ T2 ➡*[n1-n2,h] T.
53 definition IH_cnv_cpms_conf_lpr (a) (h): relation3 genv lenv term ≝
54 λG,L0,T0. ⦃G, L0⦄ ⊢ T0 ![a,h] →
55 ∀n1,T1. ⦃G, L0⦄ ⊢ T0 ➡*[n1,h] T1 → ∀n2,T2. ⦃G, L0⦄ ⊢ T0 ➡*[n2,h] T2 →
56 ∀L1. ⦃G, L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[h] L2 →
57 ∃∃T. ⦃G, L1⦄ ⊢ T1 ➡*[n2-n1,h] T & ⦃G, L2⦄ ⊢ T2 ➡*[n1-n2,h] T.
59 definition IH_cnv_cpsms_conf_lpr (a) (h) (o): relation3 genv lenv term ≝
60 λG,L0,T0. ⦃G, L0⦄ ⊢ T0 ![a,h] →
61 ∀n1,T1. ⦃G, L0⦄ ⊢ T0 ➡*[n1,h,o] T1 → ∀n2,T2. ⦃G, L0⦄ ⊢ T0 ➡*[n2,h,o] T2 →
62 ∀L1. ⦃G, L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[h] L2 →
63 ∃∃T. ⦃G, L1⦄ ⊢ T1 ➡*[n2-n1,h] T & ⦃G, L2⦄ ⊢ T2 ➡*[n1-n2,h] T.
65 (* Properties for preservation **********************************************)
67 lemma cnv_cpms_trans_lpr_far (a) (h) (o):
69 (∀G1,L1,T1. ⦃G0, L0, T0⦄ >[h, o] ⦃G1, L1, T1⦄ → IH_cnv_cpm_trans_lpr a h G1 L1 T1) →
70 ∀G1,L1,T1. ⦃G0, L0, T0⦄ >[h, o] ⦃G1, L1, T1⦄ → IH_cnv_cpms_trans_lpr a h G1 L1 T1.
71 #a #h #o #G0 #L0 #T0 #IH #G1 #L1 #T1 #H01 #HT1 #n #T2 #H
72 @(cpms_ind_dx … H) -n -T2
73 /4 width=7 by cpms_fwd_fpbs, fpbg_fpbs_trans/
76 lemma cnv_cpm_conf_lpr_far (a) (h) (o):
78 (∀G1,L1,T1. ⦃G0, L0, T0⦄ >[h, o] ⦃G1, L1, T1⦄ → IH_cnv_cpms_conf_lpr a h G1 L1 T1) →
79 ∀G1,L1,T1. ⦃G0, L0, T0⦄ >[h, o] ⦃G1, L1, T1⦄ → IH_cnv_cpm_conf_lpr a h G1 L1 T1.
80 /3 width=8 by cpm_cpms/ qed-.
82 lemma cnv_cpms_strip_lpr_far (a) (h) (o):
84 (∀G1,L1,T1. ⦃G0, L0, T0⦄ >[h, o] ⦃G1, L1, T1⦄ → IH_cnv_cpms_conf_lpr a h G1 L1 T1) →
85 ∀G1,L1,T1. ⦃G0, L0, T0⦄ >[h, o] ⦃G1, L1, T1⦄ → IH_cnv_cpms_strip_lpr a h G1 L1 T1.
86 /3 width=8 by cpm_cpms/ qed-.