]> matita.cs.unibo.it Git - helm.git/commitdiff
update in delayed_updating
authorFerruccio Guidi <ferruccio.guidi@unibo.it>
Mon, 9 May 2022 19:08:36 +0000 (21:08 +0200)
committerFerruccio Guidi <ferruccio.guidi@unibo.it>
Mon, 9 May 2022 19:08:36 +0000 (21:08 +0200)
+ main function to locate the referred binder
+ update function for unfold

matita/matita/contribs/lambdadelta/delayed_updating/notation/functions/downarrowright_2.ma [new file with mode: 0644]
matita/matita/contribs/lambdadelta/delayed_updating/notation/functions/power_2.ma [new file with mode: 0644]
matita/matita/contribs/lambdadelta/delayed_updating/syntax/path_closed.ma [deleted file]
matita/matita/contribs/lambdadelta/delayed_updating/syntax/path_labels.ma [new file with mode: 0644]
matita/matita/contribs/lambdadelta/delayed_updating/syntax/path_reverse.ma [new file with mode: 0644]
matita/matita/contribs/lambdadelta/delayed_updating/syntax/path_tail.ma [new file with mode: 0644]
matita/matita/contribs/lambdadelta/delayed_updating/syntax/path_tail_depth.ma [new file with mode: 0644]
matita/matita/contribs/lambdadelta/delayed_updating/unwind/unwind1_rmap.ma [new file with mode: 0644]
matita/matita/contribs/lambdadelta/delayed_updating/unwind/unwind1_rmap_tail.ma [new file with mode: 0644]
matita/matita/contribs/lambdadelta/ground/notation/functions/applysucc_2.ma [new file with mode: 0644]
matita/matita/predefined_virtuals.ml

