]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/reduction/cpx.ma
some work on extended reduction ...
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / reduction / cpx.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "basic_2/static/ssta.ma".
16 include "basic_2/reduction/cpr.ma".
17
18 (* CONTEXT-SENSITIVE EXTENDED PARALLEL REDUCTION FOR TERMS ******************)
19
20 inductive cpx (h) (g): lenv → relation term ≝
21 | cpx_cpr : ∀I,L,U2. L ⊢ ⓪{I} ➡ U2 → cpx h g L (⓪{I}) U2
22 | cpx_ssta: ∀I,L,U2,l. ⦃h, L⦄ ⊢ ⓪{I} •[g] ⦃l+1, U2⦄ → cpx h g L (⓪{I}) U2
23 | cpx_bind: ∀a,I,L,V1,V2,T1,T2,U2. cpx h g L V1 V2 → cpx h g (L.ⓑ{I}V1) T1 T2 →
24             L ⊢ ⓑ{a,I}V2.T2 ➡ U2 → cpx h g L (ⓑ{a,I}V1.T1) U2
25 | cpx_flat: ∀I,L,V1,V2,T1,T2,U2. cpx h g L V1 V2 → cpx h g L T1 T2 →
26             L ⊢ ⓕ{I}V2.T2 ➡ U2 → cpx h g L (ⓕ{I}V1.T1) U2
27 .
28
29 interpretation
30    "context-sensitive extended parallel reduction (term)"
31    'PRed h g L T1 T2 = (cpx h g L T1 T2).
32
33 (* Basic properties *********************************************************)
34
35 (* Note: this is "∀h,g,L. reflexive … (cpx h g L)" *)
36 lemma cpx_refl: ∀h,g,T,L. ⦃h, L⦄ ⊢ T ➡[g] T.
37 #h #g #T elim T -T /2 width=1/ * /2 width=5/
38 qed.
39
40 lemma cpr_cpx: ∀h,g,T1,L,T2. L ⊢ T1 ➡ T2 → ⦃h, L⦄ ⊢ T1 ➡[g] T2.
41 #h #g #T1 elim T1 -T1 /2 width=1/ * /2 width=5/
42 qed.
43
44 lemma ssta_cpx: ∀h,g,T1,L,T2,l. ⦃h, L⦄ ⊢ T1 •[g] ⦃l+1, T2⦄ → ⦃h, L⦄ ⊢ T1 ➡[g] T2.
45 #h #g #T1 elim T1 -T1 /2 width=2/ * [|*]
46 [ #a #I #V1 #T1 #_ #IHT1 #L #X #l #H
47   elim (ssta_inv_bind1 … H) -H #T2 #HT12 #H destruct /3 width=5/
48 | #V1 #T1 #_ #IHT1 #L #X #l #H
49   elim (ssta_inv_appl1 … H) -H #T2 #HT12 #H destruct /3 width=5/
50 | #V1 #T1 #_ #IHT1 #L #X #l #H
51   lapply (ssta_inv_cast1 … H) -H /3 width=5/
52 ]
53 qed.