]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/cic_proof_checking/cicEnvironment.ml
added list_obj and list_uri
[helm.git] / helm / ocaml / cic_proof_checking / cicEnvironment.ml
index 461c3edc62f49d595cdb49fc5e82b23c0c15984e..5c1daa1373be26c35df429e23e6789847db69f5d 100644 (file)
@@ -99,6 +99,7 @@ module Cache :
    val is_in_frozen: UriManager.uri -> bool
    val is_in_unchecked: UriManager.uri -> bool
    val is_in_cooked: UriManager.uri -> bool
+   val list_all_cooked_uris: unit -> UriManager.uri list
   end 
 =
   struct
@@ -458,6 +459,10 @@ module Cache :
        HT.remove cacheOfCookedObjects uri 
    ;;
    
+   let  list_all_cooked_uris () =
+     HT.fold (fun u _ l -> u::l) cacheOfCookedObjects []
+   ;;
+   
   end
 ;;
 
@@ -675,4 +680,19 @@ let in_library uri =
   with Http_getter_types.Key_not_found _ -> false)
 
 let remove_term = Cache.remove
+  
+let list_uri () = 
+  Cache.list_all_cooked_uris ()
+;;
 
+let list_obj () =
+  try 
+    List.map (fun u -> 
+      let o,ug = get_obj CicUniv.empty_ugraph u in
+        (u,o,ug)) 
+    (list_uri ())
+  with
+    Not_found -> 
+      prerr_endline "Who has removed the uri in the meanwhile?";
+      raise Not_found
+;;