let nuri_of_ouri o = NUri.uri_of_string (UriManager.string_of_uri o);;
let mk_type n =
- if n = 0 then
- [false, NUri.uri_of_string ("cic:/matita/pts/Type.univ")]
- else
- [false, NUri.uri_of_string ("cic:/matita/pts/Type"^string_of_int n^".univ")]
+ [false, NUri.uri_of_string ("cic:/matita/pts/Type"^string_of_int n^".univ")]
;;
let mk_cprop n =
with Found ref -> Some ref
;;
+let cache1 = UriManager.UriHashtbl.create 313;;
let rec get_height =
- let cache = UriManager.UriHashtbl.create 313 in
function u ->
try
- UriManager.UriHashtbl.find cache u
+ UriManager.UriHashtbl.find cache1 u
with
Not_found ->
let h = ref 0 in
1 + !h
| _ -> 0
in
- UriManager.UriHashtbl.add cache u res;
+ UriManager.UriHashtbl.add cache1 u res;
res
and height_of_term ?(h=ref 0) t =
let rec aux =
fixpoints @ [obj]
;;
+let clear () =
+ Hashtbl.clear cache;
+ UriManager.UriHashtbl.clear cache1
+;;
+
(*
let convert_context uri =
let name_of = function Cic.Name s -> s | _ -> "_" in
aux false [] [] 0 uri t
;;
*)
+
+let reference_of_oxuri u =
+ let t = CicUtil.term_of_uri u in
+ let t',l = convert_term (UriManager.uri_of_string "cic:/dummy/dummy.con") t in
+ match t',l with
+ NCic.Const nref, [] -> nref
+ | _,_ -> assert false
+;;