From cf2a049a6cc888f6c5d0637ab0523f186058fc8f Mon Sep 17 00:00:00 2001 From: Ferruccio Guidi Date: Tue, 27 Dec 2022 17:08:00 +0100 Subject: [PATCH] update in delayed_updating + more complex example in which discarding num labels in b solves unwind --- .../reduction/dbfr_unprotected_neg.ma | 145 ++++++++++++++++++ .../reduction/dbfr_unprotected_zero.ma | 125 --------------- 2 files changed, 145 insertions(+), 125 deletions(-) create mode 100644 matita/matita/contribs/lambdadelta/delayed_updating/reduction/dbfr_unprotected_neg.ma delete mode 100644 matita/matita/contribs/lambdadelta/delayed_updating/reduction/dbfr_unprotected_zero.ma diff --git a/matita/matita/contribs/lambdadelta/delayed_updating/reduction/dbfr_unprotected_neg.ma b/matita/matita/contribs/lambdadelta/delayed_updating/reduction/dbfr_unprotected_neg.ma new file mode 100644 index 000000000..a83a71d5f --- /dev/null +++ b/matita/matita/contribs/lambdadelta/delayed_updating/reduction/dbfr_unprotected_neg.ma @@ -0,0 +1,145 @@ +(**************************************************************************) +(* ___ *) +(* ||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 "delayed_updating/reduction/dbfr_constructors.ma". +include "delayed_updating/reduction/ibfr_constructors.ma". +include "delayed_updating/unwind/unwind2_prototerm_constructors.ma". +include "delayed_updating/substitution/lift_prototerm_constructors.ma". +include "ground/arith/pnat_two.ma". + +(* DELAYED BALANCED FOCUSED REDUCTION ***************************************) + +(* Example of unprotected balanced β-reduction ******************************) + +definition un_t: prototerm ≝ + @(𝛌.⧣𝟏).𝛌.𝛌.@(⧣𝟐).𝛌.@(⧣𝟐).⧣𝟏. + +definition un_i1: prototerm ≝ + @(𝛌.⧣𝟏).𝛌.𝛌.@(𝛌.⧣𝟏).𝛌.@(⧣𝟐).⧣𝟏. + +lemma un_ti1: + un_t ➡𝐢𝐛𝐟[𝗔◗𝗟◗𝗟◗𝗦◗𝐞] un_i1. +@(ibfr_eq_trans … (ibfr_beta_0 …)) +[ >list_append_lcons_sn + /3 width=1 by in_comp_appl_sd, in_comp_abst_hd/ +| /3 width=3 by pcc_S_sn, pcc_L_sn/ +| skip +] +@appl_eq_repl [ // ] @abst_eq_repl +@(subset_eq_canc_sn … (fsubst_abst_hd …)) @abst_eq_repl +@(subset_eq_canc_sn … (fsubst_appl_sd …)) @appl_eq_repl [| // ] +@(subset_eq_canc_sn … (fsubst_empty_rc …)) +@(subset_eq_canc_sn … (lift_term_abst …)) @abst_eq_repl +@(subset_eq_canc_sn … (lift_term_oref_pap … )) // +qed. + +definition un_i2: prototerm ≝ + @(𝛌.⧣𝟏).𝛌.𝛌.@(𝛌.⧣𝟏).𝛌.@(⧣𝟐).𝛌.⧣𝟏. + +lemma un_i12: + un_i1 ➡𝐢𝐛𝐟[𝗔◗𝗟◗𝗟◗𝗔◗𝗟◗𝗔◗𝐞] un_i2. +@ibfr_appl_hd +@ibfr_abst_hd +@ibfr_abst_hd +@(ibfr_eq_trans … (ibfr_beta_0 …)) +[ >list_append_lcons_sn + /2 width=1 by in_comp_appl_hd/ +| /2 width=1 by pcc_A_sn, pcc_empty/ +| skip +] +@appl_eq_repl [ // ] @abst_eq_repl +@(subset_eq_canc_sn … (fsubst_appl_hd …)) @appl_eq_repl [ // ] +@(subset_eq_canc_sn … (fsubst_empty_rc …)) +@(subset_eq_canc_sn … (lift_term_abst …)) @abst_eq_repl +@(subset_eq_canc_sn … (lift_term_oref_pap … )) // +qed. + +definition un_i3: prototerm ≝ + @(𝛌.⧣𝟏).𝛌.𝛌.@(𝛌.⧣𝟏).𝛌.@(⧣𝟐).𝛌.⧣↑𝟐. + +lemma un_i23: + un_i2 ➡𝐢𝐛𝐟[𝗔◗𝗟◗𝗟◗𝗔◗𝗟◗𝗔◗𝗟◗𝐞] un_i3. +@ibfr_appl_hd +@ibfr_abst_hd +@ibfr_abst_hd +@ibfr_appl_hd +@ibfr_abst_hd +@(ibfr_eq_trans … (ibfr_beta_0 …)) +[ // | // | skip ] +@appl_eq_repl [ // ] @abst_eq_repl +@(subset_eq_canc_sn … (fsubst_empty_rc …)) +@(subset_eq_canc_sn … (lift_term_oref_pap … )) // +qed. + +definition un_d1: prototerm ≝ + @(𝛌.⧣𝟏).𝛌.𝛌.@(𝛕𝟐.𝛌.⧣𝟏).𝛌.@(⧣𝟐).⧣𝟏. + +lemma un_td1: + un_t ➡𝐝𝐛𝐟[𝗔◗𝗟◗𝗟◗𝗦◗𝐞] un_d1. +@(dbfr_eq_trans … (dbfr_beta_0 …)) +[ >list_append_lcons_sn + /3 width=1 by in_comp_appl_sd, in_comp_abst_hd/ +| /3 width=3 by pcc_S_sn, pcc_L_sn/ +| skip +] +@appl_eq_repl [ // ] @abst_eq_repl +@(subset_eq_canc_sn … (fsubst_abst_hd …)) @abst_eq_repl +@(subset_eq_canc_sn … (fsubst_appl_sd …)) @appl_eq_repl [| // ] +@(subset_eq_canc_sn … (fsubst_empty_rc …)) +@iref_eq_repl // +qed. + +definition un_d2: prototerm ≝ + @(𝛌.⧣𝟏).𝛌.𝛌.@(𝛕𝟐.𝛌.⧣𝟏).𝛌.@(⧣𝟐).𝛕𝟏.𝛕𝟐.𝛌.⧣𝟏. + +lemma un_d12: + un_d1 ➡𝐝𝐛𝐟[𝗔◗𝗟◗𝗟◗𝗔◗𝗟◗𝗔◗𝐞] un_d2. +@dbfr_appl_hd +@dbfr_abst_hd +@dbfr_abst_hd +@(dbfr_eq_trans … (dbfr_beta_0 …)) +[ >list_append_lcons_sn /2 width=1 by in_comp_appl_hd/ +| /2 width=1 by pcc_A_sn/ +| skip +] +@appl_eq_repl [ // ] @abst_eq_repl +@(subset_eq_canc_sn … (fsubst_appl_hd …)) @appl_eq_repl [ // ] +@(subset_eq_canc_sn … (fsubst_empty_rc …)) +@iref_eq_repl @iref_eq_repl // +qed. + +definition un_d3: prototerm ≝ + @(𝛌.⧣𝟏).𝛌.𝛌.@(𝛕𝟐.𝛌.⧣𝟏).𝛌.@(⧣𝟐).𝛌.𝛕𝟏.⧣𝟐. + +lemma un_di3: + un_i3 ⇔ ▼[𝐢] un_d3. +@(subset_eq_canc_sn … (unwind2_term_appl …)) @appl_eq_repl +[ @(subset_eq_canc_sn … (unwind2_term_abst …)) @abst_eq_repl + @(subset_eq_canc_sn … (unwind2_term_oref_pap …)) // +] +@(subset_eq_canc_sn … (unwind2_term_abst …)) @abst_eq_repl +@(subset_eq_canc_sn … (unwind2_term_abst …)) @abst_eq_repl +@(subset_eq_canc_sn … (unwind2_term_appl …)) @appl_eq_repl +[ @(subset_eq_canc_sn … (unwind2_term_iref …)) + @(subset_eq_canc_sn … (unwind2_term_abst …)) @abst_eq_repl + @(subset_eq_canc_sn … (unwind2_term_oref_pap …)) // +] +@(subset_eq_canc_sn … (unwind2_term_abst …)) @abst_eq_repl +@(subset_eq_canc_sn … (unwind2_term_appl …)) @appl_eq_repl +[ @(subset_eq_canc_sn … (unwind2_term_oref_pap …)) // +] +@(subset_eq_canc_sn … (unwind2_term_abst …)) @abst_eq_repl +@(subset_eq_canc_sn … (unwind2_term_iref …)) +@(subset_eq_canc_sn … (unwind2_term_oref_pap …)) // +qed. diff --git a/matita/matita/contribs/lambdadelta/delayed_updating/reduction/dbfr_unprotected_zero.ma b/matita/matita/contribs/lambdadelta/delayed_updating/reduction/dbfr_unprotected_zero.ma deleted file mode 100644 index 5b3631f9c..000000000 --- a/matita/matita/contribs/lambdadelta/delayed_updating/reduction/dbfr_unprotected_zero.ma +++ /dev/null @@ -1,125 +0,0 @@ -(**************************************************************************) -(* ___ *) -(* ||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 "delayed_updating/reduction/dbfr_constructors.ma". -include "delayed_updating/reduction/ibfr_constructors.ma". -include "delayed_updating/unwind/unwind2_prototerm_constructors.ma". -include "delayed_updating/substitution/lift_prototerm_constructors.ma". -include "ground/arith/pnat_two.ma". - -(* DELAYED BALANCED FOCUSED REDUCTION ***************************************) - -(* Example of unprotected balanced β-reduction ******************************) - -definition l3_t: prototerm ≝ - (𝛌.@(𝛌.⧣𝟏).𝛌.@(⧣𝟐).⧣𝟏). - -definition l3_i1: prototerm ≝ - (𝛌.@(𝛌.⧣𝟏).𝛌.@(⧣𝟐).𝛌.⧣𝟏). - -definition l3_i2: prototerm ≝ - (𝛌.@(𝛌.⧣𝟏).𝛌.@(⧣𝟐).𝛌.⧣↑𝟐). - -definition l3_i2': prototerm ≝ - (𝛌.@(𝛌.⧣𝟏).𝛌.@(⧣𝟐).𝛌.⧣↑↑𝟐). - -definition l3_d1: prototerm ≝ - (𝛌.@(𝛌.⧣𝟏).𝛌.@(⧣𝟐).𝛕𝟏.(𝛌.⧣𝟏)). - -definition l3_d2: prototerm ≝ - (𝛌.@(𝛌.⧣𝟏).𝛌.@(⧣𝟐).𝛕𝟏.𝛌.(⧣𝟐)). - -definition l3_d2': prototerm ≝ - (𝛌.@(𝛌.⧣𝟏).𝛌.@(⧣𝟐).𝛕𝟏.𝛌.𝛕𝟏.(⧣𝟐)). - -lemma l3_ti1: - l3_t ➡𝐢𝐛𝐟[𝗟◗𝗔◗𝗟◗𝗔◗𝐞] l3_i1. -@ibfr_abst_hd -@ibfr_eq_trans -[ | @(ibfr_beta_0 … (𝟎)) - [ /2 width=1 by pcc_A_sn, pcc_empty/ - | >list_append_lcons_sn /2 width=1 by in_comp_appl_hd/ - ] -] -@appl_eq_repl [ // ] -@abst_eq_repl -@(subset_eq_canc_sn … (fsubst_appl_hd …)) -@appl_eq_repl [ // ] -@(subset_eq_canc_sn … (fsubst_empty_rc …)) -@(subset_eq_canc_sn … (lift_term_abst …)) -@abst_eq_repl -@(subset_eq_canc_sn … (lift_term_oref_pap … )) // -qed. - -lemma l3_i12: - l3_i1 ➡𝐢𝐛𝐟[𝗟◗𝗔◗𝗟◗𝗔◗𝗟◗𝐞] l3_i2. -@ibfr_abst_hd -@ibfr_appl_hd -@ibfr_abst_hd -@ibfr_eq_trans [| @ibfr_beta_0 // ] -@appl_eq_repl [ // ] -@abst_eq_repl -@(subset_eq_canc_sn … (fsubst_empty_rc …)) -@(subset_eq_canc_sn … (lift_term_oref_pap … )) // -qed. - -lemma l3_td1: - l3_t ➡𝐝𝐛𝐟[𝗟◗𝗔◗𝗟◗𝗔◗𝐞] l3_d1. -@dbfr_abst_hd -@dbfr_eq_trans -[ | @(dbfr_beta_0 … (𝟎)) - [ /2 width=1 by pcc_A_sn, pcc_empty/ - | >list_append_lcons_sn /2 width=1 by in_comp_appl_hd/ - ] -] -@appl_eq_repl [ // ] -@abst_eq_repl -@(subset_eq_canc_sn … (fsubst_appl_hd …)) -@appl_eq_repl [ // ] -@(subset_eq_canc_sn … (fsubst_empty_rc …)) -@iref_eq_repl // -qed. - -lemma l3_di2: - l3_i2 ⇔ ▼[𝐢]l3_d2. -@(subset_eq_canc_sn … (unwind2_term_abst …)) @abst_eq_repl -@(subset_eq_canc_sn … (unwind2_term_appl …)) @appl_eq_repl -[ @(subset_eq_canc_sn … (unwind2_term_abst …)) @abst_eq_repl - @(subset_eq_canc_sn … (unwind2_term_oref_pap …)) // -] -@(subset_eq_canc_sn … (unwind2_term_abst …)) @abst_eq_repl -@(subset_eq_canc_sn … (unwind2_term_appl …)) @appl_eq_repl -[ @(subset_eq_canc_sn … (unwind2_term_oref_pap …)) // -] -@(subset_eq_canc_sn … (unwind2_term_iref …)) -@(subset_eq_canc_sn … (unwind2_term_abst …)) @abst_eq_repl -@(subset_eq_canc_sn … (unwind2_term_oref_pap …)) // -qed. - -lemma l3_di2': - l3_i2' ⇔ ▼[𝐢]l3_d2'. -@(subset_eq_canc_sn … (unwind2_term_abst …)) @abst_eq_repl -@(subset_eq_canc_sn … (unwind2_term_appl …)) @appl_eq_repl -[ @(subset_eq_canc_sn … (unwind2_term_abst …)) @abst_eq_repl - @(subset_eq_canc_sn … (unwind2_term_oref_pap …)) // -] -@(subset_eq_canc_sn … (unwind2_term_abst …)) @abst_eq_repl -@(subset_eq_canc_sn … (unwind2_term_appl …)) @appl_eq_repl -[ @(subset_eq_canc_sn … (unwind2_term_oref_pap …)) // -] -@(subset_eq_canc_sn … (unwind2_term_iref …)) -@(subset_eq_canc_sn … (unwind2_term_abst …)) @abst_eq_repl -@(subset_eq_canc_sn … (unwind2_term_iref …)) -@(subset_eq_canc_sn … (unwind2_term_oref_pap …)) // -qed. -- 2.39.2