equal
deleted
inserted
replaced
217 (* goals *) |
217 (* goals *) |
218 |
218 |
219 fun goal opt_chain goal stmt int = |
219 fun goal opt_chain goal stmt int = |
220 opt_chain #> goal NONE (K I) stmt int; |
220 opt_chain #> goal NONE (K I) stmt int; |
221 |
221 |
222 val have = goal I Proof.have; |
222 val have = goal I Proof.have_cmd; |
223 val hence = goal Proof.chain Proof.have; |
223 val hence = goal Proof.chain Proof.have_cmd; |
224 val show = goal I Proof.show; |
224 val show = goal I Proof.show_cmd; |
225 val thus = goal Proof.chain Proof.show; |
225 val thus = goal Proof.chain Proof.show_cmd; |
226 |
226 |
227 |
227 |
228 (* local endings *) |
228 (* local endings *) |
229 |
229 |
230 fun local_qed m = Toplevel.proof (Proof.local_qed (m, true)); |
230 fun local_qed m = Toplevel.proof (Proof.local_qed (m, true)); |
401 Graph.fold (cons o entry) classes [] |
401 Graph.fold (cons o entry) classes [] |
402 |> sort (int_ord o pairself #1) |> map #2; |
402 |> sort (int_ord o pairself #1) |> map #2; |
403 in Present.display_graph gr end); |
403 in Present.display_graph gr end); |
404 |
404 |
405 fun thm_deps args = Toplevel.unknown_theory o Toplevel.keep (fn state => |
405 fun thm_deps args = Toplevel.unknown_theory o Toplevel.keep (fn state => |
406 Thm_Deps.thm_deps (Proof.get_thmss (Toplevel.enter_proof_body state) args)); |
406 Thm_Deps.thm_deps (Proof.get_thmss_cmd (Toplevel.enter_proof_body state) args)); |
407 |
407 |
408 |
408 |
409 (* find unused theorems *) |
409 (* find unused theorems *) |
410 |
410 |
411 fun unused_thms opt_range = Toplevel.keep (fn state => |
411 fun unused_thms opt_range = Toplevel.keep (fn state => |
435 (* print theorems, terms, types etc. *) |
435 (* print theorems, terms, types etc. *) |
436 |
436 |
437 local |
437 local |
438 |
438 |
439 fun string_of_stmts state args = |
439 fun string_of_stmts state args = |
440 Proof.get_thmss state args |
440 Proof.get_thmss_cmd state args |
441 |> map (Element.pretty_statement (Proof.context_of state) Thm.theoremK) |
441 |> map (Element.pretty_statement (Proof.context_of state) Thm.theoremK) |
442 |> Pretty.chunks2 |> Pretty.string_of; |
442 |> Pretty.chunks2 |> Pretty.string_of; |
443 |
443 |
444 fun string_of_thms state args = |
444 fun string_of_thms state args = |
445 Pretty.string_of (Display.pretty_thms (Proof.context_of state) (Proof.get_thmss state args)); |
445 Pretty.string_of (Display.pretty_thms (Proof.context_of state) (Proof.get_thmss_cmd state args)); |
446 |
446 |
447 fun string_of_prfs full state arg = |
447 fun string_of_prfs full state arg = |
448 Pretty.string_of |
448 Pretty.string_of |
449 (case arg of |
449 (case arg of |
450 NONE => |
450 NONE => |
458 Proof_Syntax.pretty_proof ctxt |
458 Proof_Syntax.pretty_proof ctxt |
459 (if full then Reconstruct.reconstruct_proof thy prop prf' else prf') |
459 (if full then Reconstruct.reconstruct_proof thy prop prf' else prf') |
460 end |
460 end |
461 | SOME args => Pretty.chunks |
461 | SOME args => Pretty.chunks |
462 (map (Proof_Syntax.pretty_proof_of (Proof.context_of state) full) |
462 (map (Proof_Syntax.pretty_proof_of (Proof.context_of state) full) |
463 (Proof.get_thmss state args))); |
463 (Proof.get_thmss_cmd state args))); |
464 |
464 |
465 fun string_of_prop state s = |
465 fun string_of_prop state s = |
466 let |
466 let |
467 val ctxt = Proof.context_of state; |
467 val ctxt = Proof.context_of state; |
468 val prop = Syntax.read_prop ctxt s; |
468 val prop = Syntax.read_prop ctxt s; |