src/HOL/Tools/atp_wrapper.ML
changeset 31840 beeaa1ed1f47
parent 31838 607a984b70e3
child 32091 30e2ffbba718
equal deleted inserted replaced
31839:26f18ec0e293 31840:beeaa1ed1f47
    73         | SOME axcls => axcls
    73         | SOME axcls => axcls
    74     val (thm_names, clauses) = preparer goal_cls chain_ths the_axiom_clauses the_filtered_clauses thy
    74     val (thm_names, clauses) = preparer goal_cls chain_ths the_axiom_clauses the_filtered_clauses thy
    75 
    75 
    76     (* write out problem file and call prover *)
    76     (* write out problem file and call prover *)
    77     val probfile = prob_pathname subgoalno
    77     val probfile = prob_pathname subgoalno
    78     val _ = writer probfile clauses
    78     val conj_pos = writer probfile clauses
    79     val (proof, rc) = system_out (
    79     val (proof, rc) = system_out (
    80       if File.exists cmd then
    80       if File.exists cmd then
    81         space_implode " " ["exec", File.shell_path cmd, args, File.platform_path probfile]
    81         space_implode " " ["exec", File.shell_path cmd, args, File.platform_path probfile]
    82       else error ("Bad executable: " ^ Path.implode cmd))
    82       else error ("Bad executable: " ^ Path.implode cmd))
    83 
    83 
    90     val failure = find_failure proof
    90     val failure = find_failure proof
    91     val success = rc = 0 andalso is_none failure
    91     val success = rc = 0 andalso is_none failure
    92     val message =
    92     val message =
    93       if is_some failure then "External prover failed."
    93       if is_some failure then "External prover failed."
    94       else if rc <> 0 then "External prover failed: " ^ proof
    94       else if rc <> 0 then "External prover failed: " ^ proof
    95       else "Try this command: " ^ produce_answer name (proof, thm_names, ctxt, th, subgoalno)
    95       else "Try this command: " ^
       
    96         produce_answer name (proof, thm_names, conj_pos, ctxt, th, subgoalno)
    96     val _ = Output.debug (fn () => "Sledgehammer response (rc = " ^ string_of_int rc ^ "):\n" ^ proof)
    97     val _ = Output.debug (fn () => "Sledgehammer response (rc = " ^ string_of_int rc ^ "):\n" ^ proof)
    97   in (success, message, proof, thm_names, the_filtered_clauses) end;
    98   in (success, message, proof, thm_names, the_filtered_clauses) end;
    98 
    99 
    99 
   100 
   100 
   101 
   107   (ResAtp.get_relevant max_new theory_const)
   108   (ResAtp.get_relevant max_new theory_const)
   108   (ResAtp.prepare_clauses false)
   109   (ResAtp.prepare_clauses false)
   109   (ResHolClause.tptp_write_file (AtpManager.get_full_types()))
   110   (ResHolClause.tptp_write_file (AtpManager.get_full_types()))
   110   command
   111   command
   111   ResReconstruct.find_failure
   112   ResReconstruct.find_failure
   112   (if full then ResReconstruct.structured_proof else ResReconstruct.lemma_list_tstp)
   113   (if full then ResReconstruct.structured_proof else ResReconstruct.lemma_list false)
   113   timeout ax_clauses fcls name n goal;
   114   timeout ax_clauses fcls name n goal;
   114 
   115 
   115 (*arbitrary ATP with TPTP input/output and problemfile as last argument*)
   116 (*arbitrary ATP with TPTP input/output and problemfile as last argument*)
   116 fun tptp_prover_opts max_new theory_const =
   117 fun tptp_prover_opts max_new theory_const =
   117   tptp_prover_opts_full max_new theory_const false;
   118   tptp_prover_opts_full max_new theory_const false;
   172   (ResAtp.prepare_clauses true)
   173   (ResAtp.prepare_clauses true)
   173   (ResHolClause.dfg_write_file (AtpManager.get_full_types()))
   174   (ResHolClause.dfg_write_file (AtpManager.get_full_types()))
   174   (Path.explode "$SPASS_HOME/SPASS",
   175   (Path.explode "$SPASS_HOME/SPASS",
   175     "-Auto -SOS=1 -PGiven=0 -PProblem=0 -Splits=0 -FullRed=0 -DocProof -TimeLimit=" ^ string_of_int timeout)
   176     "-Auto -SOS=1 -PGiven=0 -PProblem=0 -Splits=0 -FullRed=0 -DocProof -TimeLimit=" ^ string_of_int timeout)
   176   ResReconstruct.find_failure
   177   ResReconstruct.find_failure
   177   ResReconstruct.lemma_list_dfg
   178   (ResReconstruct.lemma_list true)
   178   timeout ax_clauses fcls name n goal;
   179   timeout ax_clauses fcls name n goal;
   179 
   180 
   180 val spass = spass_opts 40 true;
   181 val spass = spass_opts 40 true;
   181 
   182 
   182 
   183