X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Flambda-delta%2Fbasic_rg%2FbrgEnvironment.ml;h=121da88da4d54e955fa480e68aa88ea31048704c;hb=85521efd364ec494e4cc024bbf87182a312e1b7b;hp=1017092d7afce42c116fd60697813eec3475df26;hpb=79684e8bd0f54b5c88fff981366bd8c78dd0fbe9;p=helm.git diff --git a/helm/software/lambda-delta/basic_rg/brgEnvironment.ml b/helm/software/lambda-delta/basic_rg/brgEnvironment.ml index 1017092d7..121da88da 100644 --- a/helm/software/lambda-delta/basic_rg/brgEnvironment.ml +++ b/helm/software/lambda-delta/basic_rg/brgEnvironment.ml @@ -11,20 +11,25 @@ module U = NUri module H = U.UriHash +module Y = Entity module B = Brg let hsize = 7000 let env = H.create hsize -let age = ref 1 (* Internal functions *******************************************************) +let get_age = + let age = ref 0 in + fun () -> incr age; !age + (* Interface functions ******************************************************) -let set_entry f entry = - let _, uri, b = entry in - let entry = !age, uri, b in - incr age; H.add env uri entry; f entry +(* 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_entry err f uri = - try f (H.find env uri) with Not_found -> err () +let get_entity uri = + try H.find env uri with Not_found -> [], uri, Y.Void