src/HOL/Tools/Sledgehammer/sledgehammer_prover_atp.ML
changeset 57776 1111a9a328fe
parent 57750 670cbec816b9
child 57778 cf4215911f85
equal deleted inserted replaced
57775:40eea08c0cc5 57776:1111a9a328fe
   292             val ((output, run_time), (atp_proof, outcome)) =
   292             val ((output, run_time), (atp_proof, outcome)) =
   293               TimeLimit.timeLimit generous_slice_timeout Isabelle_System.bash_output command
   293               TimeLimit.timeLimit generous_slice_timeout Isabelle_System.bash_output command
   294               |>> (if overlord then prefix ("% " ^ command ^ "\n% " ^ timestamp () ^ "\n") else I)
   294               |>> (if overlord then prefix ("% " ^ command ^ "\n% " ^ timestamp () ^ "\n") else I)
   295               |> fst |> split_time
   295               |> fst |> split_time
   296               |> (fn accum as (output, _) =>
   296               |> (fn accum as (output, _) =>
   297                      (accum,
   297                 (accum,
   298                       extract_tstplike_proof_and_outcome verbose proof_delims known_failures output
   298                  extract_tstplike_proof_and_outcome verbose proof_delims known_failures output
   299                       |>> atp_proof_of_tstplike_proof (perhaps (try (unprefix remote_prefix)) name) atp_problem
   299                  |>> atp_proof_of_tstplike_proof (perhaps (try (unprefix remote_prefix)) name)
   300                       handle UNRECOGNIZED_ATP_PROOF () => ([], SOME ProofUnparsable)))
   300                    atp_problem
       
   301                  handle UNRECOGNIZED_ATP_PROOF () => ([], SOME ProofUnparsable)))
   301               handle TimeLimit.TimeOut => (("", slice_timeout), ([], SOME TimedOut))
   302               handle TimeLimit.TimeOut => (("", slice_timeout), ([], SOME TimedOut))
   302 
   303 
   303             val outcome =
   304             val outcome =
   304               (case outcome of
   305               (case outcome of
   305                 NONE =>
   306                 NONE =>
   306                 (case used_facts_in_unsound_atp_proof ctxt (map fst facts) atp_proof
   307                 (case used_facts_in_unsound_atp_proof ctxt (map fst facts) atp_proof of
   307                       |> Option.map (sort string_ord) of
       
   308                   SOME facts =>
   308                   SOME facts =>
   309                   let val failure = UnsoundProof (is_type_enc_sound type_enc, facts) in
   309                   let
       
   310                     val failure = UnsoundProof (is_type_enc_sound type_enc, sort string_ord facts)
       
   311                   in
   310                     if debug then (warning (string_of_atp_failure failure); NONE) else SOME failure
   312                     if debug then (warning (string_of_atp_failure failure); NONE) else SOME failure
   311                   end
   313                   end
   312                 | NONE => NONE)
   314                 | NONE => NONE)
   313               | _ => outcome)
   315               | _ => outcome)
   314           in
   316           in
   355 
   357 
   356     val (used_facts, preferred_methss, message) =
   358     val (used_facts, preferred_methss, message) =
   357       (case outcome of
   359       (case outcome of
   358         NONE =>
   360         NONE =>
   359         let
   361         let
   360           val used_facts = used_facts_in_atp_proof ctxt (map fst used_from) atp_proof
   362           val used_facts = sort_wrt fst (used_facts_in_atp_proof ctxt (map fst used_from) atp_proof)
   361           val needs_full_types = is_typed_helper_used_in_atp_proof atp_proof
   363           val needs_full_types = is_typed_helper_used_in_atp_proof atp_proof
   362           val preferred_methss =
   364           val preferred_methss =
   363             bunches_of_proof_methods try0 (smt_proofs <> SOME false) needs_full_types
   365             bunches_of_proof_methods try0 (smt_proofs <> SOME false) needs_full_types
   364               (if atp_proof_prefers_lifting atp_proof then liftingN else hide_lamsN)
   366               (if atp_proof_prefers_lifting atp_proof then liftingN else hide_lamsN)
   365             |> `(hd o hd)
   367             |> `(hd o hd)