From 150f931929c8333dbcfff8dbe77fb2e177f44c56 Mon Sep 17 00:00:00 2001 From: Ferruccio Guidi Date: Thu, 7 Jun 2018 16:58:57 +0200 Subject: [PATCH] update in basic_2 + cprs completed --- .../basic_2/rt_computation/cprs_cpr.ma | 31 +++++++ .../basic_2/rt_computation/cprs_cprs.ma | 81 ++++++++----------- .../basic_2/rt_computation/cprs_lpr.ma | 24 +++++- .../basic_2/rt_computation/partial.txt | 2 +- .../lambdadelta/basic_2/web/basic_2_src.tbl | 2 +- 5 files changed, 88 insertions(+), 52 deletions(-) create mode 100644 matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_cpr.ma diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_cpr.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_cpr.ma new file mode 100644 index 000000000..91029fa98 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_cpr.ma @@ -0,0 +1,31 @@ +(**************************************************************************) +(* ___ *) +(* ||M|| *) +(* ||A|| A project by Andrea Asperti *) +(* ||T|| *) +(* ||I|| Developers: *) +(* ||T|| The HELM team. *) +(* ||A|| http://helm.cs.unibo.it *) +(* \ / *) +(* \ / This file is distributed under the terms of the *) +(* v GNU General Public License Version 2 *) +(* *) +(**************************************************************************) + +include "basic_2/rt_transition/cpr_cpr.ma". +include "basic_2/rt_computation/cprs_ctc.ma". + +(* CONTEXT-SENSITIVE PARALLEL R-COMPUTATION FOR TERMS ***********************) + +(* Advanced properties with context-sensitive r-transition for terms ********) + +(* Basic_1: was: pr3_strip *) +(* Basic_1: includes: pr1_strip *) +lemma cprs_strip (h) (G) (L): confluent2 … (cpms h G L 0) (cpm h G L 0). +#h #G #L #T0 #T1 #HT01 #T2 #HT02 +elim (TC_strip1 … T0 T1 … HT02) -HT02 +[ /3 width=3 by cprs_CTC, ex2_intro/ | skip +| /2 width=1 by cprs_inv_CTC/ +| /2 width=3 by cpr_conf/ +] +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_cprs.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_cprs.ma index fe6b36fcd..990051c3a 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_cprs.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_cprs.ma @@ -12,22 +12,29 @@ (* *) (**************************************************************************) -include "basic_2/rt_transition/lpr_lpr.ma". include "basic_2/rt_computation/cpms_cpms.ma". +include "basic_2/rt_computation/cprs_cpr.ma". -(* CONTEXT-SENSITIVE PARALLEL COMPUTATION FOR TERMS *************************) +(* CONTEXT-SENSITIVE PARALLEL R-COMPUTATION FOR TERMS ***********************) (* Main properties **********************************************************) (* Basic_1: was: pr3_t *) (* Basic_1: includes: pr1_t *) -theorem cprs_trans: ∀G,L. Transitive … (cprs G L). -normalize /2 width=3 by trans_TC/ qed-. +theorem cprs_trans (h) (G) (L): Transitive … (cpms h G L 0). +/2 width=3 by cpms_trans/ qed-. (* Basic_1: was: pr3_confluence *) (* Basic_1: includes: pr1_confluence *) -theorem cprs_conf: ∀G,L. confluent2 … (cprs G L) (cprs G L). -normalize /3 width=3 by cpr_conf, TC_confluent2/ qed-. +theorem cprs_conf (h) (G) (L): confluent2 … (cpms h G L 0) (cpms h G L 0). +#h #G #L #T0 #T1 #HT01 #T2 #HT02 +elim (TC_confluent2 … T0 T1 … T2) +[ /3 width=3 by cprs_CTC, ex2_intro/ |5,6: skip +| /2 width=1 by cprs_inv_CTC/ +| /2 width=1 by cprs_inv_CTC/ +| /2 width=3 by cpr_conf/ +] +qed-. (* Basic_1: was: pr3_flat *) theorem cprs_flat (h) (G) (L): @@ -43,48 +50,24 @@ qed. (* Advanced inversion lemmas ************************************************) (* Basic_1: was pr3_gen_appl *) -lemma cprs_inv_appl1: ∀G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓐV1.T1 ➡* U2 → - ∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡* V2 & ⦃G, L⦄ ⊢ T1 ➡* T2 & - U2 = ⓐV2. T2 - | ∃∃a,W,T. ⦃G, L⦄ ⊢ T1 ➡* ⓛ{a}W.T & - ⦃G, L⦄ ⊢ ⓓ{a}ⓝW.V1.T ➡* U2 - | ∃∃a,V0,V2,V,T. ⦃G, L⦄ ⊢ V1 ➡* V0 & ⬆[0,1] V0 ≘ V2 & - ⦃G, L⦄ ⊢ T1 ➡* ⓓ{a}V.T & - ⦃G, L⦄ ⊢ ⓓ{a}V.ⓐV2.T ➡* U2. -#G #L #V1 #T1 #U2 #H @(cprs_ind … H) -U2 /3 width=5 by or3_intro0, ex3_2_intro/ -#U #U2 #_ #HU2 * * -[ #V0 #T0 #HV10 #HT10 #H destruct - elim (cpr_inv_appl1 … HU2) -HU2 * - [ #V2 #T2 #HV02 #HT02 #H destruct /4 width=5 by cprs_strap1, or3_intro0, ex3_2_intro/ - | #a #V2 #W #W2 #T #T2 #HV02 #HW2 #HT2 #H1 #H2 destruct - lapply (cprs_strap1 … HV10 … HV02) -V0 #HV12 - lapply (lsubr_cpr_trans … HT2 (L.ⓓⓝW.V1) ?) -HT2 - /5 width=5 by cprs_bind, cprs_flat_dx, cpr_cprs, lsubr_beta, ex2_3_intro, or3_intro1/ - | #a #V #V2 #W0 #W2 #T #T2 #HV0 #HV2 #HW02 #HT2 #H1 #H2 destruct - /5 width=10 by cprs_flat_sn, cprs_bind_dx, cprs_strap1, ex4_5_intro, or3_intro2/ - ] -| /4 width=9 by cprs_strap1, or3_intro1, ex2_3_intro/ -| /4 width=11 by cprs_strap1, or3_intro2, ex4_5_intro/ +(* Basic_2A1: was: cprs_inv_appl1 *) +lemma cprs_inv_appl_sn (h) (G) (L): + ∀V1,T1,X2. ⦃G, L⦄ ⊢ ⓐV1.T1 ➡*[h] X2 → + ∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡*[h] V2 & + ⦃G, L⦄ ⊢ T1 ➡*[h] T2 & + X2 = ⓐV2. T2 + | ∃∃p,W,T. ⦃G, L⦄ ⊢ T1 ➡*[h] ⓛ{p}W.T & + ⦃G, L⦄ ⊢ ⓓ{p}ⓝW.V1.T ➡*[h] X2 + | ∃∃p,V0,V2,V,T. ⦃G, L⦄ ⊢ V1 ➡*[h] V0 & ⬆*[1] V0 ≘ V2 & + ⦃G, L⦄ ⊢ T1 ➡*[h] ⓓ{p}V.T & + ⦃G, L⦄ ⊢ ⓓ{p}V.ⓐV2.T ➡*[h] X2. +#h #G #L #V1 #T1 #X2 #H elim (cpms_inv_appl_sn … H) -H * +[ /3 width=5 by or3_intro0, ex3_2_intro/ +| #n1 #n2 #p #V2 #T2 #HT12 #HTX2 #H + elim (plus_inv_O3 … H) -H #H1 #H2 destruct + /3 width=5 by or3_intro1, ex2_3_intro/ +| #n1 #n2 #p #V2 #W2 #V #T2 #HV12 #HVW2 #HT12 #HTX2 #H + elim (plus_inv_O3 … H) -H #H1 #H2 destruct + /3 width=9 by or3_intro2, ex4_5_intro/ ] qed-. - -(* Basic_1: was: pr3_strip *) -(* Basic_1: includes: pr1_strip *) -lemma cprs_strip: ∀G,L. confluent2 … (cprs G L) (cpr G L). -normalize /4 width=3 by cpr_conf, TC_strip1/ qed-. - -lemma cprs_lpr_conf_dx: ∀G,L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ➡* T1 → ∀L1. ⦃G, L0⦄ ⊢ ➡ L1 → - ∃∃T. ⦃G, L1⦄ ⊢ T1 ➡* T & ⦃G, L1⦄ ⊢ T0 ➡* T. -#G #L0 #T0 #T1 #H @(cprs_ind … H) -T1 /2 width=3 by ex2_intro/ -#T #T1 #_ #HT1 #IHT0 #L1 #HL01 elim (IHT0 … HL01) -#T2 #HT2 #HT02 elim (lpr_cpr_conf_dx … HT1 … HL01) -L0 -#T3 #HT3 #HT13 elim (cprs_strip … HT2 … HT3) -T -/4 width=5 by cprs_strap2, cprs_strap1, ex2_intro/ -qed-. - -lemma cprs_lpr_conf_sn: ∀G,L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ➡* T1 → - ∀L1. ⦃G, L0⦄ ⊢ ➡ L1 → - ∃∃T. ⦃G, L0⦄ ⊢ T1 ➡* T & ⦃G, L1⦄ ⊢ T0 ➡* T. -#G #L0 #T0 #T1 #HT01 #L1 #HL01 elim (cprs_lpr_conf_dx … HT01 … HL01) -HT01 -/3 width=3 by lpr_cprs_trans, ex2_intro/ -qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_lpr.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_lpr.ma index b53cd702b..721330c1b 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_lpr.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_lpr.ma @@ -12,8 +12,9 @@ (* *) (**************************************************************************) +include "basic_2/rt_transition/lpr_lpr.ma". include "basic_2/rt_computation/cpms_lpr.ma". -include "basic_2/rt_computation/cprs_ctc.ma". +include "basic_2/rt_computation/cprs_cpr.ma". (* CONTEXT-SENSITIVE PARALLEL R-COMPUTATION FOR TERMS ***********************) @@ -29,3 +30,24 @@ qed-. lemma lpr_cprs_trans (h) (G): s_rs_transitive … (λL. cpm h G L 0) (λ_. lpr h G). #h #G @s_r_trans_CTC1 /2 width=3 by lpr_cpr_trans/ (**) (* full auto fails *) qed-. + +lemma cprs_lpr_conf_dx (h) (G): + ∀L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ➡*[h] T1 → ∀L1. ⦃G, L0⦄ ⊢ ➡[h] L1 → + ∃∃T. ⦃G, L1⦄ ⊢ T1 ➡*[h] T & ⦃G, L1⦄ ⊢ T0 ➡*[h] T. +#h #G #L0 #T0 #T1 #H +@(cprs_ind_dx … H) -T1 /2 width=3 by ex2_intro/ +#T #T1 #_ #HT1 #IHT0 #L1 #HL01 +elim (IHT0 … HL01) #T2 #HT2 #HT02 +elim (lpr_cpr_conf_dx … HT1 … HL01) -L0 #T3 #HT3 #HT13 +elim (cprs_strip … HT2 … HT3) -T +/3 width=5 by cprs_step_dx, cprs_step_sn, ex2_intro/ +qed-. + +lemma cprs_lpr_conf_sn (h) (G): + ∀L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ➡*[h] T1 → + ∀L1. ⦃G, L0⦄ ⊢ ➡[h] L1 → + ∃∃T. ⦃G, L0⦄ ⊢ T1 ➡*[h] T & ⦃G, L1⦄ ⊢ T0 ➡*[h] T. +#h #G #L0 #T0 #T1 #HT01 #L1 #HL01 +elim (cprs_lpr_conf_dx … HT01 … HL01) -HT01 #T #HT1 #HT0 +/3 width=3 by lpr_cpms_trans, ex2_intro/ +qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/partial.txt b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/partial.txt index 5a6398117..fb1ffd58a 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/rt_computation/partial.txt +++ b/matita/matita/contribs/lambdadelta/basic_2/rt_computation/partial.txt @@ -9,6 +9,6 @@ fpbs.ma fpbs_fqup.ma fpbs_fqus.ma fpbs_aaa.ma fpbs_cpx.ma fpbs_fpb.ma fpbs_cpxs. fpbg.ma fpbg_fqup.ma fpbg_cpxs.ma fpbg_lpxs.ma fpbg_fpbs.ma fpbg_fpbg.ma fsb.ma fsb_ffdeq.ma fsb_aaa.ma fsb_csx.ma fsb_fpbg.ma cpms.ma cpms_drops.ma cpms_lsubr.ma cpms_aaa.ma cpms_lpr.ma cpms_cpxs.ma cpms_cpms.ma -cprs.ma cprs_ctc.ma cprs_drops.ma cprs_lpr.ma +cprs.ma cprs_ctc.ma cprs_drops.ma cprs_cpr.ma cprs_lpr.ma cprs_cprs.ma cprs_ext.ma lprs.ma lprs_ctc.ma lprs_length.ma lprs_drops.ma lprs_aaa.ma lprs_lpr.ma lprs_lpxs.ma diff --git a/matita/matita/contribs/lambdadelta/basic_2/web/basic_2_src.tbl b/matita/matita/contribs/lambdadelta/basic_2/web/basic_2_src.tbl index 8fc0b30f2..71e720142 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/web/basic_2_src.tbl +++ b/matita/matita/contribs/lambdadelta/basic_2/web/basic_2_src.tbl @@ -75,7 +75,7 @@ table { [ { "context-sensitive parallel r-computation" * } { [ [ "for lenvs on all entries" ] "lprs ( ⦃?,?⦄ ⊢ ➡*[?] ? )" "lprs_ctc" + "lprs_length" + "lprs_drops" + "lprs_aaa" + "lprs_lpr" + "lprs_lpxs" (* + "lprs_cprs" + "lprs_lprs" *) * ] [ [ "for binders" ] "cprs_ext" + "( ⦃?,?⦄ ⊢ ? ➡*[?] ?)" * ] - [ [ "for terms" ] "cprs" + "( ⦃?,?⦄ ⊢ ? ➡*[?] ?)" "cprs_ctc" + "cprs_drops" + "cprs_lpr" (* + "cprs_cprs" *) * ] + [ [ "for terms" ] "cprs" + "( ⦃?,?⦄ ⊢ ? ➡*[?] ?)" "cprs_ctc" + "cprs_drops" + "cprs_cpr" + "cprs_lpr" + "cprs_cprs" * ] } ] [ { "t-bound context-sensitive parallel rt-computation" * } { -- 2.39.2