]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/cic_proof_checking/cicEnvironment.ml
positivity check fixed, a MutInd not applied (but with an exp-named-subst)
[helm.git] / helm / software / components / cic_proof_checking / cicEnvironment.ml
index 8ae5c1b13c1a80a0cc9c974a05b71f8ccda6f49b..ec12c8d01c80a790fec70c836ea5efa7cc4e1d3e 100644 (file)
@@ -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 ()
+;;