+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
+;;
(* NG: minimal wrapper on the old cicEnvironment, should provide only the
* functions strictly necessary to the typechecking algorithm *)
-val get_checked_obj : NReference.reference -> NCic.obj
+val get_checked_obj : NUri.uri -> NCic.obj
(* EOF *)
;;
let reference_of_ouri u indinfo =
- let u = NUri.uri_of_string (UriManager.string_of_uri u) in
+ let u = NUri.nuri_of_ouri u in
reference_of_string (string_of_reference (Ref (~-1,u,indinfo)))
;;
-let ouri_of_reference (Ref (_,u,_)) =
- UriManager.uri_of_string (NUri.string_of_uri u)
-;;
+let ouri_of_reference (Ref (_,u,_)) = NUri.ouri_of_nuri u;;
end;;
module UriHash = Hashtbl.Make(HT);;
+
+let ouri_of_nuri u = UriManager.uri_of_string (string_of_uri u);;
+let nuri_of_ouri o = uri_of_string (UriManager.string_of_uri o);;
+
val eq: uri -> uri -> bool
module UriHash: Hashtbl.S with type key = uri
+
+(* CACCA *)
+val ouri_of_nuri: uri -> UriManager.uri
+val nuri_of_ouri: UriManager.uri -> uri