src/HOL/Tools/Sledgehammer/sledgehammer_prover_atp.ML
changeset 57738 25d1495e6641
parent 57735 056a55b44ec7
child 57739 b6af899a78ac
equal deleted inserted replaced
57737:72d4c00064af 57738:25d1495e6641
   125 
   125 
   126 (* Give the ATPs some slack before interrupting them the hard way. "z3_tptp" on Linux appears to be
   126 (* Give the ATPs some slack before interrupting them the hard way. "z3_tptp" on Linux appears to be
   127    the only ATP that does not honor its time limit. *)
   127    the only ATP that does not honor its time limit. *)
   128 val atp_timeout_slack = seconds 1.0
   128 val atp_timeout_slack = seconds 1.0
   129 
   129 
   130 (* Important messages are important but not so important that users want to see
   130 (* Important messages are important but not so important that users want to see them each time. *)
   131    them each time. *)
       
   132 val atp_important_message_keep_quotient = 25
   131 val atp_important_message_keep_quotient = 25
   133 
   132 
   134 fun run_atp mode name
   133 fun run_atp mode name
   135     ({debug, verbose, overlord, type_enc, strict, lam_trans, uncurried_aliases, fact_filter,
   134     ({debug, verbose, overlord, type_enc, strict, lam_trans, uncurried_aliases, fact_filter,
   136      max_facts, max_mono_iters, max_new_mono_instances, isar_proofs, compress, try0, smt_proofs,
   135      max_facts, max_mono_iters, max_new_mono_instances, isar_proofs, compress, try0, smt_proofs,
   352       if mode = Normal andalso random_range 0 (atp_important_message_keep_quotient - 1) = 0 then
   351       if mode = Normal andalso random_range 0 (atp_important_message_keep_quotient - 1) = 0 then
   353         extract_important_message output
   352         extract_important_message output
   354       else
   353       else
   355         ""
   354         ""
   356 
   355 
   357     val (used_facts, preferred_methss, message, message_tail) =
   356     val (used_facts, preferred_methss, message) =
   358       (case outcome of
   357       (case outcome of
   359         NONE =>
   358         NONE =>
   360         let
   359         let
   361           val used_facts = used_facts_in_atp_proof ctxt (map fst used_from) atp_proof
   360           val used_facts = used_facts_in_atp_proof ctxt (map fst used_from) atp_proof
   362           val needs_full_types = is_typed_helper_used_in_atp_proof atp_proof
   361           val needs_full_types = is_typed_helper_used_in_atp_proof atp_proof
   388 
   387 
   389                 val one_line_params =
   388                 val one_line_params =
   390                   (preplay, proof_banner mode name, used_facts, subgoal, subgoal_count)
   389                   (preplay, proof_banner mode name, used_facts, subgoal, subgoal_count)
   391                 val num_chained = length (#facts (Proof.goal state))
   390                 val num_chained = length (#facts (Proof.goal state))
   392               in
   391               in
   393                 proof_text ctxt debug isar_proofs smt_proofs isar_params num_chained one_line_params
   392                 proof_text ctxt debug isar_proofs smt_proofs isar_params num_chained
   394               end,
   393                   one_line_params ^
   395            (if verbose then "\nATP real CPU time: " ^ string_of_time run_time ^ "." else "") ^
   394                 (if important_message <> "" then
   396            (if important_message <> "" then
   395                    "\n\nImportant message from Dr. Geoff Sutcliffe:\n" ^ important_message
   397               "\n\nImportant message from Dr. Geoff Sutcliffe:\n" ^ important_message
   396                  else
   398             else
   397                    "")
   399               ""))
   398               end)
   400         end
   399         end
   401       | SOME failure =>
   400       | SOME failure =>
   402         ([], (Auto_Method (* dummy *), []), fn _ => string_of_atp_failure failure, ""))
   401         ([], (Auto_Method (* dummy *), []), fn _ => string_of_atp_failure failure))
   403   in
   402   in
   404     {outcome = outcome, used_facts = used_facts, used_from = used_from,
   403     {outcome = outcome, used_facts = used_facts, used_from = used_from,
   405      preferred_methss = preferred_methss, run_time = run_time, message = message,
   404      preferred_methss = preferred_methss, run_time = run_time, message = message}
   406      message_tail = message_tail}
       
   407   end
   405   end
   408 
   406 
   409 end;
   407 end;