usage: matitaprover [options] problemfile";
let hypotheses, goals = Tptp_cnf.parse ~tptppath:!tptppath !problem_file in
let goal = match goals with [x] -> x | _ -> assert false in
+ let leaf_compare = ref (fun ((a,_) : leaf) ((b,_) : leaf) -> Pervasives.compare a b) in
let module B : Terms.Blob
with type t = leaf and type input = Ast.term = struct
type t = leaf
let eq a b = a == b
- let compare (a,_) (b,_) = Pervasives.compare a b
+ let compare a b = !leaf_compare a b
let eqP = hash "=="
let pp (_,a) = a
type input = Ast.term
end
in
- let module P = Paramod.Paramod(B) in
let module Pp = Pp.Pp(B) in
+ let module P = Paramod.Paramod(B) in
+ let success_msg bag l (pp : ?margin:int -> B.t Terms.unit_clause -> string)=
+ print_endline ("% SZS status Unsatisfiable for " ^
+ Filename.basename !problem_file);
+ print_endline ("% SZS output start CNFRefutation for " ^
+ Filename.basename !problem_file);
+ flush stdout;
+ List.iter (fun x ->
+ print_endline (pp ~margin:max_int
+ (fst(Terms.M.find x bag)))) l;
+ print_endline ("% SZS output end CNFRefutation for " ^
+ Filename.basename !problem_file)
+ in
let bag = Terms.M.empty, 0 in
let bag, g_passives = P.mk_goal bag goal in
let bag, passives =
List.iter (fun x -> prerr_endline (" " ^ Pp.pp_unit_clause x)) passives;
prerr_endline "Goal";
prerr_endline (" " ^ Pp.pp_unit_clause g_passives);
- (* let _ = Unix.alarm !seconds in *)
- match P.paramod ~timeout:(Unix.gettimeofday () +. float_of_int !seconds) ~max_steps:max_int bag ~g_passives:[g_passives] ~passives with
- | [] -> fail_msg ()
- | (bag,_,l)::_ ->
- print_endline ("% SZS status Unsatisfiable for " ^
- Filename.basename !problem_file);
- print_endline ("% SZS output start CNFRefutation for " ^
- Filename.basename !problem_file);
- flush stdout;
- List.iter (fun x ->
- print_endline (Pp.pp_unit_clause ~margin:max_int
- (fst(Terms.M.find x bag)))) l;
- print_endline ("% SZS output end CNFRefutation for " ^
- Filename.basename !problem_file);
+ let _ = Unix.alarm !seconds in
+ match
+ P.paramod
+ ~timeout:(Unix.gettimeofday () +. float_of_int (!seconds / 2) )
+ ~max_steps:max_int bag ~g_passives:[g_passives] ~passives
+ with
+ | [] ->
+ leaf_compare := (fun (_,a) (_,b) -> Pervasives.compare a b);
+ (match
+ P.paramod
+ ~timeout:(Unix.gettimeofday () +. float_of_int (!seconds / 2) )
+ ~max_steps:max_int bag ~g_passives:[g_passives] ~passives
+ with
+ | [] -> fail_msg ()
+ | (bag,_,l)::_ -> success_msg bag l Pp.pp_unit_clause)
+ | (bag,_,l)::_ -> success_msg bag l Pp.pp_unit_clause
;;
main ()