module PEH = ProofEngineHelpers
module TC = CicTypeChecker
module Un = CicUniv
+module L = Librarian
module H = ProceduralHelpers
module Cl = ProceduralClassify
+(* debugging ****************************************************************)
+
+let debug = ref false
+
(* term preprocessing: optomization 1 ***************************************)
let defined_premise = "DEFINED"
| C.Lambda (_, _, t) when n > 0 ->
aux 0 (pred n) (S.lift (-1) t)
| t when n > 0 ->
- Printf.eprintf "CicPPP clear_absts: %u %s\n" n (Pp.ppterm t);
+ Printf.eprintf "PO.clear_absts: %u %s\n" n (Pp.ppterm t);
assert false
| t -> t
in
| C.Constant (name, Some bo, ty, pars, attrs) ->
let bo, ty = H.cic_bc [] bo, H.cic_bc [] ty in
let g bo =
- Printf.eprintf "Optimized : %s\nPost Nodes: %u\n"
- (Pp.ppterm bo) (I.count_nodes 0 bo);
- prerr_string "H.pp_term : ";
- H.pp_term prerr_string [] [] bo; prerr_newline ();
- let _ = H.get_type "opt" [] (C.Cast (bo, ty)) in
+ if !debug then begin
+ Printf.eprintf "Optimized : %s\nPost Nodes: %u\n"
+ (Pp.ppterm bo) (I.count_nodes 0 bo);
+ prerr_string "H.pp_term : ";
+ H.pp_term prerr_string [] [] bo; prerr_newline ()
+ end;
+(* let _ = H.get_type "opt" [] (C.Cast (bo, ty)) in *)
+ L.time_stamp ("PO: DONE " ^ name);
C.Constant (name, Some bo, ty, pars, attrs)
in
- Printf.eprintf "BEGIN: %s\nPre Nodes : %u\n"
- name (I.count_nodes 0 bo);
+ L.time_stamp ("PO: OPTIMIZING " ^ name);
+ if !debug then
+ Printf.eprintf "BEGIN: %s\nPre Nodes : %u\n"
+ name (I.count_nodes 0 bo);
begin try opt1_term g (* (opt2_term g []) *) true [] bo with
| E.Object_not_found uri ->
let msg = "optimize_obj: object not found: " ^ UM.string_of_uri uri in