]> matita.cs.unibo.it Git - helm.git/commitdiff
update in delayed_updating
authorFerruccio Guidi <ferruccio.guidi@unibo.it>
Mon, 14 Feb 2022 23:23:15 +0000 (00:23 +0100)
committerFerruccio Guidi <ferruccio.guidi@unibo.it>
Mon, 14 Feb 2022 23:23:15 +0000 (00:23 +0100)
+ update count for paths
+ minor additions and corrections

matita/matita/contribs/lambdadelta/delayed_updating/notation/functions/circled_times_1.ma
matita/matita/contribs/lambdadelta/delayed_updating/notation/functions/hash_1.ma
matita/matita/contribs/lambdadelta/delayed_updating/reduction/dfr_ifr.ma
matita/matita/contribs/lambdadelta/delayed_updating/substitution/lift.ma
matita/matita/contribs/lambdadelta/delayed_updating/substitution/lift_depth.ma
matita/matita/contribs/lambdadelta/delayed_updating/substitution/lift_eq.ma
matita/matita/contribs/lambdadelta/delayed_updating/substitution/lift_update.ma [new file with mode: 0644]
matita/matita/contribs/lambdadelta/delayed_updating/syntax/bdd_term.ma
matita/matita/contribs/lambdadelta/delayed_updating/syntax/path_depth.ma
matita/matita/contribs/lambdadelta/delayed_updating/syntax/path_update.ma [new file with mode: 0644]

index ac8c482a942af53417cb385d2eef06dca74d92a9..8c39289b57e329bf05983213d4d313d5d589c7bb 100644 (file)
@@ -14,6 +14,6 @@
 
 (* NOTATION FOR DELAYED UPDATING ********************************************)
 
