raise
(TypeCheckerFailure
(lazy (Printf.sprintf
- ("Appl: wrong application of %s: the parameter %s has type"^^
+ ("Appl: wrong application of %s: the argument %s has type"^^
"\n%s\nbut it should have type \n%s\nContext:\n%s\n")
(PP.ppterm ~subst ~metasenv ~context he)
(PP.ppterm ~subst ~metasenv ~context arg)
let _ = NCicReduction.set_get_relevance get_relevance;;
+
+let indent = ref 0;;
+let debug = true;;
+let logger =
+ let do_indent () = String.make !indent ' ' in
+ (function
+ | `Start_type_checking s ->
+ if debug then
+ prerr_endline (do_indent () ^ "Start: " ^ NUri.string_of_uri s);
+ incr indent
+ | `Type_checking_completed s ->
+ decr indent;
+ if debug then
+ prerr_endline (do_indent () ^ "End: " ^ NUri.string_of_uri s)
+ | `Type_checking_interrupted s ->
+ decr indent;
+ if debug then
+ prerr_endline (do_indent () ^ "Break: " ^ NUri.string_of_uri s)
+ | `Type_checking_failed s ->
+ decr indent;
+ if debug then
+ prerr_endline (do_indent () ^ "Fail: " ^ NUri.string_of_uri s)
+ | `Trust_obj s ->
+ if debug then
+ prerr_endline (do_indent () ^ "Trust: " ^ NUri.string_of_uri s))
+;;
+(* let _ = set_logger logger ;; *)
(* EOF *)
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