src/HOL/Tools/Sledgehammer/sledgehammer_prover_smt2.ML
changeset 56981 3ef45ce002b5
parent 56303 4cc3f4db3447
child 56983 132142089ea6
equal deleted inserted replaced
56980:9c5220e05e04 56981:3ef45ce002b5
   159           handle exn =>
   159           handle exn =>
   160             if Exn.is_interrupt exn orelse debug then
   160             if Exn.is_interrupt exn orelse debug then
   161               reraise exn
   161               reraise exn
   162             else
   162             else
   163               {outcome = SOME (SMT2_Failure.Other_Failure (Runtime.exn_message exn)),
   163               {outcome = SOME (SMT2_Failure.Other_Failure (Runtime.exn_message exn)),
   164                rewrite_rules = [], conjecture_id = ~1, helper_ids = [], fact_ids = [],
   164                rewrite_rules = [], conjecture_id = ~1, prem_ids = [], helper_ids = [],
   165                z3_proof = []}
   165                fact_ids = [], z3_proof = []}
   166 
   166 
   167         val death = Timer.checkRealTimer timer
   167         val death = Timer.checkRealTimer timer
   168         val outcome0 = if is_none outcome0 then SOME outcome else outcome0
   168         val outcome0 = if is_none outcome0 then SOME outcome else outcome0
   169         val time_so_far = Time.+ (time_so_far, Time.- (death, birth))
   169         val time_so_far = Time.+ (time_so_far, Time.- (death, birth))
   170         val timeout = Time.- (timeout, Timer.checkRealTimer timer)
   170         val timeout = Time.- (timeout, Timer.checkRealTimer timer)
   225       let val num_facts = length facts in
   225       let val num_facts = length facts in
   226         map (weight_smt2_fact ctxt num_facts) (facts ~~ (0 upto num_facts - 1))
   226         map (weight_smt2_fact ctxt num_facts) (facts ~~ (0 upto num_facts - 1))
   227       end
   227       end
   228 
   228 
   229     val weighted_factss = map (apsnd weight_facts) factss
   229     val weighted_factss = map (apsnd weight_facts) factss
   230     val {outcome, filter_result = {conjecture_id, rewrite_rules, helper_ids, fact_ids, z3_proof,
   230     val {outcome, filter_result = {rewrite_rules, conjecture_id, prem_ids, helper_ids, fact_ids,
   231            ...}, used_from, run_time} =
   231            z3_proof, ...}, used_from, run_time} =
   232       smt2_filter_loop name params state goal subgoal weighted_factss
   232       smt2_filter_loop name params state goal subgoal weighted_factss
   233     val used_named_facts = map snd fact_ids
   233     val used_named_facts = map snd fact_ids
   234     val used_facts = map fst used_named_facts
   234     val used_facts = map fst used_named_facts
   235     val outcome = Option.map failure_of_smt2_failure outcome
   235     val outcome = Option.map failure_of_smt2_failure outcome
   236 
   236 
   243          fn preplay =>
   243          fn preplay =>
   244             let
   244             let
   245               val fact_ids =
   245               val fact_ids =
   246                 map (fn (id, th) => (id, short_thm_name ctxt th)) helper_ids @
   246                 map (fn (id, th) => (id, short_thm_name ctxt th)) helper_ids @
   247                 map (fn (id, ((name, _), _)) => (id, name)) fact_ids
   247                 map (fn (id, ((name, _), _)) => (id, name)) fact_ids
   248               val atp_proof = Z3_New_Isar.atp_proof_of_z3_proof thy rewrite_rules conjecture_id
   248               val atp_proof = Z3_New_Isar.atp_proof_of_z3_proof thy rewrite_rules prem_ids conjecture_id
   249                 fact_ids z3_proof
   249                 fact_ids z3_proof
   250               val isar_params =
   250               val isar_params =
   251                 K (verbose, (NONE, NONE), preplay_timeout, compress_isar, try0_isar,
   251                 K (verbose, (NONE, NONE), preplay_timeout, compress_isar, try0_isar,
   252                    minimize <> SOME false, atp_proof, goal)
   252                    minimize <> SOME false, atp_proof, goal)
   253               val one_line_params =
   253               val one_line_params =