src/HOL/Tools/SMT/z3_replay.ML
changeset 58482 7836013951e6
parent 58061 3d060f43accb
child 59213 ef5e68575bc4
equal deleted inserted replaced
58481:62bc7c79212b 58482:7836013951e6
   184     val prems_i = 1
   184     val prems_i = 1
   185     val facts_i = prems_i + length prems
   185     val facts_i = prems_i + length prems
   186 
   186 
   187     val conjecture_id = id_of_index conjecture_i
   187     val conjecture_id = id_of_index conjecture_i
   188     val prem_ids = map id_of_index (prems_i upto facts_i - 1)
   188     val prem_ids = map id_of_index (prems_i upto facts_i - 1)
   189     val helper_ids = map_filter (try (fn (~1, idth) => idth)) iidths
   189     val fact_ids' =
   190     val fact_ids = map_filter (fn (i, (id, _)) => try (apsnd (nth xfacts)) (id, i - facts_i)) iidths
   190       map_filter (fn (i, (id, _)) => try (apsnd (nth xfacts)) (id, i - facts_i)) iidths
       
   191     val helper_ids' = map_filter (try (fn (~1, idth) => idth)) iidths
       
   192 
   191     val fact_helper_ts =
   193     val fact_helper_ts =
   192       map (fn (_, th) => (ATP_Util.short_thm_name ctxt th, prop_of th)) helper_ids @
   194       map (fn (_, th) => (ATP_Util.short_thm_name ctxt th, prop_of th)) helper_ids' @
   193       map (fn (_, ((s, _), th)) => (s, prop_of th)) fact_ids
   195       map (fn (_, ((s, _), th)) => (s, prop_of th)) fact_ids'
   194     val fact_helper_ids =
   196     val fact_helper_ids' =
   195       map (apsnd (ATP_Util.short_thm_name ctxt)) helper_ids @ map (apsnd (fst o fst)) fact_ids
   197       map (apsnd (ATP_Util.short_thm_name ctxt)) helper_ids' @ map (apsnd (fst o fst)) fact_ids'
   196   in
   198   in
   197     {outcome = NONE, fact_ids = fact_ids,
   199     {outcome = NONE, fact_ids = fact_ids',
   198      atp_proof = fn () => Z3_Isar.atp_proof_of_z3_proof ctxt ll_defs rewrite_rules prems concl
   200      atp_proof = fn () => Z3_Isar.atp_proof_of_z3_proof ctxt ll_defs rewrite_rules prems concl
   199        fact_helper_ts prem_ids conjecture_id fact_helper_ids steps}
   201        fact_helper_ts prem_ids conjecture_id fact_helper_ids' steps}
   200   end
   202   end
   201 
   203 
   202 fun replay outer_ctxt
   204 fun replay outer_ctxt
   203     ({context = ctxt, typs, terms, rewrite_rules, assms, ...} : SMT_Translate.replay_data) output =
   205     ({context = ctxt, typs, terms, rewrite_rules, assms, ...} : SMT_Translate.replay_data) output =
   204   let
   206   let