src/HOL/Tools/Sledgehammer/sledgehammer_isar.ML
changeset 57765 f1108245ba11
parent 57763 e913a87bd5d2
child 57767 5bc204ca27ce
equal deleted inserted replaced
57764:cac309e2b1f7 57765:f1108245ba11
   208                       I))))
   208                       I))))
   209             atp_proof
   209             atp_proof
   210 
   210 
   211         val rule_of_clause_id = fst o the o Symtab.lookup steps o fst
   211         val rule_of_clause_id = fst o the o Symtab.lookup steps o fst
   212 
   212 
   213         fun prop_of_clause [(num, _)] = Symtab.lookup steps num |> the |> snd |> close_form
   213         val close_form_etc = rename_bound_vars o close_form
       
   214 
       
   215         fun prop_of_clause [(num, _)] = Symtab.lookup steps num |> the |> snd |> close_form_etc
   214           | prop_of_clause names =
   216           | prop_of_clause names =
   215             let
   217             let
   216               val lits = map (HOLogic.dest_Trueprop o snd)
   218               val lits =
   217                 (map_filter (Symtab.lookup steps o fst) names)
   219                 map (HOLogic.dest_Trueprop o snd) (map_filter (Symtab.lookup steps o fst) names)
   218             in
   220             in
   219               (case List.partition (can HOLogic.dest_not) lits of
   221               (case List.partition (can HOLogic.dest_not) lits of
   220                 (negs as _ :: _, pos as _ :: _) =>
   222                 (negs as _ :: _, pos as _ :: _) =>
   221                 s_imp (Library.foldr1 s_conj (map HOLogic.dest_not negs), Library.foldr1 s_disj pos)
   223                 s_imp (Library.foldr1 s_conj (map HOLogic.dest_not negs), Library.foldr1 s_disj pos)
   222               | _ => fold (curry s_disj) lits @{term False})
   224               | _ => fold (curry s_disj) lits @{term False})
   223             end
   225             end
   224             |> HOLogic.mk_Trueprop |> close_form
   226             |> HOLogic.mk_Trueprop |> close_form_etc
   225 
   227 
   226         fun maybe_show outer c = (outer andalso eq_set (op =) (c, conjs)) ? cons Show
   228         fun maybe_show outer c = (outer andalso eq_set (op =) (c, conjs)) ? cons Show
   227 
   229 
   228         fun isar_steps outer predecessor accum [] =
   230         fun isar_steps outer predecessor accum [] =
   229             accum
   231             accum
   348 *)
   350 *)
   349           |> `(preplay_outcome_of_isar_proof (!preplay_data))
   351           |> `(preplay_outcome_of_isar_proof (!preplay_data))
   350           ||> (comment_isar_proof comment_of
   352           ||> (comment_isar_proof comment_of
   351                #> chain_isar_proof
   353                #> chain_isar_proof
   352                #> kill_useless_labels_in_isar_proof
   354                #> kill_useless_labels_in_isar_proof
   353                #> relabel_isar_proof_nicely
   355                #> relabel_isar_proof_nicely)
   354                #> rename_bound_vars_in_isar_proof)
       
   355       in
   356       in
   356         (case add_isar_steps (steps_of_isar_proof isar_proof) 0 of
   357         (case add_isar_steps (steps_of_isar_proof isar_proof) 0 of
   357           1 =>
   358           1 =>
   358           one_line_proof_text ctxt 0
   359           one_line_proof_text ctxt 0
   359             (if play_outcome_ord (play_outcome, one_line_play) = LESS then
   360             (if play_outcome_ord (play_outcome, one_line_play) = LESS then