27042
|
1 |
%
|
|
2 |
\begin{isabellebody}%
|
|
3 |
\def\isabellecontext{Document{\isacharunderscore}Preparation}%
|
|
4 |
%
|
|
5 |
\isadelimtheory
|
|
6 |
\isanewline
|
|
7 |
\isanewline
|
|
8 |
%
|
|
9 |
\endisadelimtheory
|
|
10 |
%
|
|
11 |
\isatagtheory
|
|
12 |
\isacommand{theory}\isamarkupfalse%
|
|
13 |
\ Document{\isacharunderscore}Preparation\isanewline
|
|
14 |
\isakeyword{imports}\ Main\isanewline
|
|
15 |
\isakeyword{begin}%
|
|
16 |
\endisatagtheory
|
|
17 |
{\isafoldtheory}%
|
|
18 |
%
|
|
19 |
\isadelimtheory
|
|
20 |
%
|
|
21 |
\endisadelimtheory
|
|
22 |
%
|
|
23 |
\isamarkupchapter{Document preparation \label{ch:document-prep}%
|
|
24 |
}
|
|
25 |
\isamarkuptrue%
|
|
26 |
%
|
|
27 |
\begin{isamarkuptext}%
|
|
28 |
Isabelle/Isar provides a simple document preparation system based on
|
|
29 |
existing {PDF-\LaTeX} technology, with full support of hyper-links
|
|
30 |
(both local references and URLs) and bookmarks. Thus the results
|
|
31 |
are equally well suited for WWW browsing and as printed copies.
|
|
32 |
|
|
33 |
\medskip Isabelle generates {\LaTeX} output as part of the run of a
|
|
34 |
\emph{logic session} (see also \cite{isabelle-sys}). Getting
|
|
35 |
started with a working configuration for common situations is quite
|
|
36 |
easy by using the Isabelle \verb|mkdir| and \verb|make|
|
|
37 |
tools. First invoke
|
|
38 |
\begin{ttbox}
|
|
39 |
isatool mkdir Foo
|
|
40 |
\end{ttbox}
|
|
41 |
to initialize a separate directory for session \verb|Foo| ---
|
|
42 |
it is safe to experiment, since \verb|isatool mkdir| never
|
|
43 |
overwrites existing files. Ensure that \verb|Foo/ROOT.ML|
|
|
44 |
holds ML commands to load all theories required for this session;
|
|
45 |
furthermore \verb|Foo/document/root.tex| should include any
|
|
46 |
special {\LaTeX} macro packages required for your document (the
|
|
47 |
default is usually sufficient as a start).
|
|
48 |
|
|
49 |
The session is controlled by a separate \verb|IsaMakefile|
|
|
50 |
(with crude source dependencies by default). This file is located
|
|
51 |
one level up from the \verb|Foo| directory location. Now
|
|
52 |
invoke
|
|
53 |
\begin{ttbox}
|
|
54 |
isatool make Foo
|
|
55 |
\end{ttbox}
|
|
56 |
to run the \verb|Foo| session, with browser information and
|
|
57 |
document preparation enabled. Unless any errors are reported by
|
|
58 |
Isabelle or {\LaTeX}, the output will appear inside the directory
|
|
59 |
\verb|ISABELLE_BROWSER_INFO|, as reported by the batch job in
|
|
60 |
verbose mode.
|
|
61 |
|
|
62 |
\medskip You may also consider to tune the \verb|usedir|
|
|
63 |
options in \verb|IsaMakefile|, for example to change the output
|
|
64 |
format from \verb|pdf| to \verb|dvi|, or activate the
|
|
65 |
\verb|-D| option to retain a second copy of the generated
|
|
66 |
{\LaTeX} sources.
|
|
67 |
|
|
68 |
\medskip See \emph{The Isabelle System Manual} \cite{isabelle-sys}
|
|
69 |
for further details on Isabelle logic sessions and theory
|
|
70 |
presentation. The Isabelle/HOL tutorial \cite{isabelle-hol-book}
|
|
71 |
also covers theory presentation issues.%
|
|
72 |
\end{isamarkuptext}%
|
|
73 |
\isamarkuptrue%
|
|
74 |
%
|
|
75 |
\isamarkupsection{Markup commands \label{sec:markup}%
|
|
76 |
}
|
|
77 |
\isamarkuptrue%
|
|
78 |
%
|
|
79 |
\begin{isamarkuptext}%
|
|
80 |
\begin{matharray}{rcl}
|
27052
|
81 |
\indexdef{}{command}{header}\hypertarget{command.header}{\hyperlink{command.header}{\mbox{\isa{\isacommand{header}}}}} & : & \isarkeep{toplevel} \\[0.5ex]
|
27042
|
82 |
\indexdef{}{command}{chapter}\hypertarget{command.chapter}{\hyperlink{command.chapter}{\mbox{\isa{\isacommand{chapter}}}}} & : & \isarkeep{local{\dsh}theory} \\
|
|
83 |
\indexdef{}{command}{section}\hypertarget{command.section}{\hyperlink{command.section}{\mbox{\isa{\isacommand{section}}}}} & : & \isarkeep{local{\dsh}theory} \\
|
|
84 |
\indexdef{}{command}{subsection}\hypertarget{command.subsection}{\hyperlink{command.subsection}{\mbox{\isa{\isacommand{subsection}}}}} & : & \isarkeep{local{\dsh}theory} \\
|
|
85 |
\indexdef{}{command}{subsubsection}\hypertarget{command.subsubsection}{\hyperlink{command.subsubsection}{\mbox{\isa{\isacommand{subsubsection}}}}} & : & \isarkeep{local{\dsh}theory} \\
|
|
86 |
\indexdef{}{command}{text}\hypertarget{command.text}{\hyperlink{command.text}{\mbox{\isa{\isacommand{text}}}}} & : & \isarkeep{local{\dsh}theory} \\
|
|
87 |
\indexdef{}{command}{text\_raw}\hypertarget{command.text-raw}{\hyperlink{command.text-raw}{\mbox{\isa{\isacommand{text{\isacharunderscore}raw}}}}} & : & \isarkeep{local{\dsh}theory} \\[0.5ex]
|
|
88 |
\indexdef{}{command}{sect}\hypertarget{command.sect}{\hyperlink{command.sect}{\mbox{\isa{\isacommand{sect}}}}} & : & \isartrans{proof}{proof} \\
|
|
89 |
\indexdef{}{command}{subsect}\hypertarget{command.subsect}{\hyperlink{command.subsect}{\mbox{\isa{\isacommand{subsect}}}}} & : & \isartrans{proof}{proof} \\
|
|
90 |
\indexdef{}{command}{subsubsect}\hypertarget{command.subsubsect}{\hyperlink{command.subsubsect}{\mbox{\isa{\isacommand{subsubsect}}}}} & : & \isartrans{proof}{proof} \\
|
|
91 |
\indexdef{}{command}{txt}\hypertarget{command.txt}{\hyperlink{command.txt}{\mbox{\isa{\isacommand{txt}}}}} & : & \isartrans{proof}{proof} \\
|
|
92 |
\indexdef{}{command}{txt\_raw}\hypertarget{command.txt-raw}{\hyperlink{command.txt-raw}{\mbox{\isa{\isacommand{txt{\isacharunderscore}raw}}}}} & : & \isartrans{proof}{proof} \\
|
|
93 |
\end{matharray}
|
|
94 |
|
|
95 |
Apart from formal comments (see \secref{sec:comments}), markup
|
|
96 |
commands provide a structured way to insert text into the document
|
|
97 |
generated from a theory (see \cite{isabelle-sys} for more
|
|
98 |
information on Isabelle's document preparation tools).
|
|
99 |
|
|
100 |
\begin{rail}
|
|
101 |
('chapter' | 'section' | 'subsection' | 'subsubsection' | 'text') target? text
|
|
102 |
;
|
27052
|
103 |
('header' | 'text\_raw' | 'sect' | 'subsect' | 'subsubsect' | 'txt' | 'txt\_raw') text
|
27042
|
104 |
;
|
|
105 |
\end{rail}
|
|
106 |
|
|
107 |
\begin{descr}
|
|
108 |
|
27052
|
109 |
\item [\hyperlink{command.header}{\mbox{\isa{\isacommand{header}}}}~\isa{{\isachardoublequote}text{\isachardoublequote}}] provides plain text
|
|
110 |
markup just preceding the formal beginning of a theory. In actual
|
|
111 |
document preparation the corresponding {\LaTeX} macro \verb|\isamarkupheader| may be redefined to produce chapter or section
|
27054
|
112 |
headings.
|
27052
|
113 |
|
27042
|
114 |
\item [\hyperlink{command.chapter}{\mbox{\isa{\isacommand{chapter}}}}, \hyperlink{command.section}{\mbox{\isa{\isacommand{section}}}}, \hyperlink{command.subsection}{\mbox{\isa{\isacommand{subsection}}}}, and \hyperlink{command.subsubsection}{\mbox{\isa{\isacommand{subsubsection}}}}] mark chapter and
|
27054
|
115 |
section headings. The corresponding {\LaTeX} macros are \verb|\isamarkupchapter|, \verb|\isamarkupsection| etc.
|
27042
|
116 |
|
|
117 |
\item [\hyperlink{command.text}{\mbox{\isa{\isacommand{text}}}} and \hyperlink{command.txt}{\mbox{\isa{\isacommand{txt}}}}] specify paragraphs of
|
|
118 |
plain text.
|
|
119 |
|
|
120 |
\item [\hyperlink{command.text-raw}{\mbox{\isa{\isacommand{text{\isacharunderscore}raw}}}} and \hyperlink{command.txt-raw}{\mbox{\isa{\isacommand{txt{\isacharunderscore}raw}}}}] insert
|
|
121 |
{\LaTeX} source into the output, without additional markup. Thus
|
|
122 |
the full range of document manipulations becomes available.
|
|
123 |
|
|
124 |
\end{descr}
|
|
125 |
|
|
126 |
The \isa{{\isachardoublequote}text{\isachardoublequote}} argument of these markup commands (except for
|
|
127 |
\hyperlink{command.text-raw}{\mbox{\isa{\isacommand{text{\isacharunderscore}raw}}}}) may contain references to formal entities
|
|
128 |
(``antiquotations'', see also \secref{sec:antiq}). These are
|
|
129 |
interpreted in the present theory context, or the named \isa{{\isachardoublequote}target{\isachardoublequote}}.
|
|
130 |
|
|
131 |
Any of these markup elements corresponds to a {\LaTeX} command with
|
|
132 |
the name prefixed by \verb|\isamarkup|. For the sectioning
|
|
133 |
commands this is a plain macro with a single argument, e.g.\
|
|
134 |
\verb|\isamarkupchapter{|\isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}}\verb|}| for
|
|
135 |
\hyperlink{command.chapter}{\mbox{\isa{\isacommand{chapter}}}}. The \hyperlink{command.text}{\mbox{\isa{\isacommand{text}}}} markup results in a
|
|
136 |
{\LaTeX} environment \verb|\begin{isamarkuptext}| \isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}} \verb|\end{isamarkuptext}|, while \hyperlink{command.text-raw}{\mbox{\isa{\isacommand{text{\isacharunderscore}raw}}}}
|
|
137 |
causes the text to be inserted directly into the {\LaTeX} source.
|
|
138 |
|
|
139 |
\medskip The proof markup commands closely resemble those for theory
|
|
140 |
specifications, but have a different formal status and produce
|
|
141 |
different {\LaTeX} macros. Also note that the \indexref{}{command}{header}\hyperlink{command.header}{\mbox{\isa{\isacommand{header}}}} declaration (see \secref{sec:begin-thy}) admits to insert
|
|
142 |
section markup just preceding the actual theory definition.%
|
|
143 |
\end{isamarkuptext}%
|
|
144 |
\isamarkuptrue%
|
|
145 |
%
|
|
146 |
\isamarkupsection{Antiquotations \label{sec:antiq}%
|
|
147 |
}
|
|
148 |
\isamarkuptrue%
|
|
149 |
%
|
|
150 |
\begin{isamarkuptext}%
|
|
151 |
\begin{matharray}{rcl}
|
|
152 |
\indexdef{}{antiquotation}{theory}\hypertarget{antiquotation.theory}{\hyperlink{antiquotation.theory}{\mbox{\isa{theory}}}} & : & \isarantiq \\
|
|
153 |
\indexdef{}{antiquotation}{thm}\hypertarget{antiquotation.thm}{\hyperlink{antiquotation.thm}{\mbox{\isa{thm}}}} & : & \isarantiq \\
|
|
154 |
\indexdef{}{antiquotation}{prop}\hypertarget{antiquotation.prop}{\hyperlink{antiquotation.prop}{\mbox{\isa{prop}}}} & : & \isarantiq \\
|
|
155 |
\indexdef{}{antiquotation}{term}\hypertarget{antiquotation.term}{\hyperlink{antiquotation.term}{\mbox{\isa{term}}}} & : & \isarantiq \\
|
|
156 |
\indexdef{}{antiquotation}{const}\hypertarget{antiquotation.const}{\hyperlink{antiquotation.const}{\mbox{\isa{const}}}} & : & \isarantiq \\
|
|
157 |
\indexdef{}{antiquotation}{abbrev}\hypertarget{antiquotation.abbrev}{\hyperlink{antiquotation.abbrev}{\mbox{\isa{abbrev}}}} & : & \isarantiq \\
|
|
158 |
\indexdef{}{antiquotation}{typeof}\hypertarget{antiquotation.typeof}{\hyperlink{antiquotation.typeof}{\mbox{\isa{typeof}}}} & : & \isarantiq \\
|
|
159 |
\indexdef{}{antiquotation}{typ}\hypertarget{antiquotation.typ}{\hyperlink{antiquotation.typ}{\mbox{\isa{typ}}}} & : & \isarantiq \\
|
|
160 |
\indexdef{}{antiquotation}{thm\_style}\hypertarget{antiquotation.thm-style}{\hyperlink{antiquotation.thm-style}{\mbox{\isa{thm{\isacharunderscore}style}}}} & : & \isarantiq \\
|
|
161 |
\indexdef{}{antiquotation}{term\_style}\hypertarget{antiquotation.term-style}{\hyperlink{antiquotation.term-style}{\mbox{\isa{term{\isacharunderscore}style}}}} & : & \isarantiq \\
|
|
162 |
\indexdef{}{antiquotation}{text}\hypertarget{antiquotation.text}{\hyperlink{antiquotation.text}{\mbox{\isa{text}}}} & : & \isarantiq \\
|
|
163 |
\indexdef{}{antiquotation}{goals}\hypertarget{antiquotation.goals}{\hyperlink{antiquotation.goals}{\mbox{\isa{goals}}}} & : & \isarantiq \\
|
|
164 |
\indexdef{}{antiquotation}{subgoals}\hypertarget{antiquotation.subgoals}{\hyperlink{antiquotation.subgoals}{\mbox{\isa{subgoals}}}} & : & \isarantiq \\
|
|
165 |
\indexdef{}{antiquotation}{prf}\hypertarget{antiquotation.prf}{\hyperlink{antiquotation.prf}{\mbox{\isa{prf}}}} & : & \isarantiq \\
|
|
166 |
\indexdef{}{antiquotation}{full\_prf}\hypertarget{antiquotation.full-prf}{\hyperlink{antiquotation.full-prf}{\mbox{\isa{full{\isacharunderscore}prf}}}} & : & \isarantiq \\
|
|
167 |
\indexdef{}{antiquotation}{ML}\hypertarget{antiquotation.ML}{\hyperlink{antiquotation.ML}{\mbox{\isa{ML}}}} & : & \isarantiq \\
|
|
168 |
\indexdef{}{antiquotation}{ML\_type}\hypertarget{antiquotation.ML-type}{\hyperlink{antiquotation.ML-type}{\mbox{\isa{ML{\isacharunderscore}type}}}} & : & \isarantiq \\
|
|
169 |
\indexdef{}{antiquotation}{ML\_struct}\hypertarget{antiquotation.ML-struct}{\hyperlink{antiquotation.ML-struct}{\mbox{\isa{ML{\isacharunderscore}struct}}}} & : & \isarantiq \\
|
|
170 |
\end{matharray}
|
|
171 |
|
|
172 |
The text body of formal comments (see also \secref{sec:comments})
|
|
173 |
may contain antiquotations of logical entities, such as theorems,
|
|
174 |
terms and types, which are to be presented in the final output
|
27054
|
175 |
produced by the Isabelle document preparation system.
|
27042
|
176 |
|
|
177 |
Thus embedding of ``\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}term\ {\isacharbrackleft}show{\isacharunderscore}types{\isacharbrackright}\ {\isachardoublequote}f\ x\ {\isacharequal}\ a\ {\isacharplus}\ x{\isachardoublequote}{\isacharbraceright}{\isachardoublequote}}''
|
|
178 |
within a text block would cause
|
|
179 |
\isa{{\isacharparenleft}f{\isasymColon}{\isacharprime}a\ {\isasymRightarrow}\ {\isacharprime}a{\isacharparenright}\ {\isacharparenleft}x{\isasymColon}{\isacharprime}a{\isacharparenright}\ {\isacharequal}\ {\isacharparenleft}a{\isasymColon}{\isacharprime}a{\isacharparenright}\ {\isacharplus}\ x} to appear in the final {\LaTeX} document. Also note that theorem
|
|
180 |
antiquotations may involve attributes as well. For example,
|
|
181 |
\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}thm\ sym\ {\isacharbrackleft}no{\isacharunderscore}vars{\isacharbrackright}{\isacharbraceright}{\isachardoublequote}} would print the theorem's
|
|
182 |
statement where all schematic variables have been replaced by fixed
|
|
183 |
ones, which are easier to read.
|
|
184 |
|
|
185 |
\begin{rail}
|
|
186 |
atsign lbrace antiquotation rbrace
|
|
187 |
;
|
|
188 |
|
|
189 |
antiquotation:
|
|
190 |
'theory' options name |
|
|
191 |
'thm' options thmrefs |
|
|
192 |
'prop' options prop |
|
|
193 |
'term' options term |
|
|
194 |
'const' options term |
|
|
195 |
'abbrev' options term |
|
|
196 |
'typeof' options term |
|
|
197 |
'typ' options type |
|
|
198 |
'thm\_style' options name thmref |
|
|
199 |
'term\_style' options name term |
|
|
200 |
'text' options name |
|
|
201 |
'goals' options |
|
|
202 |
'subgoals' options |
|
|
203 |
'prf' options thmrefs |
|
|
204 |
'full\_prf' options thmrefs |
|
|
205 |
'ML' options name |
|
|
206 |
'ML\_type' options name |
|
|
207 |
'ML\_struct' options name
|
|
208 |
;
|
|
209 |
options: '[' (option * ',') ']'
|
|
210 |
;
|
|
211 |
option: name | name '=' name
|
|
212 |
;
|
|
213 |
\end{rail}
|
|
214 |
|
|
215 |
Note that the syntax of antiquotations may \emph{not} include source
|
|
216 |
comments \verb|(*|~\isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}}~\verb|*)| or verbatim
|
|
217 |
text \verb|{|\verb|*|~\isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}}~\verb|*|\verb|}|.
|
|
218 |
|
|
219 |
\begin{descr}
|
|
220 |
|
|
221 |
\item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}theory\ A{\isacharbraceright}{\isachardoublequote}}] prints the name \isa{{\isachardoublequote}A{\isachardoublequote}}, which is
|
|
222 |
guaranteed to refer to a valid ancestor theory in the current
|
|
223 |
context.
|
|
224 |
|
|
225 |
\item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}thm\ a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isacharbraceright}{\isachardoublequote}}] prints theorems
|
|
226 |
\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}. Note that attribute specifications
|
|
227 |
may be included as well (see also \secref{sec:syn-att}); the
|
|
228 |
\indexref{}{attribute}{no\_vars}\hyperlink{attribute.no-vars}{\mbox{\isa{no{\isacharunderscore}vars}}} rule (see \secref{sec:misc-meth-att}) would
|
|
229 |
be particularly useful to suppress printing of schematic variables.
|
|
230 |
|
|
231 |
\item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}prop\ {\isasymphi}{\isacharbraceright}{\isachardoublequote}}] prints a well-typed proposition \isa{{\isachardoublequote}{\isasymphi}{\isachardoublequote}}.
|
|
232 |
|
|
233 |
\item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}term\ t{\isacharbraceright}{\isachardoublequote}}] prints a well-typed term \isa{{\isachardoublequote}t{\isachardoublequote}}.
|
|
234 |
|
|
235 |
\item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}const\ c{\isacharbraceright}{\isachardoublequote}}] prints a logical or syntactic constant
|
|
236 |
\isa{{\isachardoublequote}c{\isachardoublequote}}.
|
|
237 |
|
|
238 |
\item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}abbrev\ c\ x\isactrlsub {\isadigit{1}}\ {\isasymdots}\ x\isactrlsub n{\isacharbraceright}{\isachardoublequote}}] prints a constant
|
|
239 |
abbreviation \isa{{\isachardoublequote}c\ x\isactrlsub {\isadigit{1}}\ {\isasymdots}\ x\isactrlsub n\ {\isasymequiv}\ rhs{\isachardoublequote}} as defined in
|
|
240 |
the current context.
|
|
241 |
|
|
242 |
\item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}typeof\ t{\isacharbraceright}{\isachardoublequote}}] prints the type of a well-typed term
|
|
243 |
\isa{{\isachardoublequote}t{\isachardoublequote}}.
|
|
244 |
|
|
245 |
\item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}typ\ {\isasymtau}{\isacharbraceright}{\isachardoublequote}}] prints a well-formed type \isa{{\isachardoublequote}{\isasymtau}{\isachardoublequote}}.
|
|
246 |
|
|
247 |
\item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}thm{\isacharunderscore}style\ s\ a{\isacharbraceright}{\isachardoublequote}}] prints theorem \isa{a},
|
|
248 |
previously applying a style \isa{s} to it (see below).
|
|
249 |
|
|
250 |
\item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}term{\isacharunderscore}style\ s\ t{\isacharbraceright}{\isachardoublequote}}] prints a well-typed term \isa{t} after applying a style \isa{s} to it (see below).
|
|
251 |
|
|
252 |
\item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}text\ s{\isacharbraceright}{\isachardoublequote}}] prints uninterpreted source text \isa{s}. This is particularly useful to print portions of text according
|
|
253 |
to the Isabelle {\LaTeX} output style, without demanding
|
|
254 |
well-formedness (e.g.\ small pieces of terms that should not be
|
|
255 |
parsed or type-checked yet).
|
|
256 |
|
|
257 |
\item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}goals{\isacharbraceright}{\isachardoublequote}}] prints the current \emph{dynamic} goal
|
|
258 |
state. This is mainly for support of tactic-emulation scripts
|
|
259 |
within Isar --- presentation of goal states does not conform to
|
|
260 |
actual human-readable proof documents.
|
|
261 |
|
|
262 |
Please do not include goal states into document output unless you
|
|
263 |
really know what you are doing!
|
|
264 |
|
|
265 |
\item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}subgoals{\isacharbraceright}{\isachardoublequote}}] is similar to \isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}goals{\isacharbraceright}{\isachardoublequote}}, but
|
|
266 |
does not print the main goal.
|
|
267 |
|
|
268 |
\item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}prf\ a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isacharbraceright}{\isachardoublequote}}] prints the (compact)
|
|
269 |
proof terms corresponding to the theorems \isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}. Note that this requires proof terms to be switched on
|
|
270 |
for the current object logic (see the ``Proof terms'' section of the
|
|
271 |
Isabelle reference manual for information on how to do this).
|
|
272 |
|
|
273 |
\item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}full{\isacharunderscore}prf\ a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isacharbraceright}{\isachardoublequote}}] is like \isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}prf\ a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isacharbraceright}{\isachardoublequote}}, but displays the full proof terms,
|
|
274 |
i.e.\ also displays information omitted in the compact proof term,
|
|
275 |
which is denoted by ``\isa{{\isacharunderscore}}'' placeholders there.
|
|
276 |
|
|
277 |
\item [\isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}ML\ s{\isacharbraceright}{\isachardoublequote}}, \isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}ML{\isacharunderscore}type\ s{\isacharbraceright}{\isachardoublequote}}, and \isa{{\isachardoublequote}{\isacharat}{\isacharbraceleft}ML{\isacharunderscore}struct\ s{\isacharbraceright}{\isachardoublequote}}] check text \isa{s} as ML value, type, and
|
|
278 |
structure, respectively. The source is displayed verbatim.
|
|
279 |
|
|
280 |
\end{descr}
|
|
281 |
|
|
282 |
\medskip The following standard styles for use with \isa{thm{\isacharunderscore}style} and \isa{term{\isacharunderscore}style} are available:
|
|
283 |
|
|
284 |
\begin{descr}
|
|
285 |
|
|
286 |
\item [\isa{lhs}] extracts the first argument of any application
|
|
287 |
form with at least two arguments -- typically meta-level or
|
|
288 |
object-level equality, or any other binary relation.
|
|
289 |
|
|
290 |
\item [\isa{rhs}] is like \isa{lhs}, but extracts the second
|
|
291 |
argument.
|
|
292 |
|
|
293 |
\item [\isa{{\isachardoublequote}concl{\isachardoublequote}}] extracts the conclusion \isa{C} from a rule
|
|
294 |
in Horn-clause normal form \isa{{\isachardoublequote}A\isactrlsub {\isadigit{1}}\ {\isasymLongrightarrow}\ {\isasymdots}\ A\isactrlsub n\ {\isasymLongrightarrow}\ C{\isachardoublequote}}.
|
|
295 |
|
|
296 |
\item [\isa{{\isachardoublequote}prem{\isadigit{1}}{\isachardoublequote}}, \dots, \isa{{\isachardoublequote}prem{\isadigit{9}}{\isachardoublequote}}] extract premise
|
|
297 |
number \isa{{\isachardoublequote}{\isadigit{1}}{\isacharcomma}\ {\isasymdots}{\isacharcomma}\ {\isadigit{9}}{\isachardoublequote}}, respectively, from from a rule in
|
|
298 |
Horn-clause normal form \isa{{\isachardoublequote}A\isactrlsub {\isadigit{1}}\ {\isasymLongrightarrow}\ {\isasymdots}\ A\isactrlsub n\ {\isasymLongrightarrow}\ C{\isachardoublequote}}
|
|
299 |
|
|
300 |
\end{descr}
|
|
301 |
|
|
302 |
\medskip
|
|
303 |
The following options are available to tune the output. Note that most of
|
|
304 |
these coincide with ML flags of the same names (see also \cite{isabelle-ref}).
|
|
305 |
|
|
306 |
\begin{descr}
|
|
307 |
|
|
308 |
\item[\isa{{\isachardoublequote}show{\isacharunderscore}types\ {\isacharequal}\ bool{\isachardoublequote}} and \isa{{\isachardoublequote}show{\isacharunderscore}sorts\ {\isacharequal}\ bool{\isachardoublequote}}]
|
|
309 |
control printing of explicit type and sort constraints.
|
|
310 |
|
|
311 |
\item[\isa{{\isachardoublequote}show{\isacharunderscore}structs\ {\isacharequal}\ bool{\isachardoublequote}}] controls printing of implicit
|
|
312 |
structures.
|
|
313 |
|
|
314 |
\item[\isa{{\isachardoublequote}long{\isacharunderscore}names\ {\isacharequal}\ bool{\isachardoublequote}}] forces names of types and
|
|
315 |
constants etc.\ to be printed in their fully qualified internal
|
|
316 |
form.
|
|
317 |
|
|
318 |
\item[\isa{{\isachardoublequote}short{\isacharunderscore}names\ {\isacharequal}\ bool{\isachardoublequote}}] forces names of types and
|
|
319 |
constants etc.\ to be printed unqualified. Note that internalizing
|
|
320 |
the output again in the current context may well yield a different
|
|
321 |
result.
|
|
322 |
|
|
323 |
\item[\isa{{\isachardoublequote}unique{\isacharunderscore}names\ {\isacharequal}\ bool{\isachardoublequote}}] determines whether the printed
|
|
324 |
version of qualified names should be made sufficiently long to avoid
|
|
325 |
overlap with names declared further back. Set to \isa{false} for
|
|
326 |
more concise output.
|
|
327 |
|
|
328 |
\item[\isa{{\isachardoublequote}eta{\isacharunderscore}contract\ {\isacharequal}\ bool{\isachardoublequote}}] prints terms in \isa{{\isasymeta}}-contracted form.
|
|
329 |
|
|
330 |
\item[\isa{{\isachardoublequote}display\ {\isacharequal}\ bool{\isachardoublequote}}] indicates if the text is to be
|
|
331 |
output as multi-line ``display material'', rather than a small piece
|
|
332 |
of text without line breaks (which is the default).
|
|
333 |
|
|
334 |
\item[\isa{{\isachardoublequote}break\ {\isacharequal}\ bool{\isachardoublequote}}] controls line breaks in non-display
|
|
335 |
material.
|
|
336 |
|
|
337 |
\item[\isa{{\isachardoublequote}quotes\ {\isacharequal}\ bool{\isachardoublequote}}] indicates if the output should be
|
|
338 |
enclosed in double quotes.
|
|
339 |
|
|
340 |
\item[\isa{{\isachardoublequote}mode\ {\isacharequal}\ name{\isachardoublequote}}] adds \isa{name} to the print mode to
|
|
341 |
be used for presentation (see also \cite{isabelle-ref}). Note that
|
|
342 |
the standard setup for {\LaTeX} output is already present by
|
|
343 |
default, including the modes \isa{latex} and \isa{xsymbols}.
|
|
344 |
|
|
345 |
\item[\isa{{\isachardoublequote}margin\ {\isacharequal}\ nat{\isachardoublequote}} and \isa{{\isachardoublequote}indent\ {\isacharequal}\ nat{\isachardoublequote}}] change the
|
|
346 |
margin or indentation for pretty printing of display material.
|
|
347 |
|
|
348 |
\item[\isa{{\isachardoublequote}source\ {\isacharequal}\ bool{\isachardoublequote}}] prints the source text of the
|
|
349 |
antiquotation arguments, rather than the actual value. Note that
|
|
350 |
this does not affect well-formedness checks of \hyperlink{antiquotation.thm}{\mbox{\isa{thm}}}, \hyperlink{antiquotation.term}{\mbox{\isa{term}}}, etc. (only the \hyperlink{antiquotation.text}{\mbox{\isa{text}}} antiquotation admits arbitrary output).
|
|
351 |
|
|
352 |
\item[\isa{{\isachardoublequote}goals{\isacharunderscore}limit\ {\isacharequal}\ nat{\isachardoublequote}}] determines the maximum number of
|
|
353 |
goals to be printed.
|
|
354 |
|
|
355 |
\item[\isa{{\isachardoublequote}locale\ {\isacharequal}\ name{\isachardoublequote}}] specifies an alternative locale
|
|
356 |
context used for evaluating and printing the subsequent argument.
|
|
357 |
|
|
358 |
\end{descr}
|
|
359 |
|
|
360 |
For boolean flags, ``\isa{{\isachardoublequote}name\ {\isacharequal}\ true{\isachardoublequote}}'' may be abbreviated as
|
|
361 |
``\isa{name}''. All of the above flags are disabled by default,
|
|
362 |
unless changed from ML.
|
|
363 |
|
|
364 |
\medskip Note that antiquotations do not only spare the author from
|
|
365 |
tedious typing of logical entities, but also achieve some degree of
|
|
366 |
consistency-checking of informal explanations with formal
|
|
367 |
developments: well-formedness of terms and types with respect to the
|
|
368 |
current theory or proof context is ensured here.%
|
|
369 |
\end{isamarkuptext}%
|
|
370 |
\isamarkuptrue%
|
|
371 |
%
|
|
372 |
\isamarkupsection{Tagged commands \label{sec:tags}%
|
|
373 |
}
|
|
374 |
\isamarkuptrue%
|
|
375 |
%
|
|
376 |
\begin{isamarkuptext}%
|
|
377 |
Each Isabelle/Isar command may be decorated by presentation tags:
|
|
378 |
|
|
379 |
\indexouternonterm{tags}
|
|
380 |
\begin{rail}
|
|
381 |
tags: ( tag * )
|
|
382 |
;
|
|
383 |
tag: '\%' (ident | string)
|
|
384 |
\end{rail}
|
|
385 |
|
|
386 |
The tags \isa{{\isachardoublequote}theory{\isachardoublequote}}, \isa{{\isachardoublequote}proof{\isachardoublequote}}, \isa{{\isachardoublequote}ML{\isachardoublequote}} are already
|
|
387 |
pre-declared for certain classes of commands:
|
|
388 |
|
|
389 |
\medskip
|
|
390 |
|
|
391 |
\begin{tabular}{ll}
|
|
392 |
\isa{{\isachardoublequote}theory{\isachardoublequote}} & theory begin/end \\
|
|
393 |
\isa{{\isachardoublequote}proof{\isachardoublequote}} & all proof commands \\
|
|
394 |
\isa{{\isachardoublequote}ML{\isachardoublequote}} & all commands involving ML code \\
|
|
395 |
\end{tabular}
|
|
396 |
|
|
397 |
\medskip The Isabelle document preparation system (see also
|
|
398 |
\cite{isabelle-sys}) allows tagged command regions to be presented
|
|
399 |
specifically, e.g.\ to fold proof texts, or drop parts of the text
|
|
400 |
completely.
|
|
401 |
|
|
402 |
For example ``\hyperlink{command.by}{\mbox{\isa{\isacommand{by}}}}~\isa{{\isachardoublequote}{\isacharpercent}invisible\ auto{\isachardoublequote}}'' would
|
|
403 |
cause that piece of proof to be treated as \isa{invisible} instead
|
|
404 |
of \isa{{\isachardoublequote}proof{\isachardoublequote}} (the default), which may be either show or hidden
|
|
405 |
depending on the document setup. In contrast, ``\hyperlink{command.by}{\mbox{\isa{\isacommand{by}}}}~\isa{{\isachardoublequote}{\isacharpercent}visible\ auto{\isachardoublequote}}'' would force this text to be shown
|
|
406 |
invariably.
|
|
407 |
|
|
408 |
Explicit tag specifications within a proof apply to all subsequent
|
|
409 |
commands of the same level of nesting. For example, ``\hyperlink{command.proof}{\mbox{\isa{\isacommand{proof}}}}~\isa{{\isachardoublequote}{\isacharpercent}visible\ {\isasymdots}{\isachardoublequote}}~\hyperlink{command.qed}{\mbox{\isa{\isacommand{qed}}}}'' would force the
|
|
410 |
whole sub-proof to be typeset as \isa{visible} (unless some of its
|
|
411 |
parts are tagged differently).%
|
|
412 |
\end{isamarkuptext}%
|
|
413 |
\isamarkuptrue%
|
|
414 |
%
|
|
415 |
\isamarkupsection{Draft presentation%
|
|
416 |
}
|
|
417 |
\isamarkuptrue%
|
|
418 |
%
|
|
419 |
\begin{isamarkuptext}%
|
|
420 |
\begin{matharray}{rcl}
|
|
421 |
\indexdef{}{command}{display\_drafts}\hypertarget{command.display-drafts}{\hyperlink{command.display-drafts}{\mbox{\isa{\isacommand{display{\isacharunderscore}drafts}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
|
|
422 |
\indexdef{}{command}{print\_drafts}\hypertarget{command.print-drafts}{\hyperlink{command.print-drafts}{\mbox{\isa{\isacommand{print{\isacharunderscore}drafts}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isarkeep{\cdot} \\
|
|
423 |
\end{matharray}
|
|
424 |
|
|
425 |
\begin{rail}
|
|
426 |
('display\_drafts' | 'print\_drafts') (name +)
|
|
427 |
;
|
|
428 |
\end{rail}
|
|
429 |
|
|
430 |
\begin{descr}
|
|
431 |
|
|
432 |
\item [\hyperlink{command.display-drafts}{\mbox{\isa{\isacommand{display{\isacharunderscore}drafts}}}}~\isa{paths} and \hyperlink{command.print-drafts}{\mbox{\isa{\isacommand{print{\isacharunderscore}drafts}}}}~\isa{paths}] perform simple output of a given list
|
|
433 |
of raw source files. Only those symbols that do not require
|
|
434 |
additional {\LaTeX} packages are displayed properly, everything else
|
|
435 |
is left verbatim.
|
|
436 |
|
|
437 |
\end{descr}%
|
|
438 |
\end{isamarkuptext}%
|
|
439 |
\isamarkuptrue%
|
|
440 |
%
|
|
441 |
\isadelimtheory
|
|
442 |
%
|
|
443 |
\endisadelimtheory
|
|
444 |
%
|
|
445 |
\isatagtheory
|
|
446 |
\isacommand{end}\isamarkupfalse%
|
|
447 |
%
|
|
448 |
\endisatagtheory
|
|
449 |
{\isafoldtheory}%
|
|
450 |
%
|
|
451 |
\isadelimtheory
|
|
452 |
%
|
|
453 |
\endisadelimtheory
|
|
454 |
\isanewline
|
|
455 |
\end{isabellebody}%
|
|
456 |
%%% Local Variables:
|
|
457 |
%%% mode: latex
|
|
458 |
%%% TeX-master: "root"
|
|
459 |
%%% End:
|