--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||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 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||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 }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||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❘.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||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.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||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 }.
;;
let predefined_classes = [
+ ["*"; "∗"; ];
["/"; "⧸"; ];
["&"; "⅋"; ];
["|"; "❘"; "∥"; ];
["⇕"; "⇳"; "⬍"; "↕"; ];
["↔"; "⇔"; "⬄"; "⬌"; ] ;
["≤"; "≲"; "≼"; "≰"; "≴"; "⋠"; "⊆"; "⫃"; "⊑"; ] ;
- ["_"; "↓"; "↙"; "⇣"; "⇃"; "⇂"; "⎽"; "⎼"; "⎻"; "⎺"; "▿"; ];
+ ["_"; "â\86\93"; "â\86\99"; "â\87£"; "â\87\83"; "â\87\82"; "â\86³"; "â\8e½"; "â\8e¼"; "â\8e»"; "â\8eº"; "â\96¿"; ];
["<"; "≺"; "≮"; "⊀"; "〈"; "«"; "❬"; "❮"; "❰"; ] ;
["("; "❨"; "❪"; "❲"; "("; ];
[")"; "❩"; "❫"; "❳"; ")"; ];