open Inference;;
open Utils;;
+(*
+for debugging
+let check_equation env equation msg =
+ let w, proof, (eq_ty, left, right, order), metas, args = equation in
+ let metasenv, context, ugraph = env in
+ let metasenv' = metasenv @ metas in
+ try
+ CicTypeChecker.type_of_aux' metasenv' context left ugraph;
+ CicTypeChecker.type_of_aux' metasenv' context right ugraph;
+ ()
+ with
+ CicUtil.Meta_not_found _ as exn ->
+ begin
+ prerr_endline msg;
+ prerr_endline (CicPp.ppterm left);
+ prerr_endline (CicPp.ppterm right);
+ raise exn
+ end
+*)
(* set to false to disable paramodulation inside auto_tac *)
let connect_to_auto = true;;
let demodulate table current =
let newmeta, newcurrent =
- let _ =
- let w, proof, (eq_ty, left, right, order), metas, args = current in
- let metasenv, context, ugraph = env in
- let metasenv' = metasenv @ metas in
- try
- CicTypeChecker.type_of_aux' metasenv' context left ugraph;
- CicTypeChecker.type_of_aux' metasenv' context right ugraph;
- with
- CicUtil.Meta_not_found _ as exn ->
- begin
- prerr_endline "siamo in forward_simplify";
- prerr_endline (CicPp.ppterm left);
- prerr_endline (CicPp.ppterm right);
- raise exn
- end
- in
Indexing.demodulation_equality !maxmeta env table sign current in
maxmeta := newmeta;
if is_identity env newcurrent then
let demodulate sign table target =
let newmeta, newtarget =
- let _ =
- let w, proof, (eq_ty, left, right, order), metas, args = target in
- let metasenv, context, ugraph = env in
- let metasenv' = metasenv @ metas in
- try
- CicTypeChecker.type_of_aux' metasenv' context left ugraph;
- CicTypeChecker.type_of_aux' metasenv' context right ugraph;
- with
- CicUtil.Meta_not_found _ as exn ->
- begin
- prerr_endline "siamo in forward_simplify_new";
- prerr_endline (CicPp.ppterm left);
- prerr_endline (CicPp.ppterm right);
- raise exn
- end
- in
Indexing.demodulation_equality !maxmeta env table sign target in
maxmeta := newmeta;
newtarget
let new_neg, new_pos =
let new_neg = List.map (demodulate Negative active_table) new_neg
and new_pos = List.map (demodulate Positive active_table) new_pos in
+ new_neg,new_pos
+
+(* PROVA
match passive_table with
| None -> new_neg, new_pos
| Some passive_table ->
List.map (demodulate Negative passive_table) new_neg,
- List.map (demodulate Positive passive_table) new_pos
+ List.map (demodulate Positive passive_table) new_pos *)
in
let t2 = Unix.gettimeofday () in
let _, context, goal = CicUtil.lookup_meta goal' metasenv in
let eq_indexes, equalities, maxm = find_equalities context proof in
let lib_eq_uris, library_equalities, maxm =
+
find_library_equalities dbd context (proof, goal') (maxm+2)
in
let library_equalities = List.map snd library_equalities in
raise (ProofEngineTypes.Fail
(lazy "Found a proof, but it doesn't typecheck"))
in
+ let tall = fs_time_info.build_all in
+ let tdemodulate = fs_time_info.demodulate in
+ let tsubsumption = fs_time_info.subsumption in
debug_print (lazy (Printf.sprintf "\nTIME NEEDED: %.9f" time));
+ debug_print (lazy (Printf.sprintf "\ntall: %.9f" tall));
+ debug_print (lazy (Printf.sprintf "\ntdemod: %.9f" tdemodulate));
+ debug_print (lazy (Printf.sprintf "\ntsubsumption: %.9f" tsubsumption));
+ debug_print (lazy (Printf.sprintf "\ninfer_time: %.9f" !infer_time));
+ debug_print (lazy (Printf.sprintf "\nforward_simpl_times: %.9f" !forward_simpl_time));
+ debug_print (lazy (Printf.sprintf "\nforward_simpl_new_times: %.9f" !forward_simpl_new_time));
+ debug_print (lazy (Printf.sprintf "\nbackward_simpl_times: %.9f" !backward_simpl_time));
+ debug_print (lazy (Printf.sprintf "\npassive_maintainance_time: %.9f" !passive_maintainance_time));
newstatus
| _ ->
raise (ProofEngineTypes.Fail (lazy "NO proof found"))