diff --git a/matita/matita/contribs/lambdadelta/delayed_updating/notation/functions/downarrowright_2.ma b/matita/matita/contribs/lambdadelta/delayed_updating/notation/functions/downarrowright_2.ma
new file mode 100644 (file)
index 0000000..7531c6b
--- /dev/null
@@ -0,0 +1,19 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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                  *)
+(*                                                                        *)
+(**************************************************************************)
+
+(* NOTATION FOR DELAYED UPDATING ********************************************)
+
+notation "hvbox( ↳[ term 46 n ] break term 70 p )"
+  non associative with precedence 70
+  for @{ 'DownArrowRight $n $p }.
diff --git a/matita/matita/contribs/lambdadelta/delayed_updating/notation/functions/power_2.ma b/matita/matita/contribs/lambdadelta/delayed_updating/notation/functions/power_2.ma
new file mode 100644 (file)
index 0000000..bed0c7f
--- /dev/null
@@ -0,0 +1,19 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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                  *)
+(*                                                                        *)
+(**************************************************************************)
+
+(* NOTATION FOR DELAYED UPDATING ********************************************)
+
+notation "hvbox( a ∗∗ break b )"
+  left associative with precedence 65
+  for @{ 'Power $a $b }.
diff --git a/matita/matita/contribs/lambdadelta/delayed_updating/syntax/path_closed.ma b/matita/matita/contribs/lambdadelta/delayed_updating/syntax/path_closed.ma
deleted file mode 100644 (file)
index d8b00ca..0000000
+++ /dev/null
@@ -1,48 +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/syntax/path.ma".
-include "delayed_updating/notation/functions/class_c_1.ma".
-include "ground/lib/subset.ma".
-
-include "delayed_updating/syntax/path_depth.ma".
-include "delayed_updating/syntax/path_height.ma".
-
-(* CLOSED CONDITION FOR PATH ************************************************)
-
-axiom pcc: relation2 nat path.
-
-interpretation
-  "closed condition (path)"
-  'ClassC n = (pcc n).
-
-(* Basic destructions *******************************************************)
-
-axiom pcc_empty:
-      (𝐞) ϵ 𝐂❨𝟎❩.
-
-axiom pcc_d (p) (d) (n:pnat):
-      p ϵ 𝐂❨d+n❩ → p◖𝗱n ϵ 𝐂❨d❩.
-
-axiom pcc_L (p) (d):
-      p ϵ 𝐂❨d❩ → p◖𝗟 ϵ 𝐂❨↑d❩.
-
-axiom pcc_A (p) (d):
-      p ϵ 𝐂❨d❩ → p◖𝗔 ϵ 𝐂❨d❩.
-
-axiom pcc_S (p) (d):
-      p ϵ 𝐂❨d❩ → p◖𝗦 ϵ 𝐂❨d❩.
-
-axiom pcc_des_gen (p) (d):
-      p ϵ 𝐂❨d❩ → d + ♯p = ❘p❘.
diff --git a/matita/matita/contribs/lambdadelta/delayed_updating/syntax/path_labels.ma b/matita/matita/contribs/lambdadelta/delayed_updating/syntax/path_labels.ma
new file mode 100644 (file)
index 0000000..a01c225
--- /dev/null
@@ -0,0 +1,42 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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/syntax/path.ma".
+include "delayed_updating/notation/functions/power_2.ma".
+include "ground/arith/nat_succ_iter.ma".
+
+(* *)
+
+definition labels (l) (n:nat): path ≝
+           ((list_lcons ? l)^n) (𝐞).
+
+interpretation
+  "labels (path)"
+  'Power l n = (labels l n).
+
+(* Basic constructions ******************************************************)
+
+lemma labels_unfold (l) (n):
+      ((list_lcons ? l)^n) (𝐞) = l∗∗n.
+// qed.
+
+lemma labels_zero (l):
+      (𝐞) = l∗∗𝟎.
+// qed.
+
+lemma labels_succ (l) (n):
+      l◗(l∗∗n) = l∗∗(↑n).
+#l #n
+<labels_unfold <labels_unfold <niter_succ //
+qed.
diff --git a/matita/matita/contribs/lambdadelta/delayed_updating/syntax/path_reverse.ma b/matita/matita/contribs/lambdadelta/delayed_updating/syntax/path_reverse.ma
new file mode 100644 (file)
index 0000000..43d9d85
--- /dev/null
@@ -0,0 +1,53 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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/syntax/path.ma".
+include "delayed_updating/notation/functions/nec_r_1.ma".
+
+(* REVERSE FOR PATH *********************************************************)
+
+rec definition reverse (p) on p: path ≝
+match p with
+[ list_empty     ⇒ 𝐞
+| list_lcons l q ⇒ (reverse q)◖l
+].
+
+interpretation
+  "reverse (path)"
+  'NEcR p = (reverse p).
+
+(* Basic constructions ******************************************************)
+
+lemma reverse_empty: 𝐞 = 𝐞ᴿ.
+// qed.
+
+lemma reverse_lcons (p) (l): pᴿ◖l = (l◗p)ᴿ.
+// qed.
+
+(* Main constructions *******************************************************)
+
+theorem reverse_append (p1) (p2):
+        (p2ᴿ)●(p1ᴿ) = (p1●p2)ᴿ.
+#p1 elim p1 -p1 //
+#l1 #p1 #IH #p2
+<list_append_lcons_sn <reverse_lcons <reverse_lcons //
+qed.
+
+(* Constructions with list_rcons ********************************************)
+
+lemma reverse_rcons (p) (l):
+      l◗(pᴿ) = (p◖l)ᴿ.
+#p #l
+<reverse_append //
+qed.
diff --git a/matita/matita/contribs/lambdadelta/delayed_updating/syntax/path_tail.ma b/matita/matita/contribs/lambdadelta/delayed_updating/syntax/path_tail.ma
new file mode 100644 (file)
index 0000000..193cc68
--- /dev/null
@@ -0,0 +1,73 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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/syntax/path_labels.ma".
+include "delayed_updating/notation/functions/downarrowright_2.ma".
+include "ground/arith/nat_plus.ma".
+include "ground/arith/nat_pred_succ.ma".
+
+(* TAIL FOR PATH ************************************************************)
+
+rec definition tail (m) (p) on p: path ≝
+match m with
+[ nzero  ⇒ 𝐞
+| ninj o ⇒ 
+  match p with
+  [ list_empty     ⇒ 𝗟∗∗m
+  | list_lcons l q ⇒
+    match l with
+    [ label_d n ⇒ l◗(tail (m+n) q)
+    | label_m   ⇒ l◗(tail m q)
+    | label_L   ⇒ l◗(tail (↓o) q)
+    | label_A   ⇒ l◗(tail m q)
+    | label_S   ⇒ l◗(tail m q)
+    ]
+  ]
+].
+
+interpretation
+  "tail (reversed path)"
+  'DownArrowRight n p = (tail n p).
+
+(* basic constructions ****************************************************)
+
+lemma tail_zero (p):
+      (𝐞) = ↳[𝟎]p.
+* // qed.
+
+lemma tail_empty (n):
+      (𝗟∗∗n) = ↳[n]𝐞.
+* // qed.
+
+lemma tail_d_sn (p) (n) (m:pnat):
+      (𝗱m◗↳[↑n+m]p) = ↳[↑n](𝗱m◗p).
+// qed.
+
+lemma tail_m_sn (p) (n):
+      (𝗺◗↳[↑n]p) = ↳[↑n](𝗺◗p).
+// qed.
+
+lemma tail_L_sn (p) (n):
+      (𝗟◗↳[n]p) = ↳[↑n](𝗟◗p).
+#p #n
+whd in ⊢ (???%); //
+qed.
+
+lemma tail_A_sn (p) (n):
+      (𝗔◗↳[↑n]p) = ↳[↑n](𝗔◗p).
+// qed.
+
+lemma tail_S_sn (p) (n):
+      (𝗦◗↳[↑n]p) = ↳[↑n](𝗦◗p).
+// qed.
diff --git a/matita/matita/contribs/lambdadelta/delayed_updating/syntax/path_tail_depth.ma b/matita/matita/contribs/lambdadelta/delayed_updating/syntax/path_tail_depth.ma
new file mode 100644 (file)
index 0000000..bccbea0
--- /dev/null
@@ -0,0 +1,44 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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/syntax/path_tail.ma".
+include "delayed_updating/syntax/path_depth.ma".
+include "delayed_updating/syntax/path_height.ma".
+(*
+include "ground/arith/nat_plus.ma".
+include "ground/arith/nat_pred_succ.ma".
+*)
+(* TAIL FOR PATH ************************************************************)
+
+(* Constructions with depth and height **************************************)
+
+axiom depth_lablels_L (n):
+      n = ♭(𝗟∗∗n).
+
+axiom height_lablels_L (n):
+      (𝟎) = ♯(𝗟∗∗n).
+
+lemma tail_depth (p) (n):
+      n + ♯(↳[n]p) = ♭↳[n]p.
+#p elim p -p // #l #p #IH
+#n @(nat_ind_succ … n) -n // #n #_
+cases l [ #m ]
+[ <tail_d_sn <height_d_sn <depth_d_sn //
+| <tail_m_sn <height_m_sn <depth_m_sn //
+| <tail_L_sn <height_L_sn <depth_L_sn
+  <nplus_succ_sn //
+| <tail_A_sn <height_A_sn <depth_A_sn //
+| <tail_S_sn <height_S_sn <depth_S_sn //
+]
+qed.
diff --git a/matita/matita/contribs/lambdadelta/delayed_updating/unwind/unwind1_rmap.ma b/matita/matita/contribs/lambdadelta/delayed_updating/unwind/unwind1_rmap.ma
new file mode 100644 (file)
index 0000000..b94f56d
--- /dev/null
@@ -0,0 +1,63 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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/syntax/path.ma".
+include "delayed_updating/notation/functions/black_righttriangle_1.ma".
+include "ground/relocation/tr_uni.ma".
+include "ground/relocation/tr_compose.ma".
+
+(* BASIC UNWIND MAP FOR PATH ************************************************)
+
+rec definition unwind1_rmap p on p: tr_map ≝
+match p with
+[ list_empty     ⇒ 𝐢
+| list_lcons l q ⇒
+  match l with
+  [ label_d n ⇒ (unwind1_rmap q)∘𝐮❨n❩
+  | label_m   ⇒ unwind1_rmap q
+  | label_L   ⇒ ⫯(unwind1_rmap q)
+  | label_A   ⇒ unwind1_rmap q
+  | label_S   ⇒ unwind1_rmap q
+  ]
+].
+
+interpretation
+  "basic unwind map (reversed path)"
+  'BlackRightTriangle p = (unwind1_rmap p).
+
+(* Basic constructions *******************************************************)
+
+lemma unwind1_rmap_empty:
+      (𝐢) = ▶(𝐞).
+// qed.
+
+lemma unwind1_rmap_d_sn (p) (n:pnat):
+      (▶p∘𝐮❨n❩) = ▶(𝗱n◗p).
+// qed.
+
+lemma unwind1_rmap_m_sn (p):
+      ▶p = ▶(𝗺◗p).
+// qed.
+
+lemma unwind1_rmap_L_sn (p):
+      (⫯▶p) = ▶(𝗟◗p).
+// qed.
+
+lemma unwind1_rmap_A_sn (p):
+      ▶p = ▶(𝗔◗p).
+// qed.
+
+lemma unwind1_rmap_S_sn (p):
+      ▶p = ▶(𝗦◗p).
+// qed.
diff --git a/matita/matita/contribs/lambdadelta/delayed_updating/unwind/unwind1_rmap_tail.ma b/matita/matita/contribs/lambdadelta/delayed_updating/unwind/unwind1_rmap_tail.ma
new file mode 100644 (file)
index 0000000..38fb8bf
--- /dev/null
@@ -0,0 +1,82 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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/unwind/unwind1_rmap.ma".
+include "delayed_updating/syntax/path_tail_depth.ma".
+include "delayed_updating/syntax/path_height.ma".
+
+(* BASIC UNWIND MAP FOR PATH ************************************************)
+
+include "ground/relocation/tr_uni_pap.ma".
+include "ground/relocation/tr_compose_pap.ma".
+include "ground/relocation/tr_pap_pn.ma".
+include "ground/notation/functions/applysucc_2.ma".
+include "ground/arith/nat_plus_rplus.ma".
+include "ground/arith/nat_pred_succ.ma".
+
+definition tr_nap (f) (l:nat): nat ≝
+           ↓(f@❨↑l❩).
+
+interpretation
+  "functional non-negative application (total relocation maps)"
+  'ApplySucc f l = (tr_nap f l).
+
+lemma tr_nap_unfold (f) (l):
+      ↓(f@❨↑l❩) = f@↑❨l❩.
+// qed.
+
+lemma tr_compose_nap (f2) (f1) (l):
+      f2@↑❨f1@↑❨l❩❩ = (f2∘f1)@↑❨l❩.
+#f2 #f1 #l
+<tr_nap_unfold <tr_nap_unfold <tr_nap_unfold
+<tr_compose_pap <npsucc_pred //
+qed.
+
+lemma tr_uni_nap (n) (m):
+      m + n = 𝐮❨n❩@↑❨m❩.
+#n #m
+<tr_nap_unfold
+<tr_uni_pap <nrplus_npsucc_sn //
+qed.
+
+lemma tr_nap_push (f):
+      ∀l. ↑(f@↑❨l❩) = (⫯f)@↑❨↑l❩.
+#f #l
+<tr_nap_unfold <tr_nap_unfold
+<tr_pap_push <pnpred_psucc //
+qed.
+
+(****)
+
+lemma unwind1_rmap_labels_L (n):
+      (𝐢) = ▶(𝗟∗∗n).
+#n @(nat_ind_succ … n) -n //
+#n #IH
+<labels_succ <unwind1_rmap_L_sn //
+qed.
+
+lemma unwind1_rmap_tail (p) (n):
+      n + ♯(↳[n]p) = (▶↳[n]p)@↑❨n❩.
+#p elim p -p //
+#l #p #IH #n @(nat_ind_succ … n) -n //
+#n #_ cases l [ #m ]
+[ <unwind1_rmap_d_sn <tail_d_sn <height_d_sn
+  <nplus_assoc >IH -IH <tr_compose_nap //
+| <unwind1_rmap_m_sn <tail_m_sn <height_m_sn //
+| <unwind1_rmap_L_sn <tail_L_sn <height_L_sn
+  <tr_nap_push <npred_succ //
+| <unwind1_rmap_A_sn <tail_A_sn <height_A_sn //
+| <unwind1_rmap_S_sn <tail_S_sn <height_S_sn //
+]
+qed.
diff --git a/matita/matita/contribs/lambdadelta/ground/notation/functions/applysucc_2.ma b/matita/matita/contribs/lambdadelta/ground/notation/functions/applysucc_2.ma
new file mode 100644 (file)
index 0000000..177d043
--- /dev/null
@@ -0,0 +1,19 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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                  *)
+(*                                                                        *)
+(**************************************************************************)
+
+(* GROUND NOTATION **********************************************************)
+
+notation "hvbox( f @↑❨ break term 46 a ❩ )"
+  non associative with precedence 60
+  for @{ 'ApplySucc $f $a }.
index 1ee9d29e0bca9a91027ff72e28aeed392fcd9bf5..59df305320ebbf6cf06871e6ddd374419b15a3d5 100644 (file)
@@ -1503,6 +1503,7 @@ let load_predefined_virtuals () =
 ;;
 
 let predefined_classes = [
+ ["*"; "∗"; ];
  ["/"; "⧸"; ];
  ["&"; "⅋"; ];
  ["|"; "❘"; "∥"; ];
@@ -1522,7 +1523,7 @@ let predefined_classes = [
  ["⇕"; "⇳"; "⬍"; "↕"; ];
  ["↔"; "⇔"; "⬄"; "⬌"; ] ; 
  ["≤"; "≲"; "≼"; "≰"; "≴"; "⋠"; "⊆"; "⫃"; "⊑"; ] ;
- ["_"; "↓"; "↙"; "⇣"; "⇃"; "⇂"; "⎽"; "⎼"; "⎻"; "⎺"; "▿"; ];
+ ["_"; "â\86\93"; "â\86\99"; "â\87£"; "â\87\83"; "â\87\82"; "â\86³"; "â\8e½"; "â\8e¼"; "â\8e»"; "â\8eº"; "â\96¿"; ];
  ["<"; "≺"; "≮"; "⊀"; "〈"; "«"; "❬"; "❮"; "❰"; ] ;
  ["("; "❨"; "❪"; "❲"; "("; ];
  [")"; "❩"; "❫"; "❳"; ")"; ];