# HG changeset patch # User wenzelm # Date 1479655084 -3600 # Node ID 488cb71eeb836bb5ee18fc466f1317da719911ab # Parent 80aaa4ff7fedd69ffc6b5773a5d6d0515ae430b4 more on Isar proof language; diff -r 80aaa4ff7fed -r 488cb71eeb83 src/Doc/Isar_Ref/Framework.thy --- a/src/Doc/Isar_Ref/Framework.thy Sun Nov 20 15:53:07 2016 +0100 +++ b/src/Doc/Isar_Ref/Framework.thy Sun Nov 20 16:18:04 2016 +0100 @@ -485,11 +485,58 @@ entities of Pure (propositions, facts, and goals). The Isar proof language allows to organize reasoning within the underlying rule calculus of Pure, but Isar is not another logical calculus. Isar merely imposes certain - structure and policies on Pure inferences. + structure and policies on Pure inferences. The main grammar of the Isar + proof language is given in \figref{fig:isar-syntax}. - Isar is intended as an exercise in minimalism. Approximately half of the - language is introduced as primitive, the rest defined as derived concepts. - The grammar in \appref{ap:main-grammar} describes the core language + \begin{figure}[htb] + \begin{center} + \begin{tabular}{rcl} + \main\ & \=\ & \<^theory_text>\notepad begin "statement\<^sup>*" end\ \\ + & \|\ & \<^theory_text>\theorem name: props if name: props for vars\ \\ + & \|\ & \<^theory_text>\theorem name:\ \\ + & & \quad\<^theory_text>\fixes vars\ \\ + & & \quad\<^theory_text>\assumes name: props\ \\ + & & \quad\<^theory_text>\shows name: props "proof"\ \\ + & \|\ & \<^theory_text>\theorem name:\ \\ + & & \quad\<^theory_text>\fixes vars\ \\ + & & \quad\<^theory_text>\assumes name: props\ \\ + & & \quad\<^theory_text>\obtains (name) clause "\<^bold>|" \ "proof"\ \\ + \proof\ & \=\ & \<^theory_text>\"refinement\<^sup>* proper_proof"\ \\ + \refinement\ & \=\ & \<^theory_text>\apply method\ \\ + & \|\ & \<^theory_text>\supply name = thms\ \\ + & \|\ & \<^theory_text>\subgoal premises name for vars "proof"\ \\ + & \|\ & \<^theory_text>\using thms\ \\ + & \|\ & \<^theory_text>\unfolding thms\ \\ + \proper_proof\ & \=\ & \<^theory_text>\proof "method\<^sup>?" "statement\<^sup>*" qed "method\<^sup>?"\ \\ + & \|\ & \<^theory_text>\by method method\~~~\|\~~~\<^theory_text>\..\~~~\|\~~~\<^theory_text>\.\~~~\|\~~~\<^theory_text>\sorry\~~~\|\~~~\<^theory_text>\done\ \\ + \statement\ & \=\ & \<^theory_text>\{ "statement\<^sup>*" }\~~~\|\~~~\<^theory_text>\next\ \\ + & \|\ & \<^theory_text>\note name = thms\ \\ + & \|\ & \<^theory_text>\let "term" = "term"\ \\ + & \|\ & \<^theory_text>\write name (mixfix)\ \\ + & \|\ & \<^theory_text>\fix vars\ \\ + & \|\ & \<^theory_text>\assume name: props if props for vars\ \\ + & \|\ & \<^theory_text>\presume name: props if props for vars\ \\ + & \|\ & \<^theory_text>\define clause\ \\ + & \|\ & \<^theory_text>\case name: "case"\ \\ + & \|\ & \<^theory_text>\then"\<^sup>?" goal\ \\ + & \|\ & \<^theory_text>\from thms goal\ \\ + & \|\ & \<^theory_text>\with thms goal\ \\ + & \|\ & \<^theory_text>\also\~~~\|\~~~\<^theory_text>\finally goal\ \\ + & \|\ & \<^theory_text>\moreover\~~~\|\~~~\<^theory_text>\ultimately goal\ \\ + \goal\ & \=\ & \<^theory_text>\have name: props if name: props for vars "proof"\ \\ + & \|\ & \<^theory_text>\show name: props if name: props for vars "proof"\ \\ + & \|\ & \<^theory_text>\show name: props when name: props for vars "proof"\ \\ + & \|\ & \<^theory_text>\consider (name) clause "\<^bold>|" \ "proof"\ \\ + & \|\ & \<^theory_text>\obtain (name) clause "proof"\ \\ + \clause\ & \=\ & \<^theory_text>\vars where name: props if props for vars\ \\ + \end{tabular} + \end{center} + \caption{Main grammar of the Isar proof language}\label{fig:isar-syntax} + \end{figure} + + The construction of the Isar proof language proceeds in a bottom-up fashion, + as an exercise in purity and minimalism. The grammar in + \appref{ap:main-grammar} describes the primitive parts of the core language (category \proof\), which is embedded into the main outer theory syntax via elements that require a proof (e.g.\ \<^theory_text>\theorem\, \<^theory_text>\lemma\, \<^theory_text>\function\, \<^theory_text>\termination\).