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/static/ssta.ma".
16 include "basic_2/reduction/cpr.ma".
18 (* CONTEXT-SENSITIVE EXTENDED PARALLEL REDUCTION FOR TERMS ******************)
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
30 "context-sensitive extended parallel reduction (term)"
31 'PRed h g L T1 T2 = (cpx h g L T1 T2).
33 (* Basic properties *********************************************************)
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/
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/
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/