X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Flambda-delta%2Fbasic_rg%2FbrgEnvironment.ml;fp=helm%2Fsoftware%2Flambda-delta%2Fbasic_rg%2FbrgEnvironment.ml;h=5a4cf3cb6d0875cbda2ea881e68fb4c0160ba0d4;hb=cd798346d31b14b8947e5801b87dc4f363607862;hp=1017092d7afce42c116fd60697813eec3475df26;hpb=40ecc6da8b481b45d6bf0e1cfd2c285e98ed8e35;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..5a4cf3cb6 100644 --- a/helm/software/lambda-delta/basic_rg/brgEnvironment.ml +++ b/helm/software/lambda-delta/basic_rg/brgEnvironment.ml @@ -11,20 +11,24 @@ 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 +let set_entity f (a, uri, b) = + let age = get_age () in + let entity = (Y.Apix age :: a), uri, b in + H.add env uri entity; f entity -let get_entry err f uri = +let get_entity err f uri = try f (H.find env uri) with Not_found -> err ()