diff -r e4119d366ab0 -r 7b5468422352 src/Doc/Implementation/Logic.thy --- a/src/Doc/Implementation/Logic.thy Fri Feb 19 14:50:12 2016 +0100 +++ b/src/Doc/Implementation/Logic.thy Fri Feb 19 15:01:38 2016 +0100 @@ -1248,60 +1248,11 @@ \ text %mlex \ - Detailed proof information of a theorem may be retrieved as follows: -\ - -lemma ex: "A \ B \ B \ A" -proof - assume "A \ B" - then obtain B and A .. - then show "B \ A" .. -qed - -ML_val \ - (*proof body with digest*) - val body = Proofterm.strip_thm (Thm.proof_body_of @{thm ex}); - - (*proof term only*) - val prf = Proofterm.proof_of body; - Pretty.writeln (Proof_Syntax.pretty_proof @{context} prf); - - (*all theorems used in the graph of nested proofs*) - val all_thms = - Proofterm.fold_body_thms - (fn (name, _, _) => insert (op =) name) [body] []; -\ + \<^item> @{file "~~/src/HOL/Proofs/ex/Proof_Terms.thy"} provides basic examples + involving proof terms. -text \ - The result refers to various basic facts of Isabelle/HOL: @{thm [source] - HOL.impI}, @{thm [source] HOL.conjE}, @{thm [source] HOL.conjI} etc. The - combinator @{ML Proofterm.fold_body_thms} recursively explores the graph of - the proofs of all theorems being used here. - - \<^medskip> - Alternatively, we may produce a proof term manually, and turn it into a - theorem as follows: -\ - -ML_val \ - val thy = @{theory}; - val prf = - Proof_Syntax.read_proof thy true false - "impI \ _ \ _ \ \ - \ (\<^bold>\H: _. \ - \ conjE \ _ \ _ \ _ \ H \ \ - \ (\<^bold>\(H: _) Ha: _. conjI \ _ \ _ \ Ha \ H))"; - val thm = - prf - |> Reconstruct.reconstruct_proof thy @{prop "A \ B \ B \ A"} - |> Proof_Checker.thm_of_proof thy - |> Drule.export_without_context; -\ - -text \ - \<^medskip> - See also @{file "~~/src/HOL/Proofs/ex/XML_Data.thy"} for further examples, - with export and import of proof terms via XML/ML data representation. + \<^item> @{file "~~/src/HOL/Proofs/ex/XML_Data.thy"} demonstrates export and import + of proof terms via XML/ML data representation. \ end