]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/helena/src/basic_rg/brgEnvironment.ml
update in delayed_updating
[helm.git] / helm / software / helena / src / basic_rg / brgEnvironment.ml
index 0b1f1da178df5d7f61233369befb09afbd6bbda1..01a38f89ffeffa52e296b023b3816d083f0389f0 100644 (file)
@@ -9,27 +9,26 @@
      \ /   This software is distributed as is, NO WARRANTY.              
       V_______________________________________________________________ *)
 
-module U = NUri
-module K = U.UriHash
-module E = Entity
-module B = Brg
+module U  = NUri
+module UH = U.UriHash
+module G  = Options
+module E  = Entity
 
 let hsize = 7000 
-let env = K.create hsize
-
-(* Internal functions *******************************************************)
-
-let get_age = 
-   let age = ref 0 in
-   fun () -> incr age; !age
+let env = UH.create hsize
 
 (* Interface functions ******************************************************)
 
 (* decps *)
-let set_entity (a, uri, b) =
-   let age = get_age () in
-   let entity = (E.Apix age :: a), uri, b in
-   K.add env uri entity; entity
+let set_entity entity =
+IFDEF EXPAND THEN
+   let ra, na, uri, b = entity in
+   let entity0 = if !G.expand then ra, E.node_attrs ~apix:0 (), uri, b else entity in
+   UH.add env uri entity0; entity
+ELSE
+   let _, _, uri, _ = entity in
+   UH.add env uri entity; entity
+END
 
 let get_entity uri =
-   try K.find env uri with Not_found -> [], uri, E.Void
+   try UH.find env uri with Not_found -> E.empty_root, E.empty_node, uri, E.Void