* http://cs.unibo.it/helm/.
*)
+let debug_print = fun _ -> ()
+
(* Da rimuovere, solo per debug*)
let print_context ctx =
let print_name =
Some (ey, ty) ->
(* the goal is still there *)
(*
- prerr_endline ("CURRENT GOAL = " ^ (CicPp.ppterm ty));
- prerr_endline ("CURRENT PROOF = " ^ (CicPp.ppterm p));
- prerr_endline ("CURRENT HYP = " ^ (fst (print_context ey)));
+ debug_print ("CURRENT GOAL = " ^ (CicPp.ppterm ty));
+ debug_print ("CURRENT PROOF = " ^ (CicPp.ppterm p));
+ debug_print ("CURRENT HYP = " ^ (fst (print_context ey)));
*)
(* if the goal contains metavariables we use the input
signature for at_most constraints *)
let auto_tac ?num ~(dbd:Mysql.dbd) =
let auto_tac dbh (proof,goal) =
- prerr_endline "Entro in Auto";
+ debug_print "Entro in Auto";
match (auto dbd [(proof, [(goal,depth)],None)]) with
- [] -> prerr_endline("Auto failed");
+ [] -> debug_print("Auto failed");
raise (ProofEngineTypes.Fail "No Applicable theorem")
| (proof,[],_)::_ ->
- prerr_endline "AUTO_TAC HA FINITO";
+ debug_print "AUTO_TAC HA FINITO";
(proof,[])
| _ -> assert false
in
match exitus with
Yes (bo,_) ->
(*
- prerr_endline "ALREADY PROVED!!!!!!!!!!!!!!!!!!!!!!!!!!!!";
- prerr_endline (CicPp.ppterm ty);
+ debug_print "ALREADY PROVED!!!!!!!!!!!!!!!!!!!!!!!!!!!!";
+ debug_print (CicPp.ppterm ty);
*)
let subst_in =
(* if we just apply the subtitution, the type
proof goal subst_in metasenv in
[(subst_in,(proof,[],sign))]
| No d when (d >= depth) ->
- (* prerr_endline "PRUNED!!!!!!!!!!!!!!!!!!!!!!!!!!!!"; *)
+ (* debug_print "PRUNED!!!!!!!!!!!!!!!!!!!!!!!!!!!!"; *)
[] (* the empty list means no choices, i.e. failure *)
| No _
| NotYetInspected ->
(*
- prerr_endline ("CURRENT GOAL = " ^ (CicPp.ppterm ty));
- prerr_endline ("CURRENT PROOF = " ^ (CicPp.ppterm p));
- prerr_endline ("CURRENT HYP = " ^ (fst (print_context ey)));
+ debug_print ("CURRENT GOAL = " ^ (CicPp.ppterm ty));
+ debug_print ("CURRENT PROOF = " ^ (CicPp.ppterm p));
+ debug_print ("CURRENT HYP = " ^ (fst (print_context ey)));
*)
let sign, new_sign =
if is_meta_closed then
in
if not (cty = ty) then
begin
- prerr_endline ("ty = "^CicPp.ppterm ty);
- prerr_endline ("cty = "^CicPp.ppterm cty);
+ debug_print ("ty = "^CicPp.ppterm ty);
+ debug_print ("cty = "^CicPp.ppterm cty);
assert false
end
Hashtbl.add inspected_goals
let maxdepthgoals = reorder_goals dbd sign proof maxdepthgoals in
let len2 = List.length maxdepthgoals in
match maxdepthgoals with
- [] -> prerr_endline
+ [] -> debug_print
("caso sospetto " ^ (string_of_int (List.length othergoals)) ^ " " ^ string_of_int depth);
auto_new dbd
width already_seen_goals((subst,(proof, othergoals, sign))::tl)
auto_new dbd width already_seen_goals all_choices
| _ -> assert false
end
- | None -> prerr_endline "caso none";
+ | None -> debug_print "caso none";
auto_new
dbd width already_seen_goals ((subst,(proof, gtl, sign))::tl)
end
let auto_tac_new ~(dbd:Mysql.dbd) =
let auto_tac dbd (proof,goal) =
Hashtbl.clear inspected_goals;
- prerr_endline "Entro in Auto";
+ debug_print "Entro in Auto";
let id t = t in
match (auto_new dbd width [] [id,(proof, [(goal,depth)],None)]) with
- [] -> prerr_endline("Auto failed");
+ [] -> debug_print("Auto failed");
raise (ProofEngineTypes.Fail "No Applicable theorem")
| (_,(proof,[],_))::_ ->
- prerr_endline "AUTO_TAC HA FINITO";
+ debug_print "AUTO_TAC HA FINITO";
let _,_,p,_ = proof in
- prerr_endline (CicPp.ppterm p);
+ debug_print (CicPp.ppterm p);
(proof,[])
| _ -> assert false
in