]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/ng_kernel/nCicEnvironment.ml
oldenv2newenv cache
[helm.git] / helm / software / components / ng_kernel / nCicEnvironment.ml
index 278f7fff5802764d013951d9f457532c703a46ef..9549f3c3cbcd92f260762b9e3aa5cf5ab8d0963a 100644 (file)
@@ -1,8 +1,13 @@
+let cache = NUri.UriHash.create 313;;
 
-let get_checked_obj reference =
-  let ouri = NReference.ouri_of_reference reference in
-  let o,_ = 
-    CicEnvironment.get_cooked_obj ~trust:false CicUniv.oblivion_ugraph 
-      ouri 
-  in
-    OCic2NCic.convert_obj o
+let get_checked_obj u =
+  try NUri.UriHash.find cache u
+  with Not_found ->
+    let ouri = NUri.ouri_of_nuri u in
+    let o,_ = 
+      CicEnvironment.get_cooked_obj ~trust:false CicUniv.oblivion_ugraph 
+        ouri in
+    let no = OCic2NCic.convert_obj o in
+    NUri.UriHash.add cache u no;
+    no
+;;