-notation "hvbox( ⊗ term 60 p )"
-  non associative with precedence 60
+notation "hvbox( ⊗ term 70 p )"
+  non associative with precedence 70
   for @{ 'CircledTimes $p }.
index 9369e0840c03e982de8dfa6a205919db013b2f98..ccd9bef9cf38a31b663848d6c03e53612babc0d8 100644 (file)
@@ -14,6 +14,6 @@
 
 (* NOTATION FOR DELAYED UPDATING ********************************************)
 
-notation "hvbox( # break term 90 n )"
+notation "hvbox(  break term 90 n )"
   non associative with precedence 70
   for @{ 'Hash $n }.
index 17fcd859888ef3d4413bdf10049a5a5e848e6ad7..84e27153095238276ffa28de6ca4162ad0ee0b2c 100644 (file)
@@ -43,7 +43,7 @@ lemma dfr_lift_bi (f) (p) (q) (t1) (t2): t1 ϵ 𝐓 →
   @(subset_eq_trans … (lift_fsubst …))
   [ <lift_rmap_append <lift_rmap_A_sn <lift_rmap_append <lift_rmap_L_sn
     <structure_append <structure_A_sn <structure_append <structure_L_sn
-    <depth_plus <depth_L_sn <depth_structure <depth_structure
+    <depth_append <depth_L_sn <depth_structure <depth_structure
     @fsubst_eq_repl [ // ]
     @(subset_eq_trans … (lift_iref …))
     @(subset_eq_canc_sn … (lift_term_eq_repl_dx …))
index f2b004a1898f8f7033e93e604555ee5d38af5a6c..bfb66f1bc911e23f4b6a2b445f62fe236f6552c4 100644 (file)
@@ -146,6 +146,10 @@ qed.
 
 (* Advanced constructions with proj_rmap and path_rcons *********************)
 
+lemma lift_rmap_d_dx (f) (p) (n):
+      (↑[p]f)∘𝐮❨ninj n❩ = ↑[p◖𝗱n]f.
+// qed.
+
 lemma lift_rmap_m_dx (f) (p):
       ↑[p]f = ↑[p◖𝗺]f.
 // qed.
index b88464a91c84a1188626beeb2767fb65acb26c5f..dc829088925c5831bbfbe448cd002928dbc9bff7 100644 (file)
@@ -25,6 +25,6 @@ lemma pippo (p) (f):
 #p elim p -p
 [ #f <lift_rmap_empty <lift_rmap_empty <tr_pushs_zero
 | * [ #n ] #p #IH #f //
-  <lift_rmap_d_sn <lift_rmap_d_sn <depth_d
+  <lift_rmap_d_sn <lift_rmap_d_sn <depth_d_sn
   @(trans_eq … (IH …)) -IH
       
index dc3000c1563f6a4d70c767aa8b195718a66b2d2a..41e6b59f0e6a0752ee449ab235bcaee875e170e1 100644 (file)
@@ -13,8 +13,8 @@
 (**************************************************************************)
 
 include "delayed_updating/substitution/lift.ma".
+include "ground/relocation/tr_uni_compose.ma".
 include "ground/relocation/tr_compose_compose.ma".
-include "ground/relocation/tr_compose_pn.ma".
 include "ground/relocation/tr_compose_eq.ma".
 include "ground/relocation/tr_pn_eq.ma".
 
@@ -111,3 +111,12 @@ lemma lift_path_after (p) (f1) (f2):
   >tr_compose_push_bi //
 ]
 qed.
+
+(* Advanced constructions with proj_rmap and stream_tls *********************)
+
+lemma lift_rmap_tls_d_dx (f) (p) (m) (n):
+      ⇂*[m+n]↑[p]f ≗ ⇂*[m]↑[p◖𝗱n]f.
+#f #p #m #n
+<lift_rmap_d_dx >nrplus_inj_dx
+/2 width=1 by tr_tls_compose_uni_dx/
+qed.
diff --git a/matita/matita/contribs/lambdadelta/delayed_updating/substitution/lift_update.ma b/matita/matita/contribs/lambdadelta/delayed_updating/substitution/lift_update.ma
new file mode 100644 (file)
index 0000000..999b0e1
--- /dev/null
@@ -0,0 +1,41 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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/substitution/lift_eq.ma".
+include "delayed_updating/syntax/path_update.ma".
+include "delayed_updating/syntax/path_depth.ma".
+include "ground/lib/stream_eq_eq.ma".
+
+(* LIFT FOR PATH ***********************************************************)
+
+(* Constructions with update ***********************************************)
+
+axiom arith1 (p,q:pnat) (n:nat):
+      nrplus (pplus p q) n = pplus p (nrplus q n).
+
+lemma pippo (f) (p) (m:pnat):
+      ⇂*[ninj (m+⧣p)]f ≗ ⇂*[ninj (m+❘p❘)]↑[p]f.
+#f #p @(list_ind_rcons … p) -p [ // ]
+#p * [ #n ] #IH #m
+[ <update_d_dx <depth_d_dx
+  <nplus_comm <nrplus_inj_sn <nrplus_inj_dx <arith1
+  @(stream_eq_trans … (lift_rmap_tls_d_dx …))
+  @(stream_eq_canc_dx … (IH …)) -IH //
+| //
+| <update_L_dx <depth_L_dx
+  <nrplus_succ_dx >nsucc_inj //
+| //
+| //
+]
+qed.  
index 897773a42d64d67b19e83d777b87fcca6975cd2d..8d514e0d7f2a1fe8ff3438166b9aed1388d93d9c 100644 (file)
@@ -24,7 +24,7 @@ include "ground/xoa/ex_5_3.ma".
 (* BY-DEPTH DELAYED (BDD) TERM **********************************************)
 
 inductive bdd: 𝒫❨prototerm❩ ≝
-| bdd_oref: ∀n. bdd (#n)
+| bdd_oref: ∀n. bdd (n)
 | bdd_iref: ∀t,n. bdd t → bdd (𝛗n.t)
 | bdd_abst: ∀t. bdd t → bdd (𝛌.t)
 | bdd_appl: ∀u,t. bdd u → bdd t → bdd (@u.t)
index a85d74ef16e4f6b1e84a62db74e0119c0fdbd6ac..cdf24943af922c8a47c74990fb79e92acf803231 100644 (file)
@@ -55,10 +55,10 @@ lemma depth_A_sn (q): ❘q❘ = ❘𝗔◗q❘.
 lemma depth_S_sn (q): ❘q❘ = ❘𝗦◗q❘.
 // qed.
 
-(* Advanced constructions with nplus ****************************************)
+(* Main constructions *******************************************************)
 
-lemma depth_plus (p1) (p2):
-      ❘p2❘+❘p1❘ = ❘p1●p2❘.
+theorem depth_append (p1) (p2):
+        ❘p2❘+❘p1❘ = ❘p1●p2❘.
 #p1 elim p1 -p1 //
 * [ #n ] #p1 #IH #p2 <list_append_lcons_sn
 [ <depth_d_sn <depth_d_sn //
@@ -68,3 +68,25 @@ lemma depth_plus (p1) (p2):
 | <depth_S_sn <depth_S_sn //
 ]
 qed.
+
+(* Constructions with list_rcons ********************************************)
+
+lemma depth_d_dx (p) (n):
+      ❘p❘ = ❘p◖𝗱n❘.
+// qed.
+
+lemma depth_m_dx (p):
+      ❘p❘ = ❘p◖𝗺❘.
+// qed.
+
+lemma depth_L_dx (p):
+      ↑❘p❘ = ❘p◖𝗟❘.
+// qed.
+
+lemma depth_A_dx (p):
+      ❘p❘ = ❘p◖𝗔❘.
+// qed.
+
+lemma depth_S_dx (p):
+      ❘p❘ = ❘p◖𝗦❘.
+// qed.
diff --git a/matita/matita/contribs/lambdadelta/delayed_updating/syntax/path_update.ma b/matita/matita/contribs/lambdadelta/delayed_updating/syntax/path_update.ma
new file mode 100644 (file)
index 0000000..1f629f7
--- /dev/null
@@ -0,0 +1,92 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||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 "ground/arith/nat_plus.ma".
+include "delayed_updating/syntax/path.ma".
+include "delayed_updating/notation/functions/hash_1.ma".
+
+(* UPDATE COUNT FOR PATH ****************************************************)
+
+rec definition update (p) on p: nat ≝
+match p with
+[ list_empty     ⇒ 𝟎
+| list_lcons l q ⇒
+  match l with
+  [ label_d n ⇒ n + update q
+  | label_m   ⇒ update q
+  | label_L   ⇒ update q
+  | label_A   ⇒ update q
+  | label_S   ⇒ update q
+  ]
+].
+
+interpretation
+  "update count (path)"
+  'Hash p = (update p).
+
+(* Basic constructions ******************************************************)
+
+lemma update_empty: 𝟎 = ⧣𝐞.
+// qed.
+
+lemma update_d_sn (q) (n): ninj n+⧣q = ⧣(𝗱n◗q).
+// qed.
+
+lemma update_m_sn (q): ⧣q = ⧣(𝗺◗q).
+// qed.
+
+lemma update_L_sn (q): ⧣q = ⧣(𝗟◗q).
+// qed.
+
+lemma update_A_sn (q): ⧣q = ⧣(𝗔◗q).
+// qed.
+
+lemma update_S_sn (q): ⧣q = ⧣(𝗦◗q).
+// qed.
+
+(* Main constructions *******************************************************)
+
+theorem update_append (p1) (p2):
+        (⧣p2+⧣p1) = ⧣(p1●p2).
+#p1 elim p1 -p1 //
+* [ #n ] #p1 #IH #p2 <list_append_lcons_sn
+[ <update_d_sn <update_d_sn //
+| <update_m_sn <update_m_sn //
+| <update_L_sn <update_L_sn //
+| <update_A_sn <update_A_sn //
+| <update_S_sn <update_S_sn //
+]
+qed.
+
+(* Constructions with list_rcons ********************************************)
+
+lemma update_d_dx (p) (n):
+      (⧣p)+(ninj n) = ⧣(p◖𝗱n).
+// qed.
+
+lemma update_m_dx (p):
+      (⧣p) = ⧣(p◖𝗺).
+// qed.
+
+lemma update_L_dx (p):
+      (⧣p) = ⧣(p◖𝗟).
+// qed.
+
+lemma update_A_dx (p):
+      (⧣p) = ⧣(p◖𝗔).
+// qed.
+
+lemma update_S_dx (p):
+      (⧣p) = ⧣(p◖𝗦).
+// qed.