src/HOL/Tools/Sledgehammer/sledgehammer_reconstruct.ML
changeset 51165 58f8716b04ee
parent 51164 eba05aaa8612
child 51178 06689dbfe072
equal deleted inserted replaced
51164:eba05aaa8612 51165:58f8716b04ee
   720                    Library.foldr1 s_disj pos)
   720                    Library.foldr1 s_disj pos)
   721               | _ => fold (curry s_disj) lits @{term False}
   721               | _ => fold (curry s_disj) lits @{term False}
   722             end
   722             end
   723             |> HOLogic.mk_Trueprop |> close_form
   723             |> HOLogic.mk_Trueprop |> close_form
   724         fun isar_proof_of_direct_proof outer accum [] =
   724         fun isar_proof_of_direct_proof outer accum [] =
   725             rev accum |> outer ? append assms
   725             rev accum |> outer ? (append assms
       
   726                                   #> not (null params) ? cons (Fix params))
   726           | isar_proof_of_direct_proof outer accum (inf :: infs) =
   727           | isar_proof_of_direct_proof outer accum (inf :: infs) =
   727             let
   728             let
   728               fun maybe_show outer c =
   729               fun maybe_show outer c =
   729                 (outer andalso length c = 1 andalso subset (op =) (c, conjs))
   730                 (outer andalso length c = 1 andalso subset (op =) (c, conjs))
   730                 ? cons Show
   731                 ? cons Show
   777                   do_rest (Prove (maybe_show outer c [Ultimately],
   778                   do_rest (Prove (maybe_show outer c [Ultimately],
   778                                   label_of_clause c, prop_of_clause c,
   779                                   label_of_clause c, prop_of_clause c,
   779                                   Case_Split (map do_case cases)))
   780                                   Case_Split (map do_case cases)))
   780                 end
   781                 end
   781             end
   782             end
       
   783         val cleanup_labels_in_proof =
       
   784           chain_direct_proof
       
   785           #> kill_useless_labels_in_proof
       
   786           #> relabel_proof
   782         val (isar_proof, (preplay_fail, preplay_time)) =
   787         val (isar_proof, (preplay_fail, preplay_time)) =
   783           refute_graph
   788           refute_graph
   784           |> redirect_graph axioms tainted bot
   789           |> redirect_graph axioms tainted bot
   785           |> isar_proof_of_direct_proof true []
   790           |> isar_proof_of_direct_proof true []
   786           |> (if not preplay andalso isar_compress <= 1.0 then
   791           |> (if not preplay andalso isar_compress <= 1.0 then
   787                 rpair (false, (true, seconds 0.0))
   792                 rpair (false, (true, seconds 0.0))
   788               else
   793               else
   789                 compress_proof debug ctxt type_enc lam_trans preplay
   794                 compress_proof debug ctxt type_enc lam_trans preplay
   790                   preplay_timeout
   795                   preplay_timeout
   791                   (if isar_proofs then isar_compress else 1000.0))
   796                   (if isar_proofs then isar_compress else 1000.0))
   792           |>> (chain_direct_proof
   797           |>> cleanup_labels_in_proof
   793                #> kill_useless_labels_in_proof
       
   794                #> relabel_proof
       
   795                #> not (null params) ? cons (Fix params))
       
   796         val isar_text =
   798         val isar_text =
   797           string_for_proof ctxt type_enc lam_trans subgoal subgoal_count
   799           string_for_proof ctxt type_enc lam_trans subgoal subgoal_count
   798                            isar_proof
   800                            isar_proof
   799       in
   801       in
   800         case isar_text of
   802         case isar_text of