src/HOL/Tools/res_atp.ML
changeset 21999 0cf192e489e2
parent 21980 d22f7e3c5ad9
child 22012 adf68479ae1b
equal deleted inserted replaced
21998:aa2764dda077 21999:0cf192e489e2
   821 
   821 
   822 fun trace_vector fname =
   822 fun trace_vector fname =
   823   let val path = File.explode_platform_path fname
   823   let val path = File.explode_platform_path fname
   824   in  Vector.app (File.append path o (fn s => s ^ "\n"))  end;
   824   in  Vector.app (File.append path o (fn s => s ^ "\n"))  end;
   825 
   825 
   826 (*Converting a subgoal into negated conjecture clauses*)
       
   827 fun neg_clauses th n =
       
   828   let val tacs = [rtac ccontr, ObjectLogic.atomize_tac, skolemize_tac]
       
   829       val st = Seq.hd (EVERY' tacs n th)
       
   830       val negs = Option.valOf (metahyps_thms n st)
       
   831   in make_clauses negs |> ResAxioms.assume_abstract_list |> Meson.finish_cnf end;
       
   832 
       
   833 (*We write out problem files for each subgoal. Argument probfile generates filenames,
   826 (*We write out problem files for each subgoal. Argument probfile generates filenames,
   834   and allows the suppression of the suffix "_1" in problem-generation mode.
   827   and allows the suppression of the suffix "_1" in problem-generation mode.
   835   FIXME: does not cope with &&, and it isn't easy because one could have multiple
   828   FIXME: does not cope with &&, and it isn't easy because one could have multiple
   836   subgoals, each involving &&.*)
   829   subgoals, each involving &&.*)
   837 fun write_problem_files probfile (ctxt,th)  =
   830 fun write_problem_files probfile (ctxt,th)  =
   838   let val goals = Thm.prems_of th
   831   let val goals = Thm.prems_of th
   839       val _ = Output.debug ("number of subgoals = " ^ Int.toString (length goals))
   832       val _ = Output.debug ("number of subgoals = " ^ Int.toString (length goals))
   840       val thy = ProofContext.theory_of ctxt
   833       val thy = ProofContext.theory_of ctxt
   841       fun get_neg_subgoals [] _ = []
   834       fun get_neg_subgoals [] _ = []
   842         | get_neg_subgoals (gl::gls) n = neg_clauses th n :: get_neg_subgoals gls (n+1)
   835         | get_neg_subgoals (gl::gls) n = #1 (ResAxioms.neg_conjecture_clauses th n) :: 
       
   836                                          get_neg_subgoals gls (n+1)
   843       val goal_cls = get_neg_subgoals goals 1
   837       val goal_cls = get_neg_subgoals goals 1
   844       val logic = case !linkup_logic_mode of
   838       val logic = case !linkup_logic_mode of
   845                 Auto => problem_logic_goals (map ((map prop_of)) goal_cls)
   839                 Auto => problem_logic_goals (map ((map prop_of)) goal_cls)
   846               | Fol => FOL
   840               | Fol => FOL
   847               | Hol => HOL
   841               | Hol => HOL