56 |
56 |
57 The toplevel state is a disjoint sum of empty \isa{toplevel}, or |
57 The toplevel state is a disjoint sum of empty \isa{toplevel}, or |
58 \isa{theory}, or \isa{proof}. On entering the main Isar loop we |
58 \isa{theory}, or \isa{proof}. On entering the main Isar loop we |
59 start with an empty toplevel. A theory is commenced by giving a |
59 start with an empty toplevel. A theory is commenced by giving a |
60 \isa{{\isasymTHEORY}} header; within a theory we may issue theory |
60 \isa{{\isasymTHEORY}} header; within a theory we may issue theory |
61 commands such as \isa{{\isasymCONSTS}} or \isa{{\isasymDEFS}}, or state a |
61 commands such as \isa{{\isasymDEFINITION}}, or state a \isa{{\isasymTHEOREM}} to be proven. Now we are within a proof state, with a |
62 \isa{{\isasymTHEOREM}} to be proven. Now we are within a proof state, |
62 rich collection of Isar proof commands for structured proof |
63 with a rich collection of Isar proof commands for structured proof |
|
64 composition, or unstructured proof scripts. When the proof is |
63 composition, or unstructured proof scripts. When the proof is |
65 concluded we get back to the theory, which is then updated by |
64 concluded we get back to the theory, which is then updated by |
66 storing the resulting fact. Further theory declarations or theorem |
65 storing the resulting fact. Further theory declarations or theorem |
67 statements with proofs may follow, until we eventually conclude the |
66 statements with proofs may follow, until we eventually conclude the |
68 theory development by issuing \isa{{\isasymEND}}. The resulting theory |
67 theory development by issuing \isa{{\isasymEND}}. The resulting theory |
339 |
338 |
340 \begin{mldecls} |
339 \begin{mldecls} |
341 \indexml{Isar.main}\verb|Isar.main: unit -> unit| \\ |
340 \indexml{Isar.main}\verb|Isar.main: unit -> unit| \\ |
342 \indexml{Isar.loop}\verb|Isar.loop: unit -> unit| \\ |
341 \indexml{Isar.loop}\verb|Isar.loop: unit -> unit| \\ |
343 \indexml{Isar.state}\verb|Isar.state: unit -> Toplevel.state| \\ |
342 \indexml{Isar.state}\verb|Isar.state: unit -> Toplevel.state| \\ |
|
343 \indexml{Isar.context}\verb|Isar.context: unit -> Proof.context| \\ |
344 \indexml{Isar.exn}\verb|Isar.exn: unit -> (exn * string) option| \\ |
344 \indexml{Isar.exn}\verb|Isar.exn: unit -> (exn * string) option| \\ |
345 \end{mldecls} |
345 \end{mldecls} |
346 |
346 |
347 \begin{description} |
347 \begin{description} |
348 |
348 |
353 current state, after dropping out of the Isar toplevel loop. |
353 current state, after dropping out of the Isar toplevel loop. |
354 |
354 |
355 \item \verb|Isar.state ()| and \verb|Isar.exn ()| get current |
355 \item \verb|Isar.state ()| and \verb|Isar.exn ()| get current |
356 toplevel state and optional error condition, respectively. This |
356 toplevel state and optional error condition, respectively. This |
357 only works after dropping out of the Isar toplevel loop. |
357 only works after dropping out of the Isar toplevel loop. |
|
358 |
|
359 \item \verb|Isar.context ()| produces the proof context from \verb|Isar.state ()| above. |
358 |
360 |
359 \end{description}% |
361 \end{description}% |
360 \end{isamarkuptext}% |
362 \end{isamarkuptext}% |
361 \isamarkuptrue% |
363 \isamarkuptrue% |
362 % |
364 % |