src/HOL/TPTP/atp_theory_export.ML
changeset 47038 2409b484e1cc
parent 46734 6256e064f8fa
child 47055 16e2633f3b4b
equal deleted inserted replaced
47037:ea6695d58aad 47038:2409b484e1cc
   116 
   116 
   117 fun run_some_atp ctxt format problem =
   117 fun run_some_atp ctxt format problem =
   118   let
   118   let
   119     val thy = Proof_Context.theory_of ctxt
   119     val thy = Proof_Context.theory_of ctxt
   120     val prob_file = File.tmp_path (Path.explode "prob.tptp")
   120     val prob_file = File.tmp_path (Path.explode "prob.tptp")
   121     val {exec, arguments, proof_delims, known_failures, ...} =
   121     val atp = case format of DFG _ => spass_newN | _ => eN
   122       get_atp thy (case format of DFG _ => spassN | _ => eN)
   122     val {exec, arguments, proof_delims, known_failures, ...} = get_atp thy atp
   123     val _ = problem |> lines_for_atp_problem format (K [])
   123     val ord = effective_term_order ctxt atp
       
   124     val _ = problem |> lines_for_atp_problem format ord (K [])
   124                     |> File.write_list prob_file
   125                     |> File.write_list prob_file
   125     val command =
   126     val command =
   126       File.shell_path (Path.explode (getenv (fst exec) ^ "/" ^ snd exec)) ^
   127       File.shell_path (Path.explode (getenv (fst exec) ^ "/" ^ snd exec)) ^
   127       " " ^ arguments ctxt false "" (seconds 1.0) (K []) ^ " " ^
   128       " " ^ arguments ctxt false "" (seconds 1.0) (ord, K [], K []) ^ " " ^
   128       File.shell_path prob_file
   129       File.shell_path prob_file
   129   in
   130   in
   130     TimeLimit.timeLimit (seconds 0.3) Isabelle_System.bash_output command
   131     TimeLimit.timeLimit (seconds 0.3) Isabelle_System.bash_output command
   131     |> fst
   132     |> fst
   132     |> extract_tstplike_proof_and_outcome false true proof_delims
   133     |> extract_tstplike_proof_and_outcome false true proof_delims known_failures
   133                                           known_failures
       
   134     |> snd
   134     |> snd
   135   end
   135   end
   136   handle TimeLimit.TimeOut => SOME TimedOut
   136   handle TimeLimit.TimeOut => SOME TimedOut
   137 
   137 
   138 val likely_tautology_prefixes =
   138 val likely_tautology_prefixes =
   212     val name_ord = int_ord o pairself (the o Symtab.lookup order_tab)
   212     val name_ord = int_ord o pairself (the o Symtab.lookup order_tab)
   213     val atp_problem =
   213     val atp_problem =
   214       atp_problem
   214       atp_problem
   215       |> (case format of DFG _ => I | _ => add_inferences_to_problem infers)
   215       |> (case format of DFG _ => I | _ => add_inferences_to_problem infers)
   216       |> order_problem_facts name_ord
   216       |> order_problem_facts name_ord
   217     val ss = lines_for_atp_problem format (K []) atp_problem
   217     val ord = effective_term_order ctxt eN (* dummy *)
       
   218     val ss = lines_for_atp_problem format ord (K []) atp_problem
   218     val _ = app (File.append path) ss
   219     val _ = app (File.append path) ss
   219   in () end
   220   in () end
   220 
   221 
   221 end;
   222 end;