]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/lambda-delta/basic_rg/brgEnvironment.ml
Regular expressions.
[helm.git] / helm / software / lambda-delta / basic_rg / brgEnvironment.ml
index f1561516d1cb47f31abe87e8127913610b0b9d27..121da88da4d54e955fa480e68aa88ea31048704c 100644 (file)
 
 module U = NUri
 module H = U.UriHash
+module Y = Entity
 module B = Brg
 
-exception ObjectNotFound of string Lazy.t
-
 let hsize = 7000 
 let env = H.create hsize
 
 (* Internal functions *******************************************************)
 
+let get_age = 
+   let age = ref 0 in
+   fun () -> incr age; !age
+
 (* Interface functions ******************************************************)
 
-let set_obj f obj uri =
-   H.add env uri obj; f obj uri
-   
-let get_obj f uri =
-   try f (H.find env uri) uri
-   with Not_found -> raise (ObjectNotFound (lazy (U.string_of_uri uri)))
+(* decps *)
+let set_entity (a, uri, b) =
+   let age = get_age () in
+   let entity = (Y.Apix age :: a), uri, b in
+   H.add env uri entity; entity
+
+let get_entity uri =
+   try H.find env uri with Not_found -> [], uri, Y.Void