open Printf
+(* (* PROFILING *)
let apply_subst_counter = ref 0
let apply_subst_context_counter = ref 0
let apply_subst_metasenv_counter = ref 0
let are_convertible_counter = ref 0
let metasenv_length = ref 0
let context_length = ref 0
-
let reset_counters () =
apply_subst_counter := 0;
apply_subst_context_counter := 0;
are_convertible_counter := 0;
metasenv_length := 0;
context_length := 0
-
let print_counters () =
prerr_endline (Printf.sprintf
"apply_subst: %d
!context_length
((float !context_length) /. (float !apply_subst_context_counter))
)
+*)
exception MetaSubstFailure of string
exception Uncertain of string
end
in
fun s t ->
- incr apply_subst_counter;
+(* incr apply_subst_counter; *)
apply_subst_gen ~appl_fun s t
;;
let rec apply_subst_context subst context =
+(*
incr apply_subst_context_counter;
context_length := !context_length + List.length context;
+*)
List.fold_right
(fun item context ->
match item with
context []
let apply_subst_metasenv subst metasenv =
+(*
incr apply_subst_metasenv_counter;
metasenv_length := !metasenv_length + List.length metasenv;
+*)
List.map
(fun (n, context, ty) ->
(n, apply_subst_context subst context, apply_subst subst ty))
* the calculus *)
let lift subst n term =
- incr subst_counter;
+(* incr subst_counter; *)
let term = apply_subst subst term in
try
CicSubstitution.lift n term
raise (MetaSubstFailure ("Lift failure: " ^ Printexc.to_string e))
let subst subst t1 t2 =
- incr subst_counter;
+(* incr subst_counter; *)
let t1 = apply_subst subst t1 in
let t2 = apply_subst subst t2 in
try
raise (MetaSubstFailure ("Subst failure: " ^ Printexc.to_string e))
let whd subst context term =
- incr whd_counter;
+(* incr whd_counter; *)
let term = apply_subst subst term in
let context = apply_subst_context subst context in
try
Printexc.to_string e))
let are_convertible subst context t1 t2 =
- incr are_convertible_counter;
+(* incr are_convertible_counter; *)
let context = apply_subst_context subst context in
let t1 = apply_subst subst t1 in
let t2 = apply_subst subst t2 in