src/HOL/Tools/res_atp.ML
changeset 16767 2d4433759b8d
parent 16741 7a6c17b826c0
child 16802 6eeee59dac4c
equal deleted inserted replaced
16766:ea667a5426fe 16767:2d4433759b8d
   111 
   111 
   112 (*********************************************************************)
   112 (*********************************************************************)
   113 (* convert clauses from "assume" to conjecture. write to file "hyps" *)
   113 (* convert clauses from "assume" to conjecture. write to file "hyps" *)
   114 (* hypotheses of the goal currently being proved                     *)
   114 (* hypotheses of the goal currently being proved                     *)
   115 (*********************************************************************)
   115 (*********************************************************************)
   116 
   116 (*perhaps have 2 different versions of this, depending on whether or not SpassComm.spass is set *)
   117 fun isar_atp_h thms =
   117 fun isar_atp_h thms =
   118         
   118         
   119     let val prems = map (skolemize o make_nnf o ObjectLogic.atomize_thm) thms
   119     let val prems = map (skolemize o make_nnf o ObjectLogic.atomize_thm) thms
   120         val prems' = map repeat_someI_ex prems
   120         val prems' = map repeat_someI_ex prems
   121         val prems'' = make_clauses prems'
   121         val prems'' = make_clauses prems'
   122         val prems''' = ResAxioms.rm_Eps [] prems''
   122         val prems''' = ResAxioms.rm_Eps [] prems''
   123         val clss = map ResClause.make_conjecture_clause prems'''
   123         val clss = map ResClause.make_conjecture_clause prems'''
   124 	val (tptp_clss,tfree_litss) = ListPair.unzip (map ResClause.clause2tptp clss) 
   124 	val (tptp_clss,tfree_litss) = ListPair.unzip (map ResClause.clause2tptp clss) 
   125 	val tfree_lits = ResLib.flat_noDup tfree_litss
   125 	val tfree_lits = ResLib.flat_noDup tfree_litss
       
   126         (* tfree clause is different in tptp and dfg versions *)
   126 	val tfree_clss = map ResClause.tfree_clause tfree_lits 
   127 	val tfree_clss = map ResClause.tfree_clause tfree_lits 
   127         val hypsfile = File.platform_path hyps_file
   128         val hypsfile = File.platform_path hyps_file
   128 	val out = TextIO.openOut(hypsfile)
   129 	val out = TextIO.openOut(hypsfile)
   129     in
   130     in
   130 	((ResLib.writeln_strs out (tfree_clss @ tptp_clss); TextIO.closeOut out; if !trace_res then (warning hypsfile) else ());tfree_lits) 
   131 	((ResLib.writeln_strs out (tfree_clss @ tptp_clss); TextIO.closeOut out; if !trace_res then (warning hypsfile) else ());tfree_lits) 
   149     in
   150     in
   150 	(ResLib.writeln_strs out (tfree_clss @ tptp_clss); TextIO.closeOut out; (if !trace_res then (warning probfile) else ()))
   151 	(ResLib.writeln_strs out (tfree_clss @ tptp_clss); TextIO.closeOut out; (if !trace_res then (warning probfile) else ()))
   151     end;
   152     end;
   152 
   153 
   153 
   154 
       
   155 (*********************************************************************)
       
   156 (* write out a subgoal as DFG clauses to the file "probN"           *)
       
   157 (* where N is the number of this subgoal                             *)
       
   158 (*********************************************************************)
       
   159 (*
       
   160 fun dfg_inputs_tfrees thms n tfrees = 
       
   161     let val _ = (warning ("in dfg_inputs_tfrees 0"))
       
   162         val clss = map (ResClause.make_conjecture_clause_thm) thms
       
   163          val _ = (warning ("in dfg_inputs_tfrees 1"))
       
   164 	val (dfg_clss,tfree_litss) = ListPair.unzip (map ResClause.clause2dfg clss)
       
   165         val _ = (warning ("in dfg_inputs_tfrees 2"))
       
   166 	val tfree_clss = map ResClause.tfree_clause ((ResLib.flat_noDup tfree_litss) \\ tfrees) 
       
   167          val _ = (warning ("in dfg_inputs_tfrees 3"))
       
   168         val probfile = (File.platform_path prob_file) ^ "_" ^ (string_of_int n)
       
   169 	val out = TextIO.openOut(probfile)
       
   170     in
       
   171 	(ResLib.writeln_strs out (tfree_clss @ dfg_clss); TextIO.closeOut out; (if !trace_res then (warning probfile) else ()))
       
   172     end;*)
   154 
   173 
   155 (*********************************************************************)
   174 (*********************************************************************)
   156 (* call SPASS with settings and problem file for the current subgoal *)
   175 (* call SPASS with settings and problem file for the current subgoal *)
   157 (* should be modified to allow other provers to be called            *)
   176 (* should be modified to allow other provers to be called            *)
   158 (*********************************************************************)
   177 (*********************************************************************)