author | wenzelm |
Tue, 22 Feb 2011 19:44:15 +0100 | |
changeset 41819 | 2d84831dc1a0 |
parent 41703 | d27950860514 |
child 42004 | e06351ffb475 |
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 |
|
12 |
\isakeyword{imports}\ Pure\isanewline |
|
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 |
||
34 |
The Isabelle tools \indexref{}{tool}{mkdir}\hyperlink{tool.mkdir}{\mbox{\isa{\isatt{mkdir}}}} and \indexref{}{tool}{make}\hyperlink{tool.make}{\mbox{\isa{\isatt{make}}}} provide |
|
35 |
the primary means for managing Isabelle sessions, including proper |
|
36 |
setup for presentation. Here the \indexref{}{tool}{usedir}\hyperlink{tool.usedir}{\mbox{\isa{\isatt{usedir}}}} tool takes care |
|
40406 | 37 |
to let \indexref{}{executable}{isabelle-process}\hyperlink{executable.isabelle-process}{\mbox{\isa{\isatt{isabelle{\isaliteral{2D}{\isacharminus}}process}}}} process run any |
28222 | 38 |
additional stages required for document preparation, notably the |
39 |
tools \indexref{}{tool}{document}\hyperlink{tool.document}{\mbox{\isa{\isatt{document}}}} and \indexref{}{tool}{latex}\hyperlink{tool.latex}{\mbox{\isa{\isatt{latex}}}}. The complete tool |
|
40 |
chain for managing batch-mode Isabelle sessions is illustrated in |
|
41 |
\figref{fig:session-tools}. |
|
42 |
||
43 |
\begin{figure}[htbp] |
|
44 |
\begin{center} |
|
45 |
\begin{tabular}{lp{0.6\textwidth}} |
|
46 |
||
28505 | 47 |
\verb|isabelle| \indexref{}{tool}{mkdir}\hyperlink{tool.mkdir}{\mbox{\isa{\isatt{mkdir}}}} & invoked once by the user |
28238 | 48 |
to create the initial source setup (common \verb|IsaMakefile| plus a single session directory); \\ |
28222 | 49 |
|
28505 | 50 |
\verb|isabelle| \hyperlink{tool.make}{\mbox{\isa{\isatt{make}}}} & invoked repeatedly by the |
28238 | 51 |
user to keep session output up-to-date (HTML, documents etc.); \\ |
28222 | 52 |
|
28505 | 53 |
\verb|isabelle| \hyperlink{tool.usedir}{\mbox{\isa{\isatt{usedir}}}} & part of the standard |
28238 | 54 |
\verb|IsaMakefile| entry of a session; \\ |
55 |
||
40406 | 56 |
\hyperlink{executable.isabelle-process}{\mbox{\isa{\isatt{isabelle{\isaliteral{2D}{\isacharminus}}process}}}} & run through \verb|isabelle| \indexref{}{tool}{usedir}\hyperlink{tool.usedir}{\mbox{\isa{\isatt{usedir}}}}; \\ |
28222 | 57 |
|
28505 | 58 |
\verb|isabelle| \indexref{}{tool}{document}\hyperlink{tool.document}{\mbox{\isa{\isatt{document}}}} & run by the Isabelle |
28238 | 59 |
process if document preparation is enabled; \\ |
28222 | 60 |
|
28505 | 61 |
\verb|isabelle| \indexref{}{tool}{latex}\hyperlink{tool.latex}{\mbox{\isa{\isatt{latex}}}} & universal {\LaTeX} tool |
62 |
wrapper invoked multiple times by \verb|isabelle| \indexref{}{tool}{document}\hyperlink{tool.document}{\mbox{\isa{\isatt{document}}}}; also useful for manual experiments; \\ |
|
28222 | 63 |
|
64 |
\end{tabular} |
|
65 |
\caption{The tool chain of Isabelle session presentation} \label{fig:session-tools} |
|
66 |
\end{center} |
|
67 |
\end{figure}% |
|
68 |
\end{isamarkuptext}% |
|
69 |
\isamarkuptrue% |
|
70 |
% |
|
71 |
\isamarkupsection{Generating theory browser information \label{sec:info}% |
|
72 |
} |
|
73 |
\isamarkuptrue% |
|
74 |
% |
|
75 |
\begin{isamarkuptext}% |
|
76 |
\index{theory browsing information|bold} |
|
77 |
||
78 |
As a side-effect of running a logic sessions, Isabelle is able to |
|
79 |
generate theory browsing information, including HTML documents that |
|
80 |
show a theory's definition, the theorems proved in its ML file and |
|
81 |
the relationship with its ancestors and descendants. Besides the |
|
82 |
HTML file that is generated for every theory, Isabelle stores links |
|
83 |
to all theories in an index file. These indexes are linked with |
|
84 |
other indexes to represent the overall tree structure of logic |
|
85 |
sessions. |
|
86 |
||
87 |
Isabelle also generates graph files that represent the theory |
|
88 |
hierarchy of a logic. There is a graph browser Java applet embedded |
|
89 |
in the generated HTML pages, and also a stand-alone application that |
|
90 |
allows browsing theory graphs without having to start a WWW client |
|
91 |
first. The latter version also includes features such as generating |
|
92 |
Postscript files, which are not available in the applet version. |
|
93 |
See \secref{sec:browse} for further information. |
|
94 |
||
95 |
\medskip |
|
96 |
||
97 |
The easiest way to let Isabelle generate theory browsing information |
|
98 |
for existing sessions is to append ``\verb|-i true|'' to the |
|
40802 | 99 |
\indexref{}{setting}{ISABELLE\_USEDIR\_OPTIONS}\hyperlink{setting.ISABELLE-USEDIR-OPTIONS}{\mbox{\isa{\isatt{ISABELLE{\isaliteral{5F}{\isacharunderscore}}USEDIR{\isaliteral{5F}{\isacharunderscore}}OPTIONS}}}} before invoking \verb|isabelle| \hyperlink{tool.make}{\mbox{\isa{\isatt{make}}}} (or \verb|$ISABELLE_HOME/build|). For |
28222 | 100 |
example, add something like this to your Isabelle settings file |
101 |
||
102 |
\begin{ttbox} |
|
103 |
ISABELLE_USEDIR_OPTIONS="-i true" |
|
104 |
\end{ttbox} |
|
105 |
||
40802 | 106 |
and then change into the \verb|~~/src/FOL| directory and run |
40387
e4c9e0dad473
moved ISABELLE_IDENTIFIER from ISABELLE_OUTPUT further up to ISABELLE_HOME_USER;
wenzelm
parents:
35587
diff
changeset
|
107 |
\verb|isabelle| \hyperlink{tool.make}{\mbox{\isa{\isatt{make}}}}, or even \verb|isabelle| |
e4c9e0dad473
moved ISABELLE_IDENTIFIER from ISABELLE_OUTPUT further up to ISABELLE_HOME_USER;
wenzelm
parents:
35587
diff
changeset
|
108 |
\hyperlink{tool.make}{\mbox{\isa{\isatt{make}}}}~\verb|all|. The presentation output will appear |
e4c9e0dad473
moved ISABELLE_IDENTIFIER from ISABELLE_OUTPUT further up to ISABELLE_HOME_USER;
wenzelm
parents:
35587
diff
changeset
|
109 |
in \verb|ISABELLE_BROWSER_INFO/FOL|, which usually refers to |
e4c9e0dad473
moved ISABELLE_IDENTIFIER from ISABELLE_OUTPUT further up to ISABELLE_HOME_USER;
wenzelm
parents:
35587
diff
changeset
|
110 |
something like \verb|~/.isabelle/IsabelleXXXX/browser_info/FOL|. Note that option |
28222 | 111 |
\verb|-v true| will make the internal runs of \hyperlink{tool.usedir}{\mbox{\isa{\isatt{usedir}}}} |
112 |
more explicit about such details. |
|
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 |
|
28505 | 148 |
logic image (\verb|isabelle| \indexref{}{tool}{mkdir}\hyperlink{tool.mkdir}{\mbox{\isa{\isatt{mkdir}}}} assists in |
28222 | 149 |
setting up Isabelle session directories. Theory browser information |
150 |
for HOL should have been generated already beforehand. |
|
151 |
Alternatively, one may specify an external link to an existing body |
|
152 |
of HTML data by giving \hyperlink{tool.usedir}{\mbox{\isa{\isatt{usedir}}}} a \verb|-P| option like |
|
153 |
this: |
|
154 |
\begin{ttbox} |
|
28505 | 155 |
isabelle usedir -i true -P http://isabelle.in.tum.de/library/ HOL Foo |
28222 | 156 |
\end{ttbox} |
157 |
||
158 |
\medskip For production use, the \hyperlink{tool.usedir}{\mbox{\isa{\isatt{usedir}}}} tool is usually |
|
159 |
invoked in an appropriate \verb|IsaMakefile|, via the Isabelle |
|
160 |
\hyperlink{tool.make}{\mbox{\isa{\isatt{make}}}} tool. There is a separate \hyperlink{tool.mkdir}{\mbox{\isa{\isatt{mkdir}}}} tool to |
|
161 |
provide easy setup of all this, with only minimal manual editing |
|
162 |
required. |
|
163 |
\begin{ttbox} |
|
28505 | 164 |
isabelle mkdir HOL Foo && isabelle make |
28222 | 165 |
\end{ttbox} |
166 |
See \secref{sec:tool-mkdir} for more information on preparing |
|
167 |
Isabelle session directories, including the setup for documents.% |
|
168 |
\end{isamarkuptext}% |
|
169 |
\isamarkuptrue% |
|
170 |
% |
|
171 |
\isamarkupsection{Browsing theory graphs \label{sec:browse}% |
|
172 |
} |
|
173 |
\isamarkuptrue% |
|
174 |
% |
|
175 |
\begin{isamarkuptext}% |
|
176 |
\index{theory graph browser|bold} |
|
177 |
||
178 |
The Isabelle graph browser is a general tool for visualizing |
|
179 |
dependency graphs. Certain nodes of the graph (i.e.~theories) can |
|
180 |
be grouped together in ``directories'', whose contents may be |
|
181 |
hidden, thus enabling the user to collapse irrelevant portions of |
|
182 |
information. The browser is written in Java, it can be used both as |
|
183 |
a stand-alone application and as an applet. Note that the option |
|
28505 | 184 |
\verb|-g| of \verb|isabelle| \indexref{}{tool}{usedir}\hyperlink{tool.usedir}{\mbox{\isa{\isatt{usedir}}}} creates |
28222 | 185 |
graph presentations in batch mode for inclusion in session |
186 |
documents.% |
|
187 |
\end{isamarkuptext}% |
|
188 |
\isamarkuptrue% |
|
189 |
% |
|
190 |
\isamarkupsubsection{Invoking the graph browser% |
|
191 |
} |
|
192 |
\isamarkuptrue% |
|
193 |
% |
|
194 |
\begin{isamarkuptext}% |
|
195 |
The stand-alone version of the graph browser is wrapped up as an |
|
196 |
Isabelle tool called \indexdef{}{tool}{browser}\hypertarget{tool.browser}{\hyperlink{tool.browser}{\mbox{\isa{\isatt{browser}}}}}: |
|
197 |
||
198 |
\begin{ttbox} |
|
199 |
Usage: browser [OPTIONS] [GRAPHFILE] |
|
200 |
||
201 |
Options are: |
|
35587 | 202 |
-b Admin/build only |
28222 | 203 |
-c cleanup -- remove GRAPHFILE after use |
204 |
-o FILE output to FILE (ps, eps, pdf) |
|
205 |
\end{ttbox} |
|
206 |
When no filename is specified, the browser automatically changes to |
|
40406 | 207 |
the directory \hyperlink{setting.ISABELLE-BROWSER-INFO}{\mbox{\isa{\isatt{ISABELLE{\isaliteral{5F}{\isacharunderscore}}BROWSER{\isaliteral{5F}{\isacharunderscore}}INFO}}}}. |
28222 | 208 |
|
35587 | 209 |
\medskip The \verb|-b| option indicates that this is for |
210 |
administrative build only, i.e.\ no browser popup if no files are |
|
211 |
given. |
|
212 |
||
213 |
The \verb|-c| option causes the input file to be removed |
|
214 |
after use. |
|
28222 | 215 |
|
216 |
The \verb|-o| option indicates batch-mode operation, with the |
|
217 |
output written to the indicated file; note that \verb|pdf| |
|
218 |
produces an \verb|eps| copy as well. |
|
219 |
||
220 |
\medskip The applet version of the browser is part of the standard |
|
221 |
WWW theory presentation, see the link ``theory dependencies'' within |
|
222 |
each session index.% |
|
223 |
\end{isamarkuptext}% |
|
224 |
\isamarkuptrue% |
|
225 |
% |
|
226 |
\isamarkupsubsection{Using the graph browser% |
|
227 |
} |
|
228 |
\isamarkuptrue% |
|
229 |
% |
|
230 |
\begin{isamarkuptext}% |
|
231 |
The browser's main window, which is shown in |
|
232 |
\figref{fig:browserwindow}, consists of two sub-windows. In the |
|
233 |
left sub-window, the directory tree is displayed. The graph itself |
|
234 |
is displayed in the right sub-window. |
|
235 |
||
236 |
\begin{figure}[ht] |
|
237 |
\includegraphics[width=\textwidth]{browser_screenshot} |
|
238 |
\caption{\label{fig:browserwindow} Browser main window} |
|
239 |
\end{figure}% |
|
240 |
\end{isamarkuptext}% |
|
241 |
\isamarkuptrue% |
|
242 |
% |
|
243 |
\isamarkupsubsubsection{The directory tree window% |
|
244 |
} |
|
245 |
\isamarkuptrue% |
|
246 |
% |
|
247 |
\begin{isamarkuptext}% |
|
248 |
We describe the usage of the directory browser and the meaning of |
|
249 |
the different items in the browser window. |
|
250 |
||
251 |
\begin{itemize} |
|
252 |
||
253 |
\item A red arrow before a directory name indicates that the |
|
254 |
directory is currently ``folded'', i.e.~the nodes in this directory |
|
255 |
are collapsed to one single node. In the right sub-window, the names |
|
256 |
of nodes corresponding to folded directories are enclosed in square |
|
257 |
brackets and displayed in red color. |
|
258 |
||
259 |
\item A green downward arrow before a directory name indicates that |
|
260 |
the directory is currently ``unfolded''. It can be folded by |
|
261 |
clicking on the directory name. Clicking on the name for a second |
|
262 |
time unfolds the directory again. Alternatively, a directory can |
|
263 |
also be unfolded by clicking on the corresponding node in the right |
|
264 |
sub-window. |
|
265 |
||
266 |
\item Blue arrows stand before ordinary node names. When clicking on |
|
267 |
such a name (i.e.\ that of a theory), the graph display window |
|
268 |
focuses to the corresponding node. Double clicking invokes a text |
|
269 |
viewer window in which the contents of the theory file are |
|
270 |
displayed. |
|
271 |
||
272 |
\end{itemize}% |
|
273 |
\end{isamarkuptext}% |
|
274 |
\isamarkuptrue% |
|
275 |
% |
|
276 |
\isamarkupsubsubsection{The graph display window% |
|
277 |
} |
|
278 |
\isamarkuptrue% |
|
279 |
% |
|
280 |
\begin{isamarkuptext}% |
|
281 |
When pointing on an ordinary node, an upward and a downward arrow is |
|
282 |
shown. Initially, both of these arrows are green. Clicking on the |
|
283 |
upward or downward arrow collapses all predecessor or successor |
|
284 |
nodes, respectively. The arrow's color then changes to red, |
|
285 |
indicating that the predecessor or successor nodes are currently |
|
286 |
collapsed. The node corresponding to the collapsed nodes has the |
|
287 |
name ``\verb|[....]|''. To uncollapse the nodes again, simply |
|
288 |
click on the red arrow or on the node with the name ``\verb|[....]|''. Similar to the directory browser, the contents of |
|
289 |
theory files can be displayed by double clicking on the |
|
290 |
corresponding node.% |
|
291 |
\end{isamarkuptext}% |
|
292 |
\isamarkuptrue% |
|
293 |
% |
|
294 |
\isamarkupsubsubsection{The ``File'' menu% |
|
295 |
} |
|
296 |
\isamarkuptrue% |
|
297 |
% |
|
298 |
\begin{isamarkuptext}% |
|
299 |
Due to Java Applet security restrictions this menu is only available |
|
300 |
in the full application version. The meaning of the menu items is as |
|
301 |
follows: |
|
302 |
||
303 |
\begin{description} |
|
304 |
||
305 |
\item[Open \dots] Open a new graph file. |
|
306 |
||
307 |
\item[Export to PostScript] Outputs the current graph in Postscript |
|
308 |
format, appropriately scaled to fit on one single sheet of A4 paper. |
|
309 |
The resulting file can be printed directly. |
|
310 |
||
311 |
\item[Export to EPS] Outputs the current graph in Encapsulated |
|
312 |
Postscript format. The resulting file can be included in other |
|
313 |
documents. |
|
314 |
||
315 |
\item[Quit] Quit the graph browser. |
|
316 |
||
317 |
\end{description}% |
|
318 |
\end{isamarkuptext}% |
|
319 |
\isamarkuptrue% |
|
320 |
% |
|
321 |
\isamarkupsubsection{Syntax of graph definition files% |
|
322 |
} |
|
323 |
\isamarkuptrue% |
|
324 |
% |
|
325 |
\begin{isamarkuptext}% |
|
326 |
A graph definition file has the following syntax: |
|
327 |
||
28225 | 328 |
\begin{center}\small |
28222 | 329 |
\begin{tabular}{rcl} |
40406 | 330 |
\isa{graph} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3D}{\isacharequal}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7B}{\isacharbraceleft}}\ vertex{\isaliteral{22}{\isachardoublequote}}}~\verb|;|~\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7D}{\isacharbraceright}}{\isaliteral{2B}{\isacharplus}}{\isaliteral{22}{\isachardoublequote}}} \\ |
331 |
\isa{vertex} & \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3D}{\isacharequal}}{\isaliteral{22}{\isachardoublequote}}} & \isa{{\isaliteral{22}{\isachardoublequote}}vertex{\isaliteral{5F}{\isacharunderscore}}name\ vertex{\isaliteral{5F}{\isacharunderscore}}ID\ dir{\isaliteral{5F}{\isacharunderscore}}name\ {\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{22}{\isachardoublequote}}}~\verb|+|~\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5D}{\isacharbrackright}}\ path\ {\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{22}{\isachardoublequote}}}~\verb|<|~\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}}~\verb|>|~\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5D}{\isacharbrackright}}\ {\isaliteral{7B}{\isacharbraceleft}}\ vertex{\isaliteral{5F}{\isacharunderscore}}ID\ {\isaliteral{7D}{\isacharbraceright}}{\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} |
|
28222 | 332 |
\end{tabular} |
28225 | 333 |
\end{center} |
28222 | 334 |
|
335 |
The meaning of the items in a vertex description is as follows: |
|
336 |
||
337 |
\begin{description} |
|
338 |
||
40406 | 339 |
\item[\isa{vertex{\isaliteral{5F}{\isacharunderscore}}name}] The name of the vertex. |
28222 | 340 |
|
40406 | 341 |
\item[\isa{vertex{\isaliteral{5F}{\isacharunderscore}}ID}] The vertex identifier. Note that there may |
28222 | 342 |
be several vertices with equal names, whereas identifiers must be |
343 |
unique. |
|
344 |
||
40406 | 345 |
\item[\isa{dir{\isaliteral{5F}{\isacharunderscore}}name}] The name of the ``directory'' the vertex |
346 |
should be placed in. A ``\verb|+|'' sign after \isa{dir{\isaliteral{5F}{\isacharunderscore}}name} indicates that the nodes in the directory are initially |
|
28222 | 347 |
visible. Directories are initially invisible by default. |
348 |
||
349 |
\item[\isa{path}] The path of the corresponding theory file. This |
|
350 |
is specified relatively to the path of the graph definition file. |
|
351 |
||
352 |
\item[List of successor/predecessor nodes] A ``\verb|<|'' |
|
353 |
sign before the list means that successor nodes are listed, a |
|
354 |
``\verb|>|'' sign means that predecessor nodes are listed. If |
|
355 |
neither ``\verb|<|'' nor ``\verb|>|'' is found, the |
|
356 |
browser assumes that successor nodes are listed. |
|
357 |
||
358 |
\end{description}% |
|
359 |
\end{isamarkuptext}% |
|
360 |
\isamarkuptrue% |
|
361 |
% |
|
362 |
\isamarkupsection{Creating Isabelle session directories |
|
363 |
\label{sec:tool-mkdir}% |
|
364 |
} |
|
365 |
\isamarkuptrue% |
|
366 |
% |
|
367 |
\begin{isamarkuptext}% |
|
368 |
The \indexdef{}{tool}{mkdir}\hypertarget{tool.mkdir}{\hyperlink{tool.mkdir}{\mbox{\isa{\isatt{mkdir}}}}} utility prepares Isabelle session source |
|
369 |
directories, including a sensible default setup of \verb|IsaMakefile|, \verb|ROOT.ML|, and a \verb|document| |
|
370 |
directory with a minimal \verb|root.tex| that is sufficient to |
|
371 |
print all theories of the session (in the order of appearance); see |
|
372 |
\secref{sec:tool-document} for further information on Isabelle |
|
28505 | 373 |
document preparation. The usage of \verb|isabelle| \hyperlink{tool.mkdir}{\mbox{\isa{\isatt{mkdir}}}} is: |
28222 | 374 |
|
375 |
\begin{ttbox} |
|
376 |
Usage: mkdir [OPTIONS] [LOGIC] NAME |
|
377 |
||
378 |
Options are: |
|
379 |
-I FILE alternative IsaMakefile output |
|
380 |
-P include parent logic target |
|
381 |
-b setup build mode (session outputs heap image) |
|
382 |
-q quiet mode |
|
383 |
||
384 |
Prepare session directory, including IsaMakefile and document source, |
|
385 |
with parent LOGIC (default ISABELLE_LOGIC=\$ISABELLE_LOGIC) |
|
386 |
\end{ttbox} |
|
387 |
||
388 |
The \hyperlink{tool.mkdir}{\mbox{\isa{\isatt{mkdir}}}} tool is conservative in the sense that any |
|
389 |
existing \verb|IsaMakefile| etc.\ is left unchanged. Thus it |
|
390 |
is safe to invoke it multiple times, although later runs may not |
|
391 |
have the desired effect. |
|
392 |
||
393 |
Note that \hyperlink{tool.mkdir}{\mbox{\isa{\isatt{mkdir}}}} is unable to change \verb|IsaMakefile| |
|
394 |
incrementally --- manual changes are required for multiple |
|
395 |
sub-sessions. On order to get an initial working session, the only |
|
396 |
editing needed is to add appropriate \verb|use_thy| calls to the |
|
397 |
generated \verb|ROOT.ML| file.% |
|
398 |
\end{isamarkuptext}% |
|
399 |
\isamarkuptrue% |
|
400 |
% |
|
401 |
\isamarkupsubsubsection{Options% |
|
402 |
} |
|
403 |
\isamarkuptrue% |
|
404 |
% |
|
405 |
\begin{isamarkuptext}% |
|
406 |
The \verb|-I| option specifies an alternative to \verb|IsaMakefile| for dependencies. Note that ``\verb|-|'' refers |
|
407 |
to \emph{stdout}, i.e.\ ``\verb|-I-|'' provides an easy way |
|
408 |
to peek at \hyperlink{tool.mkdir}{\mbox{\isa{\isatt{mkdir}}}}'s idea of \hyperlink{tool.make}{\mbox{\isa{\isatt{make}}}} setup required for |
|
409 |
some particular of Isabelle session. |
|
410 |
||
411 |
\medskip The \verb|-P| option includes a target for the |
|
412 |
parent \verb|LOGIC| session in the generated \verb|IsaMakefile|. The corresponding sources are assumed to be located |
|
413 |
within the Isabelle distribution. |
|
414 |
||
415 |
\medskip The \verb|-b| option sets up the current directory |
|
416 |
as the base for a new session that provides an actual logic image, |
|
417 |
as opposed to one that only runs several theories based on an |
|
418 |
existing image. Note that in the latter case, everything except |
|
419 |
\verb|IsaMakefile| would be placed into a separate directory |
|
420 |
\verb|NAME|, rather than the current one. See |
|
421 |
\secref{sec:tool-usedir} for further information on \emph{build |
|
422 |
mode} vs.\ \emph{example mode} of the \hyperlink{tool.usedir}{\mbox{\isa{\isatt{usedir}}}} utility. |
|
423 |
||
424 |
\medskip The \verb|-q| option enables quiet mode, suppressing |
|
425 |
further notes on how to proceed.% |
|
426 |
\end{isamarkuptext}% |
|
427 |
\isamarkuptrue% |
|
428 |
% |
|
429 |
\isamarkupsubsubsection{Examples% |
|
430 |
} |
|
431 |
\isamarkuptrue% |
|
432 |
% |
|
433 |
\begin{isamarkuptext}% |
|
434 |
The standard setup of a single ``example session'' based on the |
|
435 |
default logic, with proper document generation is generated like |
|
436 |
this: |
|
437 |
\begin{ttbox} |
|
28505 | 438 |
isabelle mkdir Foo && isabelle make |
28222 | 439 |
\end{ttbox} |
440 |
||
441 |
\noindent The theory sources should be put into the \verb|Foo| |
|
442 |
directory, and its \verb|ROOT.ML| should be edited to load all |
|
28505 | 443 |
required theories. Invoking \verb|isabelle| \hyperlink{tool.make}{\mbox{\isa{\isatt{make}}}} again |
28238 | 444 |
would run the whole session, generating browser information and the |
28222 | 445 |
document automatically. The \verb|IsaMakefile| is typically |
446 |
tuned manually later, e.g.\ adding source dependencies, or changing |
|
447 |
the options passed to \hyperlink{tool.usedir}{\mbox{\isa{\isatt{usedir}}}}. |
|
448 |
||
449 |
\medskip Large projects may demand further sessions, potentially |
|
450 |
with separate logic images being created. This usually requires |
|
451 |
manual editing of the generated \verb|IsaMakefile|, which is |
|
452 |
meant to cover all of the sub-session directories at the same time |
|
453 |
(this is the deeper reasong why \verb|IsaMakefile| is not made |
|
40802 | 454 |
part of the initial session directory created by \verb|isabelle| \hyperlink{tool.mkdir}{\mbox{\isa{\isatt{mkdir}}}}). See \verb|~~/src/HOL/IsaMakefile| for |
28238 | 455 |
a full-blown example.% |
28222 | 456 |
\end{isamarkuptext}% |
457 |
\isamarkuptrue% |
|
458 |
% |
|
459 |
\isamarkupsection{Running Isabelle sessions \label{sec:tool-usedir}% |
|
460 |
} |
|
461 |
\isamarkuptrue% |
|
462 |
% |
|
463 |
\begin{isamarkuptext}% |
|
464 |
The \indexdef{}{tool}{usedir}\hypertarget{tool.usedir}{\hyperlink{tool.usedir}{\mbox{\isa{\isatt{usedir}}}}} utility builds object-logic images, or runs |
|
465 |
example sessions based on existing logics. Its usage is: |
|
466 |
\begin{ttbox} |
|
467 |
||
468 |
Usage: usedir [OPTIONS] LOGIC NAME |
|
469 |
||
470 |
Options are: |
|
471 |
-C BOOL copy existing document directory to -D PATH (default true) |
|
472 |
-D PATH dump generated document sources into PATH |
|
473 |
-M MAX multithreading: maximum number of worker threads (default 1) |
|
474 |
-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
|
475 |
-Q INT set threshold for sub-proof parallelization (default 50) |
28222 | 476 |
-T LEVEL multithreading: trace level (default 0) |
477 |
-V VERSION declare alternative document VERSION |
|
478 |
-b build mode (output heap image, using current dir) |
|
479 |
-d FORMAT build document as FORMAT (default false) |
|
480 |
-f NAME use ML file NAME (default ROOT.ML) |
|
481 |
-g BOOL generate session graph image for document (default false) |
|
482 |
-i BOOL generate theory browser information (default false) |
|
483 |
-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
|
484 |
-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
|
485 |
-q LEVEL set level of parallel proof checking (default 1) |
28222 | 486 |
-r reset session path |
487 |
-s NAME override session NAME |
|
31688 | 488 |
-t BOOL internal session timing (default false) |
28222 | 489 |
-v BOOL be verbose (default false) |
490 |
||
491 |
Build object-logic or run examples. Also creates browsing |
|
492 |
information (HTML etc.) according to settings. |
|
493 |
||
494 |
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
|
495 |
|
a5f84ac14609
added parallel_proofs flag (default true, cf. usedir option -Q), which can be disabled in low-memory situations;
wenzelm
parents:
28914
diff
changeset
|
496 |
ML_PLATFORM=x86-linux |
a5f84ac14609
added parallel_proofs flag (default true, cf. usedir option -Q), which can be disabled in low-memory situations;
wenzelm
parents:
28914
diff
changeset
|
497 |
ML_HOME=/usr/local/polyml-5.2.1/x86-linux |
a5f84ac14609
added parallel_proofs flag (default true, cf. usedir option -Q), which can be disabled in low-memory situations;
wenzelm
parents:
28914
diff
changeset
|
498 |
ML_SYSTEM=polyml-5.2.1 |
a5f84ac14609
added parallel_proofs flag (default true, cf. usedir option -Q), which can be disabled in low-memory situations;
wenzelm
parents:
28914
diff
changeset
|
499 |
ML_OPTIONS=-H 500 |
28222 | 500 |
\end{ttbox} |
501 |
||
40406 | 502 |
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}}}} |
28222 | 503 |
setting is implicitly prefixed to \emph{any} \hyperlink{tool.usedir}{\mbox{\isa{\isatt{usedir}}}} |
504 |
call. Since the \verb|IsaMakefile|s of all object-logics |
|
28238 | 505 |
distributed with Isabelle just invoke \hyperlink{tool.usedir}{\mbox{\isa{\isatt{usedir}}}} for the real |
28222 | 506 |
work, one may control compilation options globally via above |
507 |
variable. In particular, generation of \rmindex{HTML} browsing |
|
34238 | 508 |
information and document preparation is controlled here.% |
28222 | 509 |
\end{isamarkuptext}% |
510 |
\isamarkuptrue% |
|
511 |
% |
|
512 |
\isamarkupsubsubsection{Options% |
|
513 |
} |
|
514 |
\isamarkuptrue% |
|
515 |
% |
|
516 |
\begin{isamarkuptext}% |
|
517 |
Basically, there are two different modes of operation: \emph{build |
|
518 |
mode} (enabled through the \verb|-b| option) and |
|
519 |
\emph{example mode} (default). |
|
520 |
||
40406 | 521 |
Calling \hyperlink{tool.usedir}{\mbox{\isa{\isatt{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 | 522 |
\verb|NAME|, as provided on the command line. This will be a |
523 |
batch session, running \verb|ROOT.ML| from the current |
|
524 |
directory and then quitting. It is assumed that \verb|ROOT.ML| |
|
525 |
contains all ML commands required to build the logic. |
|
526 |
||
28238 | 527 |
In example mode, \hyperlink{tool.usedir}{\mbox{\isa{\isatt{usedir}}}} runs a read-only session of |
28222 | 528 |
\verb|LOGIC| and automatically runs \verb|ROOT.ML| from |
529 |
within directory \verb|NAME|. It assumes that this file |
|
530 |
contains appropriate ML commands to run the desired examples. |
|
531 |
||
532 |
\medskip The \verb|-i| option controls theory browser data |
|
533 |
generation. It may be explicitly turned on or off --- as usual, the |
|
534 |
last occurrence of \verb|-i| on the command line wins. |
|
535 |
||
536 |
The \verb|-P| option specifies a path (or actual URL) to be |
|
537 |
prefixed to any \emph{non-local} reference of existing theories. |
|
538 |
Thus user sessions may easily link to existing Isabelle libraries |
|
539 |
already present on the WWW. |
|
540 |
||
541 |
The \verb|-m| options specifies additional print modes to be |
|
542 |
activated temporarily while the session is processed. |
|
543 |
||
544 |
\medskip The \verb|-d| option controls document preparation. |
|
545 |
Valid arguments are \verb|false| (do not prepare any document; |
|
546 |
this is default), or any of \verb|dvi|, \verb|dvi.gz|, |
|
547 |
\verb|ps|, \verb|ps.gz|, \verb|pdf|. The logic |
|
548 |
session has to provide a properly setup \verb|document| |
|
549 |
directory. See \secref{sec:tool-document} and |
|
550 |
\secref{sec:tool-latex} for more details. |
|
551 |
||
552 |
\medskip The \verb|-V| option declares alternative document |
|
553 |
versions, consisting of name/tags pairs (cf.\ options \verb|-n| and \verb|-t| of the \indexref{}{tool}{document}\hyperlink{tool.document}{\mbox{\isa{\isatt{document}}}} tool). The |
|
554 |
standard document is equivalent to ``\verb|document=theory,proof,ML|'', which means that all theory begin/end |
|
555 |
commands, proof body texts, and ML code will be presented |
|
556 |
faithfully. An alternative version ``\verb|outline=/proof/ML|'' would fold proof and ML parts, replacing the |
|
557 |
original text by a short place-holder. The form ``\isa{name}\verb|=-|,'' means to remove document \isa{name} from |
|
558 |
the list of versions to be processed. Any number of \verb|-V| options may be given; later declarations have precedence over |
|
559 |
earlier ones. |
|
560 |
||
561 |
\medskip The \verb|-g| option produces images of the theory |
|
562 |
dependency graph (cf.\ \secref{sec:browse}) for inclusion in the |
|
563 |
generated document, both as \verb|session_graph.eps| and |
|
564 |
\verb|session_graph.pdf| at the same time. To include this in |
|
565 |
the final {\LaTeX} document one could say \verb|\includegraphics{session_graph}| in \verb|document/root.tex| (omitting the file-name extension enables |
|
566 |
{\LaTeX} to select to correct version, either for the DVI or PDF |
|
567 |
output path). |
|
568 |
||
569 |
\medskip The \verb|-D| option causes the generated document |
|
570 |
sources to be dumped at location \verb|PATH|; this path is |
|
571 |
relative to the session's main directory. If the \verb|-C| |
|
572 |
option is true, this will include a copy of an existing \verb|document| directory as provided by the user. For example, |
|
28505 | 573 |
\verb|isabelle| \hyperlink{tool.usedir}{\mbox{\isa{\isatt{usedir}}}}~\verb|-D generated HOL|\isasep\isanewline% |
574 |
\verb| Foo| produces a complete set of document sources at \verb|Foo/generated|. Subsequent invocation of \verb|isabelle| \hyperlink{tool.document}{\mbox{\isa{\isatt{document}}}}~\verb|Foo/generated| (see also |
|
28238 | 575 |
\secref{sec:tool-document}) will process the final result |
576 |
independently of an Isabelle job. This decoupled mode of operation |
|
577 |
facilitates debugging of serious {\LaTeX} errors, for example. |
|
28222 | 578 |
|
579 |
\medskip The \verb|-p| option determines the level of detail |
|
580 |
for internal proof objects, see also the \emph{Isabelle Reference |
|
581 |
Manual}~\cite{isabelle-ref}. |
|
582 |
||
32061
11f8ee55662d
parallel_proofs: more fine-grained control with optional parallel checking of nested Isar proofs;
wenzelm
parents:
31688
diff
changeset
|
583 |
\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
|
584 |
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
|
585 |
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
|
586 |
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
|
587 |
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
|
588 |
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
|
589 |
|
31688 | 590 |
\medskip The \verb|-t| option produces a more detailed |
591 |
internal timing report of the session. |
|
592 |
||
28222 | 593 |
\medskip The \verb|-v| option causes additional information |
594 |
to be printed while running the session, notably the location of |
|
595 |
prepared documents. |
|
596 |
||
597 |
\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
|
598 |
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
|
599 |
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
|
600 |
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
|
601 |
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
|
602 |
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
|
603 |
\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
|
604 |
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
|
605 |
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
|
606 |
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
|
607 |
locking critical code sections. |
28222 | 608 |
|
609 |
\medskip Any \hyperlink{tool.usedir}{\mbox{\isa{\isatt{usedir}}}} session is named by some \emph{session |
|
610 |
identifier}. These accumulate, documenting the way sessions depend |
|
611 |
on others. For example, consider \verb|Pure/FOL/ex|, which |
|
612 |
refers to the examples of FOL, which in turn is built upon Pure. |
|
613 |
||
614 |
The current session's identifier is by default just the base name of |
|
615 |
the \verb|LOGIC| argument (in build mode), or of the \verb|NAME| argument (in example mode). This may be overridden explicitly |
|
616 |
via the \verb|-s| option.% |
|
617 |
\end{isamarkuptext}% |
|
618 |
\isamarkuptrue% |
|
619 |
% |
|
620 |
\isamarkupsubsubsection{Examples% |
|
621 |
} |
|
622 |
\isamarkuptrue% |
|
623 |
% |
|
624 |
\begin{isamarkuptext}% |
|
625 |
Refer to the \verb|IsaMakefile|s of the Isabelle distribution's |
|
626 |
object-logics as a model for your own developments. For example, |
|
40802 | 627 |
see \verb|~~/src/FOL/IsaMakefile|. The Isabelle \indexref{}{tool}{mkdir}\hyperlink{tool.mkdir}{\mbox{\isa{\isatt{mkdir}}}} tool creates \verb|IsaMakefile|s with proper invocation |
28222 | 628 |
of \hyperlink{tool.usedir}{\mbox{\isa{\isatt{usedir}}}} as well.% |
629 |
\end{isamarkuptext}% |
|
630 |
\isamarkuptrue% |
|
631 |
% |
|
632 |
\isamarkupsection{Preparing Isabelle session documents |
|
633 |
\label{sec:tool-document}% |
|
634 |
} |
|
635 |
\isamarkuptrue% |
|
636 |
% |
|
637 |
\begin{isamarkuptext}% |
|
638 |
The \indexdef{}{tool}{document}\hypertarget{tool.document}{\hyperlink{tool.document}{\mbox{\isa{\isatt{document}}}}} utility prepares logic session documents, |
|
639 |
processing the sources both as provided by the user and generated by |
|
640 |
Isabelle. Its usage is: |
|
641 |
\begin{ttbox} |
|
642 |
Usage: document [OPTIONS] [DIR] |
|
643 |
||
644 |
Options are: |
|
645 |
-c cleanup -- be aggressive in removing old stuff |
|
646 |
-n NAME specify document name (default 'document') |
|
647 |
-o FORMAT specify output format: dvi (default), dvi.gz, ps, |
|
648 |
ps.gz, pdf |
|
649 |
-t TAGS specify tagged region markup |
|
650 |
||
651 |
Prepare the theory session document in DIR (default 'document') |
|
652 |
producing the specified output format. |
|
653 |
\end{ttbox} |
|
654 |
This tool is usually run automatically as part of the corresponding |
|
655 |
Isabelle batch process, provided document preparation has been |
|
656 |
enabled (cf.\ the \verb|-d| option of the \indexref{}{tool}{usedir}\hyperlink{tool.usedir}{\mbox{\isa{\isatt{usedir}}}} |
|
657 |
tool). It may be manually invoked on the generated browser |
|
658 |
information document output as well, e.g.\ in case of errors |
|
659 |
encountered in the batch run. |
|
660 |
||
661 |
\medskip The \verb|-c| option tells the \hyperlink{tool.document}{\mbox{\isa{\isatt{document}}}} tool |
|
662 |
to dispose the document sources after successful operation. This is |
|
663 |
the right thing to do for sources generated by an Isabelle process, |
|
664 |
but take care of your files in manual document preparation! |
|
665 |
||
666 |
\medskip The \verb|-n| and \verb|-o| option specify |
|
667 |
the final output file name and format, the default is ``\verb|document.dvi|''. Note that the result will appear in the parent of |
|
668 |
the target \verb|DIR|. |
|
669 |
||
670 |
\medskip The \verb|-t| option tells {\LaTeX} how to interpret |
|
671 |
tagged Isabelle command regions. Tags are specified as a comma |
|
672 |
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 |
|
673 |
fold text tagged as \isa{foo}. The builtin default is equivalent |
|
30114 | 674 |
to the tag specification ``\verb|+theory,+proof,+ML,+visible,-invisible|''; see also the {\LaTeX} |
28222 | 675 |
macros \verb|\isakeeptag|, \verb|\isadroptag|, and |
40802 | 676 |
\verb|\isafoldtag|, in \verb|~~/lib/texinputs/isabelle.sty|. |
28222 | 677 |
|
678 |
\medskip Document preparation requires a properly setup ``\verb|document|'' directory within the logic session sources. This |
|
679 |
directory is supposed to contain all the files needed to produce the |
|
680 |
final document --- apart from the actual theories which are |
|
681 |
generated by Isabelle. |
|
682 |
||
683 |
\medskip For most practical purposes, the \hyperlink{tool.document}{\mbox{\isa{\isatt{document}}}} tool is |
|
684 |
smart enough to create any of the specified output formats, taking |
|
685 |
\verb|root.tex| supplied by the user as a starting point. This |
|
686 |
even includes multiple runs of {\LaTeX} to accommodate references |
|
687 |
and bibliographies (the latter assumes \verb|root.bib| within |
|
688 |
the same directory). |
|
689 |
||
690 |
In more complex situations, a separate \verb|IsaMakefile| for |
|
691 |
the document sources may be given instead. This should provide |
|
692 |
targets for any admissible document format; these have to produce |
|
693 |
corresponding output files named after \verb|root| as well, |
|
694 |
e.g.\ \verb|root.dvi| for target format \verb|dvi|. |
|
695 |
||
696 |
\medskip When running the session, Isabelle copies the original |
|
697 |
\verb|document| directory into its proper place within |
|
40406 | 698 |
\hyperlink{setting.ISABELLE-BROWSER-INFO}{\mbox{\isa{\isatt{ISABELLE{\isaliteral{5F}{\isacharunderscore}}BROWSER{\isaliteral{5F}{\isacharunderscore}}INFO}}}} according to the session path. |
28222 | 699 |
Then, for any processed theory \isa{A} some {\LaTeX} source is |
700 |
generated and put there as \isa{A}\verb|.tex|. |
|
701 |
Furthermore, a list of all generated theory files is put into |
|
702 |
\verb|session.tex|. Typically, the root {\LaTeX} file provided |
|
703 |
by the user would include \verb|session.tex| to get a document |
|
704 |
containing all the theories. |
|
705 |
||
706 |
The {\LaTeX} versions of the theories require some macros defined in |
|
40802 | 707 |
\verb|~~/lib/texinputs/isabelle.sty|. Doing \verb|\usepackage{isabelle}| in \verb|root.tex| should be fine; |
28238 | 708 |
the underlying Isabelle \hyperlink{tool.latex}{\mbox{\isa{\isatt{latex}}}} tool already includes an |
709 |
appropriate path specification for {\TeX} inputs. |
|
28222 | 710 |
|
711 |
If the text contains any references to Isabelle symbols (such as |
|
28238 | 712 |
\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
|
713 |
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
|
714 |
complete list of predefined Isabelle symbols. Users may invent |
28222 | 715 |
further symbols as well, just by providing {\LaTeX} macros in a |
40802 | 716 |
similar fashion as in \verb|~~/lib/texinputs/isabellesym.sty| of |
28238 | 717 |
the distribution. |
28222 | 718 |
|
719 |
For proper setup of DVI and PDF documents (with hyperlinks and |
|
40802 | 720 |
bookmarks), we recommend to include \verb|~~/lib/texinputs/pdfsetup.sty| as well. |
28222 | 721 |
|
722 |
\medskip As a final step of document preparation within Isabelle, |
|
28505 | 723 |
\verb|isabelle| \hyperlink{tool.document}{\mbox{\isa{\isatt{document}}}}~\verb|-c| is run on the |
28238 | 724 |
resulting \verb|document| directory. Thus the actual output |
725 |
document is built and installed in its proper place (as linked by |
|
726 |
the session's \verb|index.html| if option \verb|-i| of |
|
727 |
\indexref{}{tool}{usedir}\hyperlink{tool.usedir}{\mbox{\isa{\isatt{usedir}}}} has been enabled, cf.\ \secref{sec:info}). The |
|
728 |
generated sources are deleted after successful run of {\LaTeX} and |
|
729 |
friends. Note that a separate copy of the sources may be retained |
|
730 |
by passing an option \verb|-D| to the \hyperlink{tool.usedir}{\mbox{\isa{\isatt{usedir}}}} utility |
|
731 |
when running the session.% |
|
28222 | 732 |
\end{isamarkuptext}% |
733 |
\isamarkuptrue% |
|
734 |
% |
|
735 |
\isamarkupsection{Running {\LaTeX} within the Isabelle environment |
|
736 |
\label{sec:tool-latex}% |
|
737 |
} |
|
738 |
\isamarkuptrue% |
|
739 |
% |
|
740 |
\begin{isamarkuptext}% |
|
741 |
The \indexdef{}{tool}{latex}\hypertarget{tool.latex}{\hyperlink{tool.latex}{\mbox{\isa{\isatt{latex}}}}} utility provides the basic interface for |
|
742 |
Isabelle document preparation. Its usage is: |
|
743 |
\begin{ttbox} |
|
744 |
Usage: latex [OPTIONS] [FILE] |
|
745 |
||
746 |
Options are: |
|
747 |
-o FORMAT specify output format: dvi (default), dvi.gz, ps, |
|
748 |
ps.gz, pdf, bbl, idx, sty, syms |
|
749 |
||
750 |
Run LaTeX (and related tools) on FILE (default root.tex), |
|
751 |
producing the specified output format. |
|
752 |
\end{ttbox} |
|
753 |
||
754 |
Appropriate {\LaTeX}-related programs are run on the input file, |
|
755 |
according to the given output format: \hyperlink{executable.latex}{\mbox{\isa{\isatt{latex}}}}, |
|
756 |
\hyperlink{executable.pdflatex}{\mbox{\isa{\isatt{pdflatex}}}}, \hyperlink{executable.dvips}{\mbox{\isa{\isatt{dvips}}}}, \hyperlink{executable.bibtex}{\mbox{\isa{\isatt{bibtex}}}} |
|
757 |
(for \verb|bbl|), and \hyperlink{executable.makeindex}{\mbox{\isa{\isatt{makeindex}}}} (for \verb|idx|). The actual commands are determined from the settings |
|
40406 | 758 |
environment (\hyperlink{setting.ISABELLE-LATEX}{\mbox{\isa{\isatt{ISABELLE{\isaliteral{5F}{\isacharunderscore}}LATEX}}}} etc.). |
28222 | 759 |
|
760 |
The \verb|sty| output format causes the Isabelle style files to |
|
761 |
be updated from the distribution. This is useful in special |
|
762 |
situations where the document sources are to be processed another |
|
763 |
time by separate tools (cf.\ option \verb|-D| of the \hyperlink{tool.usedir}{\mbox{\isa{\isatt{usedir}}}} utility). |
|
764 |
||
765 |
The \verb|syms| output is for internal use; it generates lists |
|
766 |
of symbols that are available without loading additional {\LaTeX} |
|
767 |
packages.% |
|
768 |
\end{isamarkuptext}% |
|
769 |
\isamarkuptrue% |
|
770 |
% |
|
771 |
\isamarkupsubsubsection{Examples% |
|
772 |
} |
|
773 |
\isamarkuptrue% |
|
774 |
% |
|
775 |
\begin{isamarkuptext}% |
|
28505 | 776 |
Invoking \verb|isabelle| \hyperlink{tool.latex}{\mbox{\isa{\isatt{latex}}}} by hand may be |
28238 | 777 |
occasionally useful when debugging failed attempts of the automatic |
778 |
document preparation stage of batch-mode Isabelle. The abortive |
|
40406 | 779 |
process leaves the sources at a certain place within \hyperlink{setting.ISABELLE-BROWSER-INFO}{\mbox{\isa{\isatt{ISABELLE{\isaliteral{5F}{\isacharunderscore}}BROWSER{\isaliteral{5F}{\isacharunderscore}}INFO}}}}, see the runtime error message for details. |
28222 | 780 |
This enables users to inspect {\LaTeX} runs in further detail, e.g.\ |
781 |
like this: |
|
782 |
\begin{ttbox} |
|
40387
e4c9e0dad473
moved ISABELLE_IDENTIFIER from ISABELLE_OUTPUT further up to ISABELLE_HOME_USER;
wenzelm
parents:
35587
diff
changeset
|
783 |
cd ~/.isabelle/IsabelleXXXX/browser_info/HOL/Test/document |
28505 | 784 |
isabelle latex -o pdf |
28222 | 785 |
\end{ttbox}% |
786 |
\end{isamarkuptext}% |
|
787 |
\isamarkuptrue% |
|
788 |
% |
|
789 |
\isadelimtheory |
|
790 |
% |
|
791 |
\endisadelimtheory |
|
792 |
% |
|
793 |
\isatagtheory |
|
794 |
\isacommand{end}\isamarkupfalse% |
|
795 |
% |
|
796 |
\endisatagtheory |
|
797 |
{\isafoldtheory}% |
|
798 |
% |
|
799 |
\isadelimtheory |
|
800 |
% |
|
801 |
\endisadelimtheory |
|
802 |
\end{isabellebody}% |
|
803 |
%%% Local Variables: |
|
804 |
%%% mode: latex |
|
805 |
%%% TeX-master: "root" |
|
806 |
%%% End: |