]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/ng_kernel/nCicLibrary.ml
- fixed hint generation, more hints are generated
[helm.git] / helm / software / components / ng_kernel / nCicLibrary.ml
index fa2816773cbc9d3107f62a789e2fcf9b07ee44e4..946535fe1fd8d5cb70775fcb38bc2dc5d7730a81 100644 (file)
@@ -20,10 +20,16 @@ let get_obj u =
   with Not_found ->
     (* in the final implementation should get it from disk *)
     let ouri = NCic2OCic.ouri_of_nuri u in
-    let o,_ = CicEnvironment.get_obj CicUniv.oblivion_ugraph ouri in
-    let l = OCic2NCic.convert_obj ouri o in
-    List.iter (fun (u,_,_,_,_ as o) -> 
-(*       prerr_endline ("+"^NUri.string_of_uri u);  *)
-      NUri.UriHash.add cache u o) l;
-    HExtlib.list_last l
+    try
+      let o,_ = CicEnvironment.get_obj CicUniv.oblivion_ugraph ouri in
+      let l = OCic2NCic.convert_obj ouri o in
+      List.iter (fun (u,_,_,_,_ as o) -> 
+  (*       prerr_endline ("+"^NUri.string_of_uri u);  *)
+        NUri.UriHash.add cache u o) l;
+      HExtlib.list_last l
+    with CicEnvironment.Object_not_found u -> 
+      raise (ObjectNotFound 
+               (lazy (NUri.string_of_uri (OCic2NCic.nuri_of_ouri u))))
 ;;
+
+let clear_cache () = NUri.UriHash.clear cache;;