author | wenzelm |
Tue, 31 Jul 2012 16:23:20 +0200 | |
changeset 48616 | be8002ee43d8 |
parent 48602 | 342ca8f3197b |
child 48657 | 63ef2f0cf8bb |
permissions | -rw-r--r-- |
28222 | 1 |
% |
2 |
\begin{isabellebody}% |
|
3 |
\def\isabellecontext{Presentation}% |
|
4 |
% |
|
5 |
\isadelimtheory |
|
6 |
% |
|
7 |
\endisadelimtheory |
|
8 |
% |
|
9 |
\isatagtheory |
|
10 |
\isacommand{theory}\isamarkupfalse% |
|
11 |
\ Presentation\isanewline |
|
43564
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
wenzelm
parents:
42009
diff
changeset
|
12 |
\isakeyword{imports}\ Base\isanewline |
28222 | 13 |
\isakeyword{begin}% |
14 |
\endisatagtheory |
|
15 |
{\isafoldtheory}% |
|
16 |
% |
|
17 |
\isadelimtheory |
|
18 |
% |
|
19 |
\endisadelimtheory |
|
20 |
% |
|
21 |
\isamarkupchapter{Presenting theories \label{ch:present}% |
|
22 |
} |
|
23 |
\isamarkuptrue% |
|
24 |
% |
|
25 |
\begin{isamarkuptext}% |
|
26 |
Isabelle provides several ways to present the outcome of formal |
|
27 |
developments, including WWW-based browsable libraries or actual |
|
28 |
printable documents. Presentation is centered around the concept of |
|
29 |
\emph{logic sessions}. The global session structure is that of a |
|
30 |
tree, with Isabelle Pure at its root, further object-logics derived |
|
31 |
(e.g.\ HOLCF from HOL, and HOL from Pure), and application sessions |
|
32 |
in leaf positions (usually without a separate image). |
|
33 |
||
48602 | 34 |
The tools \indexref{}{tool}{mkdir}\hyperlink{tool.mkdir}{\mbox{\isa{\isatool{mkdir}}}} and \indexref{}{tool}{make}\hyperlink{tool.make}{\mbox{\isa{\isatool{make}}}} provide the primary |
35 |
means for managing Isabelle sessions, including proper setup for |
|
36 |
presentation. Here \indexref{}{tool}{usedir}\hyperlink{tool.usedir}{\mbox{\isa{\isatool{usedir}}}} takes care to let |
|
37 |
\indexref{}{executable}{isabelle-process}\hyperlink{executable.isabelle-process}{\mbox{\isa{\isatt{isabelle{\isaliteral{2D}{\isacharminus}}process}}}} process run any additional |
|
38 |
stages required for document preparation, notably the tools |
|
39 |
\indexref{}{tool}{document}\hyperlink{tool.document}{\mbox{\isa{\isatool{document}}}} and \indexref{}{tool}{latex}\hyperlink{tool.latex}{\mbox{\isa{\isatool{latex}}}}. The complete tool chain |
|
40 |
for managing batch-mode Isabelle sessions is illustrated in |
|
28222 | 41 |
\figref{fig:session-tools}. |
42 |
||
43 |
\begin{figure}[htbp] |
|
44 |
\begin{center} |
|
45 |
\begin{tabular}{lp{0.6\textwidth}} |
|
46 |
||
48602 | 47 |
\indexref{}{tool}{mkdir}\hyperlink{tool.mkdir}{\mbox{\isa{\isatool{mkdir}}}} & invoked once by the user to create the |
48 |
initial source setup (common \verb|IsaMakefile| plus a |
|
49 |
single session directory); \\ |
|
28222 | 50 |
|
48602 | 51 |
\hyperlink{tool.make}{\mbox{\isa{\isatool{make}}}} & invoked repeatedly by the user to keep session |
52 |
output up-to-date (HTML, documents etc.); \\ |
|
28222 | 53 |
|
48602 | 54 |
\hyperlink{tool.usedir}{\mbox{\isa{\isatool{usedir}}}} & part of the standard \verb|IsaMakefile| |
55 |
entry of a session; \\ |
|
28238 | 56 |
|
48602 | 57 |
\hyperlink{executable.isabelle-process}{\mbox{\isa{\isatt{isabelle{\isaliteral{2D}{\isacharminus}}process}}}} & run through \indexref{}{tool}{usedir}\hyperlink{tool.usedir}{\mbox{\isa{\isatool{usedir}}}}; \\ |
28222 | 58 |
|
48602 | 59 |
\indexref{}{tool}{document}\hyperlink{tool.document}{\mbox{\isa{\isatool{document}}}} & run by the Isabelle process if document |
60 |
preparation is enabled; \\ |
|
28222 | 61 |
|
48602 | 62 |
\indexref{}{tool}{latex}\hyperlink{tool.latex}{\mbox{\isa{\isatool{latex}}}} & universal {\LaTeX} tool wrapper invoked |
63 |
multiple times by \indexref{}{tool}{document}\hyperlink{tool.document}{\mbox{\isa{\isatool{document}}}}; also useful for manual |
|
64 |
experiments; \\ |
|
28222 | 65 |
|
66 |
\end{tabular} |
|
67 |
\caption{The tool chain of Isabelle session presentation} \label{fig:session-tools} |
|
68 |
\end{center} |
|
69 |
\end{figure}% |
|
70 |
\end{isamarkuptext}% |
|
71 |
\isamarkuptrue% |
|
72 |
% |
|
73 |
\isamarkupsection{Generating theory browser information \label{sec:info}% |
|
74 |
} |
|
75 |
\isamarkuptrue% |
|
76 |
% |
|
77 |
\begin{isamarkuptext}% |
|
78 |
\index{theory browsing information|bold} |
|
79 |
||
80 |
As a side-effect of running a logic sessions, Isabelle is able to |
|
81 |
generate theory browsing information, including HTML documents that |
|
82 |
show a theory's definition, the theorems proved in its ML file and |
|
83 |
the relationship with its ancestors and descendants. Besides the |
|
84 |
HTML file that is generated for every theory, Isabelle stores links |
|
85 |
to all theories in an index file. These indexes are linked with |
|
86 |
other indexes to represent the overall tree structure of logic |
|
87 |
sessions. |
|
88 |
||
89 |
Isabelle also generates graph files that represent the theory |
|
90 |
hierarchy of a logic. There is a graph browser Java applet embedded |
|
91 |
in the generated HTML pages, and also a stand-alone application that |
|
92 |
allows browsing theory graphs without having to start a WWW client |
|
93 |
first. The latter version also includes features such as generating |
|
94 |
Postscript files, which are not available in the applet version. |
|
95 |
See \secref{sec:browse} for further information. |
|
96 |
||
97 |
\medskip |
|
98 |
||
99 |
The easiest way to let Isabelle generate theory browsing information |
|
100 |
for existing sessions is to append ``\verb|-i true|'' to the |
|
48602 | 101 |
\indexref{}{setting}{ISABELLE\_USEDIR\_OPTIONS}\hyperlink{setting.ISABELLE-USEDIR-OPTIONS}{\mbox{\isa{\isatt{ISABELLE{\isaliteral{5F}{\isacharunderscore}}USEDIR{\isaliteral{5F}{\isacharunderscore}}OPTIONS}}}} before invoking \hyperlink{tool.make}{\mbox{\isa{\isatool{make}}}}. |
102 |
For example, add something like this to your Isabelle settings file |
|
28222 | 103 |
|
104 |
\begin{ttbox} |
|
105 |
ISABELLE_USEDIR_OPTIONS="-i true" |
|
106 |
\end{ttbox} |
|
107 |
||
40802 | 108 |
and then change into the \verb|~~/src/FOL| directory and run |
48602 | 109 |
\hyperlink{tool.make}{\mbox{\isa{\isatool{make}}}}, or even \hyperlink{tool.make}{\mbox{\isa{\isatool{make}}}}~\verb|all|. The |
110 |
presentation output will appear in \verb|ISABELLE_BROWSER_INFO/FOL|, which usually refers to something like |
|
111 |
\verb|~/.isabelle/IsabelleXXXX/browser_info/FOL|. Note that |
|
112 |
option \verb|-v true| will make the internal runs of \hyperlink{tool.usedir}{\mbox{\isa{\isatool{usedir}}}} more explicit about such details. |
|
28222 | 113 |
|
40802 | 114 |
Many standard Isabelle sessions (such as \verb|~~/src/HOL/ex|) |
28238 | 115 |
also provide actual printable documents. These are prepared |
28222 | 116 |
automatically as well if enabled like this, using the \verb|-d| option |
117 |
\begin{ttbox} |
|
118 |
ISABELLE_USEDIR_OPTIONS="-i true -d dvi" |
|
119 |
\end{ttbox} |
|
120 |
Enabling options \verb|-i| and \verb|-d| |
|
28225 | 121 |
simultaneously as shown above causes an appropriate ``document'' |
28222 | 122 |
link to be included in the HTML index. Documents (or raw document |
123 |
sources) may be generated independently of browser information as |
|
124 |
well, see \secref{sec:tool-document} for further details. |
|
125 |
||
126 |
\bigskip The theory browsing information is stored in a |
|
40406 | 127 |
sub-directory directory determined by the \indexref{}{setting}{ISABELLE\_BROWSER\_INFO}\hyperlink{setting.ISABELLE-BROWSER-INFO}{\mbox{\isa{\isatt{ISABELLE{\isaliteral{5F}{\isacharunderscore}}BROWSER{\isaliteral{5F}{\isacharunderscore}}INFO}}}} setting plus a prefix corresponding to the |
28222 | 128 |
session identifier (according to the tree structure of sub-sessions |
129 |
by default). A complete WWW view of all standard object-logics and |
|
28225 | 130 |
examples of the Isabelle distribution is available at the usual |
131 |
Isabelle sites: |
|
28222 | 132 |
\begin{center}\small |
133 |
\begin{tabular}{l} |
|
28225 | 134 |
\url{http://isabelle.in.tum.de/dist/library/} \\ |
135 |
\url{http://www.cl.cam.ac.uk/research/hvg/Isabelle/dist/library/} \\ |
|
136 |
\url{http://mirror.cse.unsw.edu.au/pub/isabelle/dist/library/} \\ |
|
28222 | 137 |
\end{tabular} |
138 |
\end{center} |
|
139 |
||
140 |
\medskip In order to present your own theories on the web, simply |
|
40406 | 141 |
copy the corresponding subdirectory from \hyperlink{setting.ISABELLE-BROWSER-INFO}{\mbox{\isa{\isatt{ISABELLE{\isaliteral{5F}{\isacharunderscore}}BROWSER{\isaliteral{5F}{\isacharunderscore}}INFO}}}} to your WWW server, having generated browser |
28222 | 142 |
info like this: |
143 |
\begin{ttbox} |
|
28505 | 144 |
isabelle usedir -i true HOL Foo |
28222 | 145 |
\end{ttbox} |
146 |
||
147 |
This assumes that directory \verb|Foo| contains some \verb|ROOT.ML| file to load all your theories, and HOL is your parent |
|
48602 | 148 |
logic image (\indexref{}{tool}{mkdir}\hyperlink{tool.mkdir}{\mbox{\isa{\isatool{mkdir}}}} assists in setting up Isabelle |
149 |
session directories. Theory browser information for HOL should have |
|
150 |
been generated already beforehand. Alternatively, one may specify |
|
151 |
an external link to an existing body of HTML data by giving \hyperlink{tool.usedir}{\mbox{\isa{\isatool{usedir}}}} a \verb|-P| option like this: |
|
28222 | 152 |
\begin{ttbox} |
28505 | 153 |
isabelle usedir -i true -P http://isabelle.in.tum.de/library/ HOL Foo |
28222 | 154 |
\end{ttbox} |
155 |
||
48602 | 156 |
\medskip For production use, \hyperlink{tool.usedir}{\mbox{\isa{\isatool{usedir}}}} is usually invoked in an |
157 |
appropriate \verb|IsaMakefile|, via \hyperlink{tool.make}{\mbox{\isa{\isatool{make}}}}. There is a |
|
158 |
separate \hyperlink{tool.mkdir}{\mbox{\isa{\isatool{mkdir}}}} tool to provide easy setup of all this, with |
|
159 |
only minimal manual editing required. |
|
28222 | 160 |
\begin{ttbox} |
28505 | 161 |
isabelle mkdir HOL Foo && isabelle make |
28222 | 162 |
\end{ttbox} |
163 |
See \secref{sec:tool-mkdir} for more information on preparing |
|
164 |
Isabelle session directories, including the setup for documents.% |
|
165 |
\end{isamarkuptext}% |
|
166 |
\isamarkuptrue% |
|
167 |
% |
|
168 |
\isamarkupsection{Creating Isabelle session directories |
|
169 |
\label{sec:tool-mkdir}% |
|
170 |
} |
|
171 |
\isamarkuptrue% |
|
172 |
% |
|
173 |
\begin{isamarkuptext}% |
|
48602 | 174 |
The \indexdef{}{tool}{mkdir}\hypertarget{tool.mkdir}{\hyperlink{tool.mkdir}{\mbox{\isa{\isatool{mkdir}}}}} tool prepares Isabelle session source |
28222 | 175 |
directories, including a sensible default setup of \verb|IsaMakefile|, \verb|ROOT.ML|, and a \verb|document| |
176 |
directory with a minimal \verb|root.tex| that is sufficient to |
|
177 |
print all theories of the session (in the order of appearance); see |
|
178 |
\secref{sec:tool-document} for further information on Isabelle |
|
48602 | 179 |
document preparation. The usage of \hyperlink{tool.mkdir}{\mbox{\isa{\isatool{mkdir}}}} is: |
28222 | 180 |
|
181 |
\begin{ttbox} |
|
48602 | 182 |
Usage: isabelle mkdir [OPTIONS] [LOGIC] NAME |
28222 | 183 |
|
184 |
Options are: |
|
185 |
-I FILE alternative IsaMakefile output |
|
186 |
-P include parent logic target |
|
187 |
-b setup build mode (session outputs heap image) |
|
188 |
-q quiet mode |
|
189 |
||
190 |
Prepare session directory, including IsaMakefile and document source, |
|
191 |
with parent LOGIC (default ISABELLE_LOGIC=\$ISABELLE_LOGIC) |
|
192 |
\end{ttbox} |
|
193 |
||
48602 | 194 |
The \hyperlink{tool.mkdir}{\mbox{\isa{\isatool{mkdir}}}} tool is conservative in the sense that any |
28222 | 195 |
existing \verb|IsaMakefile| etc.\ is left unchanged. Thus it |
196 |
is safe to invoke it multiple times, although later runs may not |
|
197 |
have the desired effect. |
|
198 |
||
48602 | 199 |
Note that \hyperlink{tool.mkdir}{\mbox{\isa{\isatool{mkdir}}}} is unable to change \verb|IsaMakefile| |
28222 | 200 |
incrementally --- manual changes are required for multiple |
201 |
sub-sessions. On order to get an initial working session, the only |
|
202 |
editing needed is to add appropriate \verb|use_thy| calls to the |
|
203 |
generated \verb|ROOT.ML| file.% |
|
204 |
\end{isamarkuptext}% |
|
205 |
\isamarkuptrue% |
|
206 |
% |
|
207 |
\isamarkupsubsubsection{Options% |
|
208 |
} |
|
209 |
\isamarkuptrue% |
|
210 |
% |
|
211 |
\begin{isamarkuptext}% |
|
212 |
The \verb|-I| option specifies an alternative to \verb|IsaMakefile| for dependencies. Note that ``\verb|-|'' refers |
|
213 |
to \emph{stdout}, i.e.\ ``\verb|-I-|'' provides an easy way |
|
48602 | 214 |
to peek at \hyperlink{tool.mkdir}{\mbox{\isa{\isatool{mkdir}}}}'s idea of \hyperlink{tool.make}{\mbox{\isa{\isatool{make}}}} setup required for |
28222 | 215 |
some particular of Isabelle session. |
216 |
||
217 |
\medskip The \verb|-P| option includes a target for the |
|
218 |
parent \verb|LOGIC| session in the generated \verb|IsaMakefile|. The corresponding sources are assumed to be located |
|
219 |
within the Isabelle distribution. |
|
220 |
||
221 |
\medskip The \verb|-b| option sets up the current directory |
|
222 |
as the base for a new session that provides an actual logic image, |
|
223 |
as opposed to one that only runs several theories based on an |
|
224 |
existing image. Note that in the latter case, everything except |
|
225 |
\verb|IsaMakefile| would be placed into a separate directory |
|
226 |
\verb|NAME|, rather than the current one. See |
|
227 |
\secref{sec:tool-usedir} for further information on \emph{build |
|
48602 | 228 |
mode} vs.\ \emph{example mode} of \hyperlink{tool.usedir}{\mbox{\isa{\isatool{usedir}}}}. |
28222 | 229 |
|
230 |
\medskip The \verb|-q| option enables quiet mode, suppressing |
|
231 |
further notes on how to proceed.% |
|
232 |
\end{isamarkuptext}% |
|
233 |
\isamarkuptrue% |
|
234 |
% |
|
235 |
\isamarkupsubsubsection{Examples% |
|
236 |
} |
|
237 |
\isamarkuptrue% |
|
238 |
% |
|
239 |
\begin{isamarkuptext}% |
|
240 |
The standard setup of a single ``example session'' based on the |
|
241 |
default logic, with proper document generation is generated like |
|
242 |
this: |
|
243 |
\begin{ttbox} |
|
28505 | 244 |
isabelle mkdir Foo && isabelle make |
28222 | 245 |
\end{ttbox} |
246 |
||
247 |
\noindent The theory sources should be put into the \verb|Foo| |
|
248 |
directory, and its \verb|ROOT.ML| should be edited to load all |
|
48602 | 249 |
required theories. Invoking \hyperlink{tool.make}{\mbox{\isa{\isatool{make}}}} again would run the whole |
250 |
session, generating browser information and the document |
|
251 |
automatically. The \verb|IsaMakefile| is typically tuned |
|
252 |
manually later, e.g.\ adding source dependencies, or changing the |
|
253 |
options passed to \hyperlink{tool.usedir}{\mbox{\isa{\isatool{usedir}}}}. |
|
28222 | 254 |
|
255 |
\medskip Large projects may demand further sessions, potentially |
|
256 |
with separate logic images being created. This usually requires |
|
257 |
manual editing of the generated \verb|IsaMakefile|, which is |
|
258 |
meant to cover all of the sub-session directories at the same time |
|
259 |
(this is the deeper reasong why \verb|IsaMakefile| is not made |
|
48602 | 260 |
part of the initial session directory created by \hyperlink{tool.mkdir}{\mbox{\isa{\isatool{mkdir}}}}). |
261 |
See \verb|~~/src/HOL/IsaMakefile| for a full-blown example.% |
|
28222 | 262 |
\end{isamarkuptext}% |
263 |
\isamarkuptrue% |
|
264 |
% |
|
265 |
\isamarkupsection{Running Isabelle sessions \label{sec:tool-usedir}% |
|
266 |
} |
|
267 |
\isamarkuptrue% |
|
268 |
% |
|
269 |
\begin{isamarkuptext}% |
|
48602 | 270 |
The \indexdef{}{tool}{usedir}\hypertarget{tool.usedir}{\hyperlink{tool.usedir}{\mbox{\isa{\isatool{usedir}}}}} tool builds object-logic images, or |
271 |
runs example sessions based on existing logics. Its usage is: |
|
28222 | 272 |
\begin{ttbox} |
48602 | 273 |
Usage: isabelle usedir [OPTIONS] LOGIC NAME |
28222 | 274 |
|
275 |
Options are: |
|
276 |
-C BOOL copy existing document directory to -D PATH (default true) |
|
277 |
-D PATH dump generated document sources into PATH |
|
278 |
-M MAX multithreading: maximum number of worker threads (default 1) |
|
279 |
-P PATH set path for remote theory browsing information |
|
41819
2d84831dc1a0
scale parallel_proofs_threshold with max_threads_value to improve saturation of cores;
wenzelm
parents:
41703
diff
changeset
|
280 |
-Q INT set threshold for sub-proof parallelization (default 50) |
28222 | 281 |
-T LEVEL multithreading: trace level (default 0) |
42004 | 282 |
-V VARIANT declare alternative document VARIANT |
28222 | 283 |
-b build mode (output heap image, using current dir) |
284 |
-d FORMAT build document as FORMAT (default false) |
|
285 |
-f NAME use ML file NAME (default ROOT.ML) |
|
286 |
-g BOOL generate session graph image for document (default false) |
|
287 |
-i BOOL generate theory browser information (default false) |
|
288 |
-m MODE add print mode for output |
|
32061
11f8ee55662d
parallel_proofs: more fine-grained control with optional parallel checking of nested Isar proofs;
wenzelm
parents:
31688
diff
changeset
|
289 |
-p LEVEL set level of detail for proof objects (default 0) |
11f8ee55662d
parallel_proofs: more fine-grained control with optional parallel checking of nested Isar proofs;
wenzelm
parents:
31688
diff
changeset
|
290 |
-q LEVEL set level of parallel proof checking (default 1) |
28222 | 291 |
-r reset session path |
292 |
-s NAME override session NAME |
|
31688 | 293 |
-t BOOL internal session timing (default false) |
28222 | 294 |
-v BOOL be verbose (default false) |
295 |
||
296 |
Build object-logic or run examples. Also creates browsing |
|
297 |
information (HTML etc.) according to settings. |
|
298 |
||
47978 | 299 |
ISABELLE_USEDIR_OPTIONS=... |
29435
a5f84ac14609
added parallel_proofs flag (default true, cf. usedir option -Q), which can be disabled in low-memory situations;
wenzelm
parents:
28914
diff
changeset
|
300 |
|
47978 | 301 |
ML_PLATFORM=... |
302 |
ML_HOME=... |
|
303 |
ML_SYSTEM=... |
|
304 |
ML_OPTIONS=... |
|
28222 | 305 |
\end{ttbox} |
306 |
||
40406 | 307 |
Note that the value of the \indexref{}{setting}{ISABELLE\_USEDIR\_OPTIONS}\hyperlink{setting.ISABELLE-USEDIR-OPTIONS}{\mbox{\isa{\isatt{ISABELLE{\isaliteral{5F}{\isacharunderscore}}USEDIR{\isaliteral{5F}{\isacharunderscore}}OPTIONS}}}} |
48602 | 308 |
setting is implicitly prefixed to \emph{any} \hyperlink{tool.usedir}{\mbox{\isa{\isatool{usedir}}}} |
28222 | 309 |
call. Since the \verb|IsaMakefile|s of all object-logics |
48602 | 310 |
distributed with Isabelle just invoke \hyperlink{tool.usedir}{\mbox{\isa{\isatool{usedir}}}} for the real |
28222 | 311 |
work, one may control compilation options globally via above |
312 |
variable. In particular, generation of \rmindex{HTML} browsing |
|
34238 | 313 |
information and document preparation is controlled here.% |
28222 | 314 |
\end{isamarkuptext}% |
315 |
\isamarkuptrue% |
|
316 |
% |
|
317 |
\isamarkupsubsubsection{Options% |
|
318 |
} |
|
319 |
\isamarkuptrue% |
|
320 |
% |
|
321 |
\begin{isamarkuptext}% |
|
322 |
Basically, there are two different modes of operation: \emph{build |
|
323 |
mode} (enabled through the \verb|-b| option) and |
|
324 |
\emph{example mode} (default). |
|
325 |
||
48602 | 326 |
Calling \hyperlink{tool.usedir}{\mbox{\isa{\isatool{usedir}}}} with \verb|-b| runs \hyperlink{executable.isabelle-process}{\mbox{\isa{\isatt{isabelle{\isaliteral{2D}{\isacharminus}}process}}}} with input image \verb|LOGIC| and output to |
28222 | 327 |
\verb|NAME|, as provided on the command line. This will be a |
328 |
batch session, running \verb|ROOT.ML| from the current |
|
329 |
directory and then quitting. It is assumed that \verb|ROOT.ML| |
|
330 |
contains all ML commands required to build the logic. |
|
331 |
||
48602 | 332 |
In example mode, \hyperlink{tool.usedir}{\mbox{\isa{\isatool{usedir}}}} runs a read-only session of |
28222 | 333 |
\verb|LOGIC| and automatically runs \verb|ROOT.ML| from |
334 |
within directory \verb|NAME|. It assumes that this file |
|
335 |
contains appropriate ML commands to run the desired examples. |
|
336 |
||
337 |
\medskip The \verb|-i| option controls theory browser data |
|
338 |
generation. It may be explicitly turned on or off --- as usual, the |
|
339 |
last occurrence of \verb|-i| on the command line wins. |
|
340 |
||
341 |
The \verb|-P| option specifies a path (or actual URL) to be |
|
342 |
prefixed to any \emph{non-local} reference of existing theories. |
|
343 |
Thus user sessions may easily link to existing Isabelle libraries |
|
344 |
already present on the WWW. |
|
345 |
||
346 |
The \verb|-m| options specifies additional print modes to be |
|
347 |
activated temporarily while the session is processed. |
|
348 |
||
349 |
\medskip The \verb|-d| option controls document preparation. |
|
350 |
Valid arguments are \verb|false| (do not prepare any document; |
|
351 |
this is default), or any of \verb|dvi|, \verb|dvi.gz|, |
|
352 |
\verb|ps|, \verb|ps.gz|, \verb|pdf|. The logic |
|
353 |
session has to provide a properly setup \verb|document| |
|
354 |
directory. See \secref{sec:tool-document} and |
|
355 |
\secref{sec:tool-latex} for more details. |
|
356 |
||
357 |
\medskip The \verb|-V| option declares alternative document |
|
48602 | 358 |
variants, consisting of name/tags pairs (cf.\ options \verb|-n| and \verb|-t| of \indexref{}{tool}{document}\hyperlink{tool.document}{\mbox{\isa{\isatool{document}}}}). The standard |
359 |
document is equivalent to ``\verb|document=theory,proof,ML|'', which means that all theory begin/end |
|
28222 | 360 |
commands, proof body texts, and ML code will be presented |
48616
be8002ee43d8
document variant NAME may use different LaTeX entry point document/root_NAME.tex if that file exists;
wenzelm
parents:
48602
diff
changeset
|
361 |
faithfully. |
be8002ee43d8
document variant NAME may use different LaTeX entry point document/root_NAME.tex if that file exists;
wenzelm
parents:
48602
diff
changeset
|
362 |
|
be8002ee43d8
document variant NAME may use different LaTeX entry point document/root_NAME.tex if that file exists;
wenzelm
parents:
48602
diff
changeset
|
363 |
An alternative variant ``\verb|outline=/proof/ML|'' would |
be8002ee43d8
document variant NAME may use different LaTeX entry point document/root_NAME.tex if that file exists;
wenzelm
parents:
48602
diff
changeset
|
364 |
fold proof and ML parts, replacing the original text by a short |
be8002ee43d8
document variant NAME may use different LaTeX entry point document/root_NAME.tex if that file exists;
wenzelm
parents:
48602
diff
changeset
|
365 |
place-holder. The form ``\isa{name}\verb|=-|,'' means to |
be8002ee43d8
document variant NAME may use different LaTeX entry point document/root_NAME.tex if that file exists;
wenzelm
parents:
48602
diff
changeset
|
366 |
remove document \isa{name} from the list of variants to be |
be8002ee43d8
document variant NAME may use different LaTeX entry point document/root_NAME.tex if that file exists;
wenzelm
parents:
48602
diff
changeset
|
367 |
processed. Any number of \verb|-V| options may be given; |
be8002ee43d8
document variant NAME may use different LaTeX entry point document/root_NAME.tex if that file exists;
wenzelm
parents:
48602
diff
changeset
|
368 |
later declarations have precedence over earlier ones. |
be8002ee43d8
document variant NAME may use different LaTeX entry point document/root_NAME.tex if that file exists;
wenzelm
parents:
48602
diff
changeset
|
369 |
|
be8002ee43d8
document variant NAME may use different LaTeX entry point document/root_NAME.tex if that file exists;
wenzelm
parents:
48602
diff
changeset
|
370 |
Some document variant \isa{name} may use an alternative {\LaTeX} |
be8002ee43d8
document variant NAME may use different LaTeX entry point document/root_NAME.tex if that file exists;
wenzelm
parents:
48602
diff
changeset
|
371 |
entry point called \verb|document/root_|\isa{{\isaliteral{22}{\isachardoublequote}}name{\isaliteral{22}{\isachardoublequote}}}\verb|.tex| if that file exists; otherwise the common |
be8002ee43d8
document variant NAME may use different LaTeX entry point document/root_NAME.tex if that file exists;
wenzelm
parents:
48602
diff
changeset
|
372 |
\verb|document/root.tex| is used. |
28222 | 373 |
|
374 |
\medskip The \verb|-g| option produces images of the theory |
|
375 |
dependency graph (cf.\ \secref{sec:browse}) for inclusion in the |
|
376 |
generated document, both as \verb|session_graph.eps| and |
|
377 |
\verb|session_graph.pdf| at the same time. To include this in |
|
378 |
the final {\LaTeX} document one could say \verb|\includegraphics{session_graph}| in \verb|document/root.tex| (omitting the file-name extension enables |
|
379 |
{\LaTeX} to select to correct version, either for the DVI or PDF |
|
380 |
output path). |
|
381 |
||
382 |
\medskip The \verb|-D| option causes the generated document |
|
383 |
sources to be dumped at location \verb|PATH|; this path is |
|
384 |
relative to the session's main directory. If the \verb|-C| |
|
48602 | 385 |
option is true, this will include a copy of an existing \verb|document| directory as provided by the user. For example, \hyperlink{tool.usedir}{\mbox{\isa{\isatool{usedir}}}}~\verb|-D generated HOL Foo| produces a complete set |
386 |
of document sources at \verb|Foo/generated|. Subsequent |
|
387 |
invocation of \hyperlink{tool.document}{\mbox{\isa{\isatool{document}}}}~\verb|Foo/generated| (see also |
|
28238 | 388 |
\secref{sec:tool-document}) will process the final result |
389 |
independently of an Isabelle job. This decoupled mode of operation |
|
390 |
facilitates debugging of serious {\LaTeX} errors, for example. |
|
28222 | 391 |
|
392 |
\medskip The \verb|-p| option determines the level of detail |
|
393 |
for internal proof objects, see also the \emph{Isabelle Reference |
|
394 |
Manual}~\cite{isabelle-ref}. |
|
395 |
||
32061
11f8ee55662d
parallel_proofs: more fine-grained control with optional parallel checking of nested Isar proofs;
wenzelm
parents:
31688
diff
changeset
|
396 |
\medskip The \verb|-q| option specifies the level of parallel |
11f8ee55662d
parallel_proofs: more fine-grained control with optional parallel checking of nested Isar proofs;
wenzelm
parents:
31688
diff
changeset
|
397 |
proof checking: \verb|0| no proofs, \verb|1| toplevel |
11f8ee55662d
parallel_proofs: more fine-grained control with optional parallel checking of nested Isar proofs;
wenzelm
parents:
31688
diff
changeset
|
398 |
proofs (default), \verb|2| toplevel and nested Isar proofs. |
41703
d27950860514
parallelization of nested Isar proofs is subject to Goal.parallel_proofs_threshold;
wenzelm
parents:
40802
diff
changeset
|
399 |
The option \verb|-Q| specifies a threshold for \verb|-q2|: nested proofs are only parallelized when the current number |
41819
2d84831dc1a0
scale parallel_proofs_threshold with max_threads_value to improve saturation of cores;
wenzelm
parents:
41703
diff
changeset
|
400 |
of forked proofs falls below the given value (default 50), |
2d84831dc1a0
scale parallel_proofs_threshold with max_threads_value to improve saturation of cores;
wenzelm
parents:
41703
diff
changeset
|
401 |
multiplied by the number of worker threads (see option \verb|-M|). |
32061
11f8ee55662d
parallel_proofs: more fine-grained control with optional parallel checking of nested Isar proofs;
wenzelm
parents:
31688
diff
changeset
|
402 |
|
31688 | 403 |
\medskip The \verb|-t| option produces a more detailed |
404 |
internal timing report of the session. |
|
405 |
||
28222 | 406 |
\medskip The \verb|-v| option causes additional information |
407 |
to be printed while running the session, notably the location of |
|
408 |
prepared documents. |
|
409 |
||
410 |
\medskip The \verb|-M| option specifies the maximum number of |
|
41819
2d84831dc1a0
scale parallel_proofs_threshold with max_threads_value to improve saturation of cores;
wenzelm
parents:
41703
diff
changeset
|
411 |
parallel worker threads used for processing independent tasks when |
2d84831dc1a0
scale parallel_proofs_threshold with max_threads_value to improve saturation of cores;
wenzelm
parents:
41703
diff
changeset
|
412 |
checking theory sources (multithreading only works on suitable ML |
2d84831dc1a0
scale parallel_proofs_threshold with max_threads_value to improve saturation of cores;
wenzelm
parents:
41703
diff
changeset
|
413 |
platforms). The special value of \verb|0| or \verb|max| |
2d84831dc1a0
scale parallel_proofs_threshold with max_threads_value to improve saturation of cores;
wenzelm
parents:
41703
diff
changeset
|
414 |
refers to the number of actual CPU cores of the underlying machine, |
2d84831dc1a0
scale parallel_proofs_threshold with max_threads_value to improve saturation of cores;
wenzelm
parents:
41703
diff
changeset
|
415 |
which is a good starting point for optimal performance tuning. The |
2d84831dc1a0
scale parallel_proofs_threshold with max_threads_value to improve saturation of cores;
wenzelm
parents:
41703
diff
changeset
|
416 |
\verb|-T| option determines the level of detail in tracing |
2d84831dc1a0
scale parallel_proofs_threshold with max_threads_value to improve saturation of cores;
wenzelm
parents:
41703
diff
changeset
|
417 |
output concerning the internal locking and scheduling in |
2d84831dc1a0
scale parallel_proofs_threshold with max_threads_value to improve saturation of cores;
wenzelm
parents:
41703
diff
changeset
|
418 |
multithreaded operation. This may be helpful in isolating |
2d84831dc1a0
scale parallel_proofs_threshold with max_threads_value to improve saturation of cores;
wenzelm
parents:
41703
diff
changeset
|
419 |
performance bottle-necks, e.g.\ due to excessive wait states when |
2d84831dc1a0
scale parallel_proofs_threshold with max_threads_value to improve saturation of cores;
wenzelm
parents:
41703
diff
changeset
|
420 |
locking critical code sections. |
28222 | 421 |
|
48602 | 422 |
\medskip Any \hyperlink{tool.usedir}{\mbox{\isa{\isatool{usedir}}}} session is named by some \emph{session |
28222 | 423 |
identifier}. These accumulate, documenting the way sessions depend |
424 |
on others. For example, consider \verb|Pure/FOL/ex|, which |
|
425 |
refers to the examples of FOL, which in turn is built upon Pure. |
|
426 |
||
427 |
The current session's identifier is by default just the base name of |
|
428 |
the \verb|LOGIC| argument (in build mode), or of the \verb|NAME| argument (in example mode). This may be overridden explicitly |
|
429 |
via the \verb|-s| option.% |
|
430 |
\end{isamarkuptext}% |
|
431 |
\isamarkuptrue% |
|
432 |
% |
|
433 |
\isamarkupsubsubsection{Examples% |
|
434 |
} |
|
435 |
\isamarkuptrue% |
|
436 |
% |
|
437 |
\begin{isamarkuptext}% |
|
48602 | 438 |
Refer to the \verb|IsaMakefile|s of the Isabelle |
439 |
distribution's object-logics as a model for your own developments. |
|
440 |
For example, see \verb|~~/src/FOL/IsaMakefile|. The \indexref{}{tool}{mkdir}\hyperlink{tool.mkdir}{\mbox{\isa{\isatool{mkdir}}}} tool creates \verb|IsaMakefile|s with proper invocation |
|
441 |
of \hyperlink{tool.usedir}{\mbox{\isa{\isatool{usedir}}}} as well.% |
|
28222 | 442 |
\end{isamarkuptext}% |
443 |
\isamarkuptrue% |
|
444 |
% |
|
445 |
\isamarkupsection{Preparing Isabelle session documents |
|
446 |
\label{sec:tool-document}% |
|
447 |
} |
|
448 |
\isamarkuptrue% |
|
449 |
% |
|
450 |
\begin{isamarkuptext}% |
|
48602 | 451 |
The \indexdef{}{tool}{document}\hypertarget{tool.document}{\hyperlink{tool.document}{\mbox{\isa{\isatool{document}}}}} tool prepares logic session |
452 |
documents, processing the sources both as provided by the user and |
|
453 |
generated by Isabelle. Its usage is: |
|
28222 | 454 |
\begin{ttbox} |
48602 | 455 |
Usage: isabelle document [OPTIONS] [DIR] |
28222 | 456 |
|
457 |
Options are: |
|
458 |
-c cleanup -- be aggressive in removing old stuff |
|
459 |
-n NAME specify document name (default 'document') |
|
460 |
-o FORMAT specify output format: dvi (default), dvi.gz, ps, |
|
461 |
ps.gz, pdf |
|
462 |
-t TAGS specify tagged region markup |
|
463 |
||
464 |
Prepare the theory session document in DIR (default 'document') |
|
465 |
producing the specified output format. |
|
466 |
\end{ttbox} |
|
467 |
This tool is usually run automatically as part of the corresponding |
|
468 |
Isabelle batch process, provided document preparation has been |
|
48602 | 469 |
enabled (cf.\ the \verb|-d| option of \indexref{}{tool}{usedir}\hyperlink{tool.usedir}{\mbox{\isa{\isatool{usedir}}}}). |
470 |
It may be manually invoked on the generated browser information |
|
471 |
document output as well, e.g.\ in case of errors encountered in the |
|
472 |
batch run. |
|
28222 | 473 |
|
48602 | 474 |
\medskip The \verb|-c| option tells \hyperlink{tool.document}{\mbox{\isa{\isatool{document}}}} to |
475 |
dispose the document sources after successful operation. This is |
|
28222 | 476 |
the right thing to do for sources generated by an Isabelle process, |
477 |
but take care of your files in manual document preparation! |
|
478 |
||
479 |
\medskip The \verb|-n| and \verb|-o| option specify |
|
480 |
the final output file name and format, the default is ``\verb|document.dvi|''. Note that the result will appear in the parent of |
|
481 |
the target \verb|DIR|. |
|
482 |
||
483 |
\medskip The \verb|-t| option tells {\LaTeX} how to interpret |
|
484 |
tagged Isabelle command regions. Tags are specified as a comma |
|
485 |
separated list of modifier/name pairs: ``\verb|+|\isa{foo}'' (or just ``\isa{foo}'') means to keep, ``\verb|-|\isa{foo}'' to drop, and ``\verb|/|\isa{foo}'' to |
|
486 |
fold text tagged as \isa{foo}. The builtin default is equivalent |
|
30114 | 487 |
to the tag specification ``\verb|+theory,+proof,+ML,+visible,-invisible|''; see also the {\LaTeX} |
28222 | 488 |
macros \verb|\isakeeptag|, \verb|\isadroptag|, and |
40802 | 489 |
\verb|\isafoldtag|, in \verb|~~/lib/texinputs/isabelle.sty|. |
28222 | 490 |
|
491 |
\medskip Document preparation requires a properly setup ``\verb|document|'' directory within the logic session sources. This |
|
492 |
directory is supposed to contain all the files needed to produce the |
|
493 |
final document --- apart from the actual theories which are |
|
494 |
generated by Isabelle. |
|
495 |
||
48602 | 496 |
\medskip For most practical purposes, \hyperlink{tool.document}{\mbox{\isa{\isatool{document}}}} is smart |
497 |
enough to create any of the specified output formats, taking |
|
28222 | 498 |
\verb|root.tex| supplied by the user as a starting point. This |
499 |
even includes multiple runs of {\LaTeX} to accommodate references |
|
500 |
and bibliographies (the latter assumes \verb|root.bib| within |
|
501 |
the same directory). |
|
502 |
||
503 |
In more complex situations, a separate \verb|IsaMakefile| for |
|
504 |
the document sources may be given instead. This should provide |
|
505 |
targets for any admissible document format; these have to produce |
|
506 |
corresponding output files named after \verb|root| as well, |
|
507 |
e.g.\ \verb|root.dvi| for target format \verb|dvi|. |
|
508 |
||
42009
b008525c4399
parallel preparation of document variants, within separate directories;
wenzelm
parents:
42004
diff
changeset
|
509 |
\medskip When running the session, Isabelle copies the content of |
b008525c4399
parallel preparation of document variants, within separate directories;
wenzelm
parents:
42004
diff
changeset
|
510 |
the original \verb|document| directory into its proper place |
b008525c4399
parallel preparation of document variants, within separate directories;
wenzelm
parents:
42004
diff
changeset
|
511 |
within \hyperlink{setting.ISABELLE-BROWSER-INFO}{\mbox{\isa{\isatt{ISABELLE{\isaliteral{5F}{\isacharunderscore}}BROWSER{\isaliteral{5F}{\isacharunderscore}}INFO}}}}, according to the session |
b008525c4399
parallel preparation of document variants, within separate directories;
wenzelm
parents:
42004
diff
changeset
|
512 |
path and document variant. Then, for any processed theory \isa{A} |
b008525c4399
parallel preparation of document variants, within separate directories;
wenzelm
parents:
42004
diff
changeset
|
513 |
some {\LaTeX} source is generated and put there as \isa{A}\verb|.tex|. Furthermore, a list of all generated theory |
b008525c4399
parallel preparation of document variants, within separate directories;
wenzelm
parents:
42004
diff
changeset
|
514 |
files is put into \verb|session.tex|. Typically, the root |
b008525c4399
parallel preparation of document variants, within separate directories;
wenzelm
parents:
42004
diff
changeset
|
515 |
{\LaTeX} file provided by the user would include \verb|session.tex| to get a document containing all the theories. |
28222 | 516 |
|
517 |
The {\LaTeX} versions of the theories require some macros defined in |
|
40802 | 518 |
\verb|~~/lib/texinputs/isabelle.sty|. Doing \verb|\usepackage{isabelle}| in \verb|root.tex| should be fine; |
48602 | 519 |
the underlying \hyperlink{tool.latex}{\mbox{\isa{\isatool{latex}}}} already includes an appropriate path |
520 |
specification for {\TeX} inputs. |
|
28222 | 521 |
|
522 |
If the text contains any references to Isabelle symbols (such as |
|
28238 | 523 |
\verb|\|\verb|<forall>|) then \verb|isabellesym.sty| should be included as well. This package |
28838
d5db6dfcb34a
moved table of standard Isabelle symbols to isar-ref manual;
wenzelm
parents:
28505
diff
changeset
|
524 |
contains a standard set of {\LaTeX} macro definitions \verb|\isasym|\isa{foo} corresponding to \verb|\|\verb|<|\isa{foo}\verb|>|, see \cite{isabelle-implementation} for a |
d5db6dfcb34a
moved table of standard Isabelle symbols to isar-ref manual;
wenzelm
parents:
28505
diff
changeset
|
525 |
complete list of predefined Isabelle symbols. Users may invent |
28222 | 526 |
further symbols as well, just by providing {\LaTeX} macros in a |
40802 | 527 |
similar fashion as in \verb|~~/lib/texinputs/isabellesym.sty| of |
28238 | 528 |
the distribution. |
28222 | 529 |
|
530 |
For proper setup of DVI and PDF documents (with hyperlinks and |
|
40802 | 531 |
bookmarks), we recommend to include \verb|~~/lib/texinputs/pdfsetup.sty| as well. |
28222 | 532 |
|
533 |
\medskip As a final step of document preparation within Isabelle, |
|
48602 | 534 |
\hyperlink{tool.document}{\mbox{\isa{\isatool{document}}}}~\verb|-c| is run on the resulting \verb|document| directory. Thus the actual output document is built and |
535 |
installed in its proper place (as linked by the session's \verb|index.html| if option \verb|-i| of \indexref{}{tool}{usedir}\hyperlink{tool.usedir}{\mbox{\isa{\isatool{usedir}}}} has |
|
536 |
been enabled, cf.\ \secref{sec:info}). The generated sources are |
|
537 |
deleted after successful run of {\LaTeX} and friends. Note that a |
|
538 |
separate copy of the sources may be retained by passing an option |
|
539 |
\verb|-D| to \hyperlink{tool.usedir}{\mbox{\isa{\isatool{usedir}}}} when running the session.% |
|
28222 | 540 |
\end{isamarkuptext}% |
541 |
\isamarkuptrue% |
|
542 |
% |
|
543 |
\isamarkupsection{Running {\LaTeX} within the Isabelle environment |
|
544 |
\label{sec:tool-latex}% |
|
545 |
} |
|
546 |
\isamarkuptrue% |
|
547 |
% |
|
548 |
\begin{isamarkuptext}% |
|
48602 | 549 |
The \indexdef{}{tool}{latex}\hypertarget{tool.latex}{\hyperlink{tool.latex}{\mbox{\isa{\isatool{latex}}}}} tool provides the basic interface for |
28222 | 550 |
Isabelle document preparation. Its usage is: |
551 |
\begin{ttbox} |
|
48602 | 552 |
Usage: isabelle latex [OPTIONS] [FILE] |
28222 | 553 |
|
554 |
Options are: |
|
555 |
-o FORMAT specify output format: dvi (default), dvi.gz, ps, |
|
556 |
ps.gz, pdf, bbl, idx, sty, syms |
|
557 |
||
558 |
Run LaTeX (and related tools) on FILE (default root.tex), |
|
559 |
producing the specified output format. |
|
560 |
\end{ttbox} |
|
561 |
||
562 |
Appropriate {\LaTeX}-related programs are run on the input file, |
|
563 |
according to the given output format: \hyperlink{executable.latex}{\mbox{\isa{\isatt{latex}}}}, |
|
564 |
\hyperlink{executable.pdflatex}{\mbox{\isa{\isatt{pdflatex}}}}, \hyperlink{executable.dvips}{\mbox{\isa{\isatt{dvips}}}}, \hyperlink{executable.bibtex}{\mbox{\isa{\isatt{bibtex}}}} |
|
565 |
(for \verb|bbl|), and \hyperlink{executable.makeindex}{\mbox{\isa{\isatt{makeindex}}}} (for \verb|idx|). The actual commands are determined from the settings |
|
40406 | 566 |
environment (\hyperlink{setting.ISABELLE-LATEX}{\mbox{\isa{\isatt{ISABELLE{\isaliteral{5F}{\isacharunderscore}}LATEX}}}} etc.). |
28222 | 567 |
|
568 |
The \verb|sty| output format causes the Isabelle style files to |
|
569 |
be updated from the distribution. This is useful in special |
|
570 |
situations where the document sources are to be processed another |
|
48602 | 571 |
time by separate tools (cf.\ option \verb|-D| of \hyperlink{tool.usedir}{\mbox{\isa{\isatool{usedir}}}}). |
28222 | 572 |
|
573 |
The \verb|syms| output is for internal use; it generates lists |
|
574 |
of symbols that are available without loading additional {\LaTeX} |
|
575 |
packages.% |
|
576 |
\end{isamarkuptext}% |
|
577 |
\isamarkuptrue% |
|
578 |
% |
|
579 |
\isamarkupsubsubsection{Examples% |
|
580 |
} |
|
581 |
\isamarkuptrue% |
|
582 |
% |
|
583 |
\begin{isamarkuptext}% |
|
48602 | 584 |
Invoking \hyperlink{tool.latex}{\mbox{\isa{\isatool{latex}}}} by hand may be occasionally useful when |
585 |
debugging failed attempts of the automatic document preparation |
|
586 |
stage of batch-mode Isabelle. The abortive process leaves the |
|
587 |
sources at a certain place within \hyperlink{setting.ISABELLE-BROWSER-INFO}{\mbox{\isa{\isatt{ISABELLE{\isaliteral{5F}{\isacharunderscore}}BROWSER{\isaliteral{5F}{\isacharunderscore}}INFO}}}}, |
|
588 |
see the runtime error message for details. This enables users to |
|
589 |
inspect {\LaTeX} runs in further detail, e.g.\ like this: |
|
590 |
||
28222 | 591 |
\begin{ttbox} |
40387
e4c9e0dad473
moved ISABELLE_IDENTIFIER from ISABELLE_OUTPUT further up to ISABELLE_HOME_USER;
wenzelm
parents:
35587
diff
changeset
|
592 |
cd ~/.isabelle/IsabelleXXXX/browser_info/HOL/Test/document |
28505 | 593 |
isabelle latex -o pdf |
28222 | 594 |
\end{ttbox}% |
595 |
\end{isamarkuptext}% |
|
596 |
\isamarkuptrue% |
|
597 |
% |
|
598 |
\isadelimtheory |
|
599 |
% |
|
600 |
\endisadelimtheory |
|
601 |
% |
|
602 |
\isatagtheory |
|
603 |
\isacommand{end}\isamarkupfalse% |
|
604 |
% |
|
605 |
\endisatagtheory |
|
606 |
{\isafoldtheory}% |
|
607 |
% |
|
608 |
\isadelimtheory |
|
609 |
% |
|
610 |
\endisadelimtheory |
|
611 |
\end{isabellebody}% |
|
612 |
%%% Local Variables: |
|
613 |
%%% mode: latex |
|
614 |
%%% TeX-master: "root" |
|
615 |
%%% End: |