X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fcic_proof_checking%2FcicEnvironment.ml;h=ec12c8d01c80a790fec70c836ea5efa7cc4e1d3e;hb=c59d5065faea77ce41431e273a3331f4d152fbfa;hp=8ae5c1b13c1a80a0cc9c974a05b71f8ccda6f49b;hpb=111df95ac03f2ee21dfa2422a7f531f675b1c16d;p=helm.git diff --git a/helm/software/components/cic_proof_checking/cicEnvironment.ml b/helm/software/components/cic_proof_checking/cicEnvironment.ml index 8ae5c1b13..ec12c8d01 100644 --- a/helm/software/components/cic_proof_checking/cicEnvironment.ml +++ b/helm/software/components/cic_proof_checking/cicEnvironment.ml @@ -105,6 +105,7 @@ module Cache : val is_in_unchecked: UriManager.uri -> bool val is_in_cooked: UriManager.uri -> bool val list_all_cooked_uris: unit -> UriManager.uri list + val invalidate: unit -> unit end = struct @@ -143,6 +144,15 @@ module Cache : (* unchecked is used to store objects just fetched, nothing more. *) let unchecked_list = ref [];; + let invalidate _ = + let l = HT.fold (fun k (o,g,gl) acc -> (k,(o,Some (g,gl)))::acc) cacheOfCookedObjects [] in + unchecked_list := + HExtlib.list_uniq ~eq:(fun (x,_) (y,_) -> UriManager.eq x y) + (List.sort (fun (x,_) (y,_) -> UriManager.compare x y) (l @ !unchecked_list)); + frozen_list := []; + HT.clear cacheOfCookedObjects; + ;; + let empty () = HT.clear cacheOfCookedObjects; unchecked_list := [] ; @@ -546,3 +556,7 @@ let list_obj () = debug_print (lazy "Who has removed the uri in the meanwhile?"); raise Not_found ;; + +let invalidate _ = + Cache.invalidate () +;;