X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=sidebyside;f=helm%2Fsoftware%2Flambda-delta%2Fbasic_rg%2FbrgEnvironment.ml;h=121da88da4d54e955fa480e68aa88ea31048704c;hb=e22808c929a9cebf5e4e2b7428ff0cbf89e1f92a;hp=fb4243c74f024bb979dd2b1a941ecbdc396d9d73;hpb=41bf338d7e638ebb5d97e525055bff05b1f0f045;p=helm.git diff --git a/helm/software/lambda-delta/basic_rg/brgEnvironment.ml b/helm/software/lambda-delta/basic_rg/brgEnvironment.ml index fb4243c74..121da88da 100644 --- a/helm/software/lambda-delta/basic_rg/brgEnvironment.ml +++ b/helm/software/lambda-delta/basic_rg/brgEnvironment.ml @@ -10,26 +10,26 @@ V_______________________________________________________________ *) module U = NUri -module L = Log module H = U.UriHash +module Y = Entity module B = Brg -exception ObjectNotFound of B.message - let hsize = 7000 let env = H.create hsize -let entry = ref 0 (* Internal functions *******************************************************) -let error uri = raise (ObjectNotFound (L.items1 (U.string_of_uri uri))) +let get_age = + let age = ref 0 in + fun () -> incr age; !age (* Interface functions ******************************************************) -let set_obj f obj = - let _, uri, b = obj in - let obj = !entry, uri, b in - incr entry; H.add env uri obj; f obj +(* 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_obj f uri = - try f (H.find env uri) with Not_found -> error uri +let get_entity uri = + try H.find env uri with Not_found -> [], uri, Y.Void