author | wenzelm |
Sun, 26 Mar 2000 20:10:31 +0200 | |
changeset 8580 | e79ee31d3936 |
parent 8567 | e6d46b03f2cb |
child 8656 | 1062572b5b37 |
permissions | -rw-r--r-- |
4540 | 1 |
|
3753 | 2 |
%% $Id$ |
3188 | 3 |
|
4 |
\chapter{Presenting theories} |
|
5 |
||
7849 | 6 |
Isabelle provides several ways to present the outcome of formal developments, |
7 |
including WWW-based browsable libraries or actual printable documents. |
|
8 |
Presentation is centered around the concept of \emph{logic sessions}. The |
|
7882 | 9 |
global session structure is that of a tree, with Isabelle \texttt{Pure} at its |
10 |
root, further object-logics derived (e.g.\ \texttt{HOLCF} from \texttt{HOL}, |
|
8363 | 11 |
and \texttt{HOL} from \texttt{Pure}), and application sessions in leaf |
7882 | 12 |
positions. The latter usually do not have a separate {\ML} image. |
7849 | 13 |
|
8363 | 14 |
The \texttt{usedir} and \texttt{mkdir} utilities provide the prime means for |
15 |
managing Isabelle sessions, including proper setup for presentation (see |
|
16 |
\S\ref{sec:tool-usedir} and \S\ref{sec:tool-mkdir}). |
|
7849 | 17 |
|
18 |
||
3753 | 19 |
\section{Generating theory browsing information} \label{sec:info} |
4540 | 20 |
\index{theory browsing information|bold} |
3188 | 21 |
|
7849 | 22 |
As a side-effect of running a logic sessions, Isabelle is able to generate |
23 |
theory browsing information, including HTML documents that show a theory's |
|
24 |
definition, the theorems proved in its ML file and the relationship with its |
|
25 |
ancestors and descendants. Besides the HTML file that is generated for every |
|
26 |
theory, Isabelle stores links to all theories in an index file. These indexes |
|
7882 | 27 |
are linked with other indexes to represent the overall tree structure of logic |
28 |
sessions. |
|
3188 | 29 |
|
7258 | 30 |
Isabelle also generates graph files that represent the theory hierarchy of a |
31 |
logic. There is a graph browser Java applet embedded in the generated HTML |
|
32 |
pages, and also a stand-alone application that allows browsing theory graphs |
|
33 |
without having to start a WWW browser first. The latter version also includes |
|
34 |
features such as generating {\sc PostScript} files, which are not available in |
|
35 |
the applet version. See \S\ref{sec:browse} for further information. |
|
3753 | 36 |
|
7258 | 37 |
\medskip |
38 |
||
7882 | 39 |
In order to let Isabelle generate theory browsing information, simply append |
40 |
``\texttt{-i true}'' to the \settdx{ISABELLE_USEDIR_OPTIONS} setting before |
|
41 |
making a logic. For example, in order to do this for {\FOL}, add this to your |
|
7849 | 42 |
Isabelle settings file |
3188 | 43 |
\begin{ttbox} |
3753 | 44 |
ISABELLE_USEDIR_OPTIONS="-i true" |
3188 | 45 |
\end{ttbox} |
7258 | 46 |
and then change into the \texttt{src/FOL} directory of the Isabelle |
47 |
distribution and run \texttt{isatool make}, or even \texttt{isatool make all}. |
|
48 |
||
7849 | 49 |
Some sessions (such as \texttt{HOL/Isar_examples}) even provide actual |
7882 | 50 |
printable documents. These are prepared automatically as well if enabled like |
51 |
this, using the \texttt{-d} option |
|
7849 | 52 |
\begin{ttbox} |
53 |
ISABELLE_USEDIR_OPTIONS="-i true -d dvi" |
|
54 |
\end{ttbox} |
|
55 |
See \S\ref{sec:tool-document} for further information on Isabelle document |
|
56 |
preparation. |
|
3753 | 57 |
|
7849 | 58 |
\bigskip The theory browsing information is stored within the directory |
59 |
determined by the \settdx{ISABELLE_BROWSER_INFO} setting. The |
|
60 |
\texttt{index.html} file located there provides an entry point to all standard |
|
61 |
Isabelle logics. A complete HTML version of all object-logics and examples of |
|
62 |
the Isabelle distribution is available at |
|
6623 | 63 |
\begin{center}\small |
64 |
\begin{tabular}{l} |
|
65 |
\url{http://www.cl.cam.ac.uk/Research/HVG/Isabelle/library/} \\ |
|
66 |
\url{http://isabelle.in.tum.de/library/} \\ |
|
67 |
\end{tabular} |
|
68 |
\end{center} |
|
69 |
||
7258 | 70 |
\medskip |
3188 | 71 |
|
7258 | 72 |
The generated HTML document of any theory includes all theorems proved in the |
73 |
corresponding {\ML} file, provided these have been stored properly via |
|
7849 | 74 |
\ttindex{qed}, \ttindex{qed_goal}, \ttindex{qed_goalw}, \ttindex{bind_thm}, |
7882 | 75 |
\ttindex{bind_thms} or \ttindex{store_thm} (see also \cite{isabelle-ref}). |
76 |
Section headings may be included in the presentation via the {\ML} function |
|
7258 | 77 |
\begin{ttbox}\index{*section} |
3188 | 78 |
section: string -> unit |
79 |
\end{ttbox} |
|
80 |
||
7258 | 81 |
\medskip |
3188 | 82 |
|
7258 | 83 |
In order to present your own theories on the web, simply copy the whole |
84 |
\texttt{ISABELLE_BROWSER_INFO} directory to your WWW server, after generating |
|
85 |
browser info like this: |
|
7251
35de2117b5dd
Modified section about generation of theory browsing information.
berghofe
parents:
6623
diff
changeset
|
86 |
\begin{ttbox} |
7861 | 87 |
isatool usedir -i true HOL Foo |
7251
35de2117b5dd
Modified section about generation of theory browsing information.
berghofe
parents:
6623
diff
changeset
|
88 |
\end{ttbox} |
7861 | 89 |
This assumes that directory \texttt{Foo} contains some \texttt{ROOT.ML} file |
90 |
to load all your theories, and {\HOL} is your parent logic image. Ideally, |
|
91 |
theory browser information would have been generated for {\HOL} already. |
|
7258 | 92 |
|
93 |
Alternatively, one may specify an external link to an existing body of HTML |
|
94 |
data by giving \texttt{usedir} a \texttt{-P} option like this: |
|
95 |
\begin{ttbox} |
|
7861 | 96 |
isatool usedir -i true -P http://isabelle.in.tum.de/library/ HOL Foo |
7258 | 97 |
\end{ttbox} |
98 |
||
8363 | 99 |
\medskip For production use, the \texttt{usedir} tool is usually invoked in an |
100 |
appropriate \texttt{IsaMakefile}, via the Isabelle \texttt{make} utility. |
|
101 |
There is a separate \texttt{mkdir} tool to provide easy setup of all this, |
|
102 |
with only minimal manual editing required. |
|
103 |
\begin{ttbox} |
|
104 |
isatool mkdir -d Foo |
|
105 |
edit Foo/ROOT.ML |
|
106 |
isatool make |
|
107 |
\end{ttbox} |
|
108 |
See \S\ref{sec:tool-mkdir} for more information on preparing Isabelle session |
|
109 |
directories, including the setup for documents. |
|
3753 | 110 |
|
7849 | 111 |
|
3753 | 112 |
\section{Browsing theory graphs} \label{sec:browse} |
113 |
\index{theory graph browser|bold} |
|
114 |
||
7882 | 115 |
The graph browser is a tool for visualizing dependency graphs. Certain nodes |
116 |
of the graph (i.e.~theories) can be grouped together in ``directories'', whose |
|
117 |
contents may be hidden, thus enabling the user to filter out irrelevant |
|
118 |
information. The browser is written in Java, it can be used both as a |
|
119 |
stand-alone application and as an applet. |
|
4540 | 120 |
|
3188 | 121 |
|
3753 | 122 |
\subsection{Invoking the graph browser} |
4540 | 123 |
|
124 |
The stand-alone version of the graph browser is wrapped up as an |
|
125 |
Isabelle tool called \tooldx{browser}: |
|
3753 | 126 |
\begin{ttbox} |
4540 | 127 |
Usage: browser [GRAPHFILE] |
3753 | 128 |
\end{ttbox} |
4540 | 129 |
When no filename is specified, the browser automatically changes to |
130 |
the directory \texttt{ISABELLE_BROWSER_INFO/graph/data}. |
|
3753 | 131 |
|
7849 | 132 |
\medskip The applet version of the browser can be invoked by opening the {\tt |
133 |
index.html} file in the directory \texttt{ISABELLE_BROWSER_INFO} from your |
|
7882 | 134 |
Web browser and selecting the version ``including theory graph browser''. |
135 |
There is also a link to the corresponding theory graph in every logic's {\tt |
|
7849 | 136 |
index.html} file. |
4540 | 137 |
|
3188 | 138 |
|
3753 | 139 |
\subsection{Using the graph browser} |
4540 | 140 |
|
141 |
The browser's main window, which is shown in figure |
|
7849 | 142 |
\ref{browserwindow}, consists of two sub-windows: In the left |
143 |
sub-window, the directory tree is displayed. The graph itself is |
|
144 |
displayed in the right sub-window. |
|
145 |
\begin{figure}[ht] |
|
6623 | 146 |
\includegraphics[width=\textwidth]{browser_screenshot} |
4540 | 147 |
\caption{\label{browserwindow} Browser main window} |
3753 | 148 |
\end{figure} |
149 |
||
4540 | 150 |
|
3753 | 151 |
\subsubsection*{The directory tree window} |
4540 | 152 |
|
7882 | 153 |
We describe the usage of the directory browser and the meaning of the |
154 |
different items in the browser window. |
|
3753 | 155 |
\begin{itemize} |
4540 | 156 |
|
157 |
\item A red arrow before a directory name indicates that the directory |
|
158 |
is currently ``folded'', i.e.~the nodes in this directory are |
|
7849 | 159 |
collapsed to one single node. In the right sub-window, the names of |
4540 | 160 |
nodes corresponding to folded directories are enclosed in square |
7849 | 161 |
brackets and displayed in red color. |
4540 | 162 |
|
163 |
\item A green downward arrow before a directory name indicates that |
|
164 |
the directory is currently ``unfolded''. It can be folded by |
|
165 |
clicking on the directory name. Clicking on the name for a second |
|
166 |
time unfolds the directory again. Alternatively, a directory can |
|
167 |
also be unfolded by clicking on the corresponding node in the right |
|
7849 | 168 |
sub-window. |
4540 | 169 |
|
7882 | 170 |
\item Blue arrows stand before ordinary node names. When clicking on such a |
171 |
name (i.e.\ that of a theory), the graph display window focuses to the |
|
172 |
corresponding node. Double clicking invokes a text viewer window in which |
|
173 |
the contents of the theory file are displayed. |
|
4540 | 174 |
|
3753 | 175 |
\end{itemize} |
3188 | 176 |
|
4540 | 177 |
|
3753 | 178 |
\subsubsection*{The graph display window} |
4540 | 179 |
|
180 |
When pointing on an ordinary node, an upward and a downward arrow is |
|
181 |
shown. Initially, both of these arrows are green. Clicking on the |
|
3753 | 182 |
upward or downward arrow collapses all predecessor or successor nodes, |
7849 | 183 |
respectively. The arrow's color then changes to red, indicating that |
3753 | 184 |
the predecessor or successor nodes are currently collapsed. The node |
4540 | 185 |
corresponding to the collapsed nodes has the name ``{\tt [....]}''. To |
186 |
uncollapse the nodes again, simply click on the red arrow or on the |
|
187 |
node with the name ``{\tt [....]}''. Similar to the directory browser, |
|
188 |
the contents of theory files can be displayed by double clicking on |
|
189 |
the corresponding node. |
|
3188 | 190 |
|
4540 | 191 |
|
192 |
\subsubsection*{The ``File'' menu} |
|
193 |
||
4555 | 194 |
Please note that due to Java security restrictions this menu is not |
4540 | 195 |
available in the applet version. The meaning of the menu items is as |
196 |
follows: |
|
3753 | 197 |
\begin{description} |
4540 | 198 |
|
7882 | 199 |
\item[Open \dots] Open a new graph file. |
4540 | 200 |
|
201 |
\item[Export to PostScript] Outputs the current graph in {\sc |
|
202 |
PostScript} format, appropriately scaled to fit on one single |
|
7870 | 203 |
sheet of paper. The resulting file can be printed directly. |
4540 | 204 |
|
205 |
\item[Export to EPS] Outputs the current graph in Encapsulated {\sc |
|
206 |
PostScript} format. The resulting file can be included in other |
|
207 |
documents. |
|
208 |
||
3753 | 209 |
\item[Quit] Quit the graph browser. |
4540 | 210 |
|
3753 | 211 |
\end{description} |
212 |
||
4540 | 213 |
|
3753 | 214 |
\subsection*{*Syntax of graph definition files} |
4540 | 215 |
|
3753 | 216 |
A graph definition file has the following syntax: |
217 |
\begin{eqnarray*} |
|
4540 | 218 |
\mbox{\it graph} & = & \{ \: \mbox{\it vertex \tt ;} \: \} ^ + \\ |
219 |
vertex & = & \mbox{\it vertexname} \: \mbox{\it vertexID} \: \mbox{\it dirname} \: [ \mbox{\tt +} ] |
|
220 |
\: \mbox{\it path} \: [ \mbox{\tt <} | \mbox{\tt >} ] \: \{ \: \mbox{\it vertexID} \: \} ^ * |
|
3753 | 221 |
\end{eqnarray*} |
4540 | 222 |
|
3753 | 223 |
The meaning of the items in a vertex description is as follows: |
224 |
\begin{description} |
|
4540 | 225 |
|
3753 | 226 |
\item[vertexname] The name of the vertex. |
4540 | 227 |
|
228 |
\item[vertexID] The vertex identifier. Note that there may be two |
|
229 |
vertices with equal names, whereas identifiers must be unique. |
|
230 |
||
231 |
\item[dirname] The name of the ``directory'' the vertex should be |
|
232 |
placed in. A ``{\tt +}'' sign after {\it dirname} indicates that |
|
233 |
the nodes in the directory are initially visible. Directories are |
|
234 |
initially invisible by default. |
|
235 |
||
236 |
\item[path] The path of the corresponding theory file. This is |
|
237 |
specified relatively to the path of the graph definition file. |
|
238 |
||
239 |
\item[List of successor/predecessor nodes] A ``{\tt <}'' sign before |
|
240 |
the list means that successor nodes are listed, a ``{\tt >}'' sign |
|
241 |
means that predecessor nodes are listed. If neither ``{\tt <}'' nor |
|
242 |
``{\tt >}'' is found, the browser assumes that successor nodes are |
|
243 |
listed. |
|
244 |
||
3753 | 245 |
\end{description} |
5364 | 246 |
|
247 |
||
7849 | 248 |
\section{Preparing Isabelle session documents --- \texttt{isatool document}} |
249 |
\label{sec:tool-document} |
|
250 |
||
251 |
The \tooldx{document} utility prepares logic session documents, processing the |
|
7882 | 252 |
sources both as provided by the user and generated by Isabelle. Its usage is: |
7849 | 253 |
\begin{ttbox} |
254 |
Usage: document [OPTIONS] [DIR] |
|
255 |
||
256 |
Options are: |
|
8363 | 257 |
-c remove DIR after succesful run (!) |
7849 | 258 |
-o FORMAT specify output format: dvi (default), dvi.gz, ps, |
259 |
ps.gz, pdf |
|
260 |
||
8363 | 261 |
Prepare the theory session document in DIR (default 'document') |
7849 | 262 |
producing the specified output format. |
263 |
\end{ttbox} |
|
264 |
This tool is usually run automatically as part of the corresponding session, |
|
7882 | 265 |
provided document preparation has been enabled (cf.\ the \texttt{-d} option of |
266 |
the \texttt{usedir} utility, \S\ref{sec:tool-usedir}). It may be manually |
|
267 |
invoked on the generated browser information document output as well. |
|
7849 | 268 |
|
269 |
\medskip Document preparation requires a properly setup ``\texttt{document}'' |
|
270 |
directory within the logic session sources. This directory is supposed to |
|
7882 | 271 |
contain all the files needed to produce the final document --- apart from the |
272 |
actual theories which are generated by Isabelle. |
|
7849 | 273 |
|
274 |
\medskip For simple documents, the \texttt{document} tool is smart enough to |
|
275 |
create any of the output formats, taking \texttt{root.tex} supplied by the |
|
276 |
user as a starting point. This even includes multiple runs of {\LaTeX} to |
|
277 |
accommodate references and bibliographies (the latter assumes |
|
278 |
\texttt{root.bib} within the same directory). |
|
279 |
||
280 |
For complex documents, a separate \texttt{IsaMakefile} may be given instead. |
|
281 |
It should provide targets for any admissible document format; these have to |
|
282 |
produce corresponding output files named after \texttt{root} as well, e.g.\ |
|
283 |
\texttt{root.dvi} for target format \texttt{dvi}. |
|
284 |
||
285 |
\medskip When running the session, Isabelle copies the original |
|
286 |
\texttt{document} directory into its proper place within |
|
287 |
\texttt{ISABELLE_BROWSER_INFO} according to the session path. Then, for any |
|
288 |
processed theory $A$ some {\LaTeX} source is generated and put there as |
|
289 |
$A$\texttt{.tex}. Furthermore, a list of all generated theory files is put |
|
290 |
into \texttt{session.tex}. Typically, the root {\LaTeX} file provided by the |
|
291 |
user would include \texttt{session.tex} to get a document containing all the |
|
292 |
theories. |
|
293 |
||
294 |
The {\LaTeX} versions of the theories require some macros defined in |
|
295 |
\texttt{isabelle.sty} as distributed with Isabelle. Doing |
|
296 |
\verb,\usepackage{isabelle}, somewhere in \texttt{root.tex} should work fine; |
|
297 |
the underlying Isabelle \texttt{latex} utility already includes an appropriate |
|
7970 | 298 |
{\TeX} inputs path. |
7980 | 299 |
|
300 |
If the text contains any references to Isabelle symbols (such as |
|
301 |
\verb,\<forall>,) then \texttt{isabellesym.sty} should be included as well. |
|
302 |
This package contains a standard set of {\LaTeX} macro definitions |
|
303 |
\verb,\isasym,$foo$ corresponding to \verb,\<,$foo$\verb,>,. The user may |
|
304 |
refer to further symbols as well, simply by providing {\LaTeX} macros of the |
|
305 |
same sort. |
|
306 |
||
7970 | 307 |
For proper setup of PDF documents (with hyperlinks, bookmarks, and thumbnail |
308 |
images), we recommend to include \verb,pdfsetup.sty, as well. It is safe to |
|
309 |
do so even without using PDF~\LaTeX. |
|
7849 | 310 |
|
8363 | 311 |
\medskip As a final step, \texttt{isatool document -c} is run on the resulting |
7849 | 312 |
\texttt{document} directory. Thus the actual output document is built and |
313 |
installed in its proper place (as linked by the session's |
|
8363 | 314 |
\texttt{index.html}). The generated sources are deleted after successful run |
315 |
of {\LaTeX} and friends. Note that a copy of the sources may be retained by |
|
316 |
passing an option \texttt{-D} to the \texttt{usedir} utility when running the |
|
317 |
session (see also \S\ref{sec:tool-usedir}). |
|
7849 | 318 |
|
319 |
||
320 |
\section{Running {\LaTeX} within the Isabelle environment --- \texttt{isatool latex}} |
|
321 |
\label{sec:tool-latex} |
|
322 |
||
323 |
The \tooldx{latex} utility provides the basic interface for Isabelle document |
|
324 |
preparation. Its usage is: |
|
325 |
\begin{ttbox} |
|
326 |
Usage: latex [OPTIONS] [FILE] |
|
327 |
||
328 |
Options are: |
|
329 |
-o FORMAT specify output format: dvi (default), dvi.gz, ps, |
|
8567 | 330 |
ps.gz, pdf, bbl, png, sty |
7849 | 331 |
|
332 |
Run LaTeX (and related tools) on FILE (default root.tex), |
|
333 |
producing the specified output format. |
|
334 |
\end{ttbox} |
|
335 |
Appropriate {\LaTeX}-related programs are run on the input file, according to |
|
7868 | 336 |
the given output format: \texttt{latex}, \texttt{pdflatex}, \texttt{dvips}, |
337 |
\texttt{bibtex} (for \texttt{bbl}), and \texttt{thumbpdf} (for \texttt{png}). |
|
338 |
The actual commands are determined from the settings environment |
|
7882 | 339 |
(\texttt{ISABELLE_LATEX} etc., see \S\ref{sec:settings}). |
7849 | 340 |
|
8567 | 341 |
The \texttt{sty} output format causes the Isabelle style files to be updated |
342 |
from the distribution. This is useful in special situations where the |
|
343 |
document sources are to be processed another time by separate tools (cf.\ |
|
344 |
option \texttt{-D} of the \texttt{usedir} utility, see |
|
345 |
\S\ref{sec:tool-usedir}). |
|
346 |
||
7849 | 347 |
It is important to note that the {\LaTeX} inputs file space has to be properly |
348 |
setup to include the Isabelle styles. Usually, this may be done by modifying |
|
349 |
the \settdx{TEXINPUTS} variable in settings like this: |
|
350 |
\begin{ttbox} |
|
351 |
TEXINPUTS="$ISABELLE_HOME/lib/texinputs:$TEXINPUTS" |
|
352 |
\end{ttbox} |
|
353 |
This is known to work with recent versions of the \textsl{teTeX} distribution. |
|
354 |
||
355 |
||
8363 | 356 |
\section{Creating Isabelle session directories --- \texttt{isatool mkdir}} |
357 |
\label{sec:tool-mkdir} |
|
7849 | 358 |
|
8363 | 359 |
The \tooldx{mkdir} utility prepares Isabelle session source directories, |
360 |
including a sensible default setup of \texttt{IsaMakefile}, \texttt{ROOT.ML} |
|
361 |
and an optional \texttt{document} directory. Its usage is: |
|
362 |
\begin{ttbox} |
|
363 |
Usage: mkdir [LOGIC] NAME |
|
364 |
||
365 |
Options are: |
|
366 |
-I FILE alternative IsaMakefile output |
|
367 |
-P include parent logic target |
|
368 |
-b setup build mode (session outputs heap image) |
|
369 |
-d setup document |
|
370 |
||
371 |
Prepare session directory, including IsaMakefile, document etc. |
|
372 |
with parent LOGIC (default ISABELLE_LOGIC=\$ISABELLE_LOGIC) |
|
373 |
\end{ttbox} |
|
374 |
||
375 |
The \texttt{mkdir} tool is conservative in the sense that any existing |
|
376 |
\texttt{IsaMakefile} etc.\ is left unchanged. Thus it is safe to invoke it |
|
377 |
experimentally, with varying options. |
|
378 |
||
379 |
Note that \texttt{mkdir} is unable to change \texttt{IsaMakefile} |
|
380 |
incrementally --- manual changes are required for multiple sub-sessions. On |
|
381 |
order to get an initial working session, the only editing needed is to add |
|
382 |
appropriate \texttt{use_thy} calls to the generated \texttt{ROOT.ML} file. |
|
383 |
||
384 |
||
385 |
\subsection*{Options} |
|
386 |
||
387 |
The \texttt{-I} option specifies an alternative to \texttt{IsaMakefile} for |
|
388 |
dependencies. Note that ``\texttt{-}'' refers to \emph{stdout}, i.e.\ |
|
389 |
``\texttt{-I-}'' provides an easy way to peek at \texttt{mkdir}'s idea of |
|
390 |
\texttt{make} setup required for some particular of Isabelle session. |
|
391 |
||
392 |
\medskip The \texttt{-P} option includes a target for the parent |
|
393 |
\texttt{LOGIC} session in the generated \texttt{IsaMakefile}. The |
|
394 |
corresponding sources are assumed to be located within the Isabelle |
|
395 |
distribution. |
|
396 |
||
397 |
\medskip The \texttt{-b} option sets up the current directory as the base for |
|
398 |
a new session that provides an actual logic image, as opposed to one that only |
|
399 |
runs several theories based on an existing image. Note that in the latter |
|
400 |
case, everything except \texttt{IsaMakefile} would be placed into a separate |
|
401 |
directory \texttt{NAME}, rather than the current one. See |
|
402 |
\S\ref{sec:tool-usedir} for further information on \emph{build mode} vs.\ |
|
403 |
\emph{example mode} of the \texttt{usedir} utility. |
|
404 |
||
405 |
\medskip The \texttt{-d} option creates a \texttt{document} directory with a |
|
406 |
minimal \texttt{root.tex} file, which is sufficient to get all theories pretty |
|
407 |
printed in the order of appearance. See \S\ref{sec:tool-document} for further |
|
408 |
information on Isabelle document preparation. |
|
409 |
||
410 |
||
411 |
\subsection*{Examples} |
|
412 |
||
413 |
The standard setup of a single ``example session'' based on the default logic, |
|
414 |
with proper document generation is generated like this: |
|
415 |
\begin{ttbox} |
|
416 |
isatool mkdir -d Foo |
|
417 |
\end{ttbox} |
|
418 |
\noindent The theory sources should be put into the \texttt{Foo} directory, and its |
|
419 |
\texttt{ROOT.ML} should be edited to load all required theories. Invoking |
|
420 |
\texttt{isatool make} would now run the whole session, generating browser |
|
421 |
information and the document automatically. The \texttt{IsaMakefile} is |
|
422 |
usually tuned manually later, e.g.\ adding actual source dependencies, or |
|
423 |
changing the options passed to \texttt{usedir}. |
|
424 |
||
425 |
||
426 |
\section{Running Isabelle sessions --- \texttt{isatool usedir}} \label{sec:tool-usedir} |
|
7849 | 427 |
|
428 |
The \tooldx{usedir} utility builds object-logic images, or runs example |
|
429 |
sessions based on existing logics. Its usage is: |
|
430 |
\begin{ttbox} |
|
431 |
Usage: usedir LOGIC NAME |
|
432 |
||
433 |
Options are: |
|
8363 | 434 |
-D PATH dump generated document sources into PATH |
7849 | 435 |
-P PATH set path for remote theory browsing information |
436 |
-b build mode (output heap image, using current dir) |
|
8363 | 437 |
-c BOOL tell ML system to compress output image (default true) |
7849 | 438 |
-d FORMAT build document as FORMAT (default false) |
439 |
-i BOOL generate theory browsing information, |
|
440 |
i.e. HTML / graph data (default false) |
|
441 |
-r reset session path |
|
442 |
-s NAME override session NAME |
|
443 |
||
444 |
Build object-logic or run examples. Also creates browsing |
|
445 |
information (HTML etc.) according to settings. |
|
446 |
||
447 |
ISABELLE_USEDIR_OPTIONS= |
|
448 |
\end{ttbox} |
|
449 |
||
450 |
Note that the value of the \settdx{ISABELLE_USEDIR_OPTIONS} setting is |
|
451 |
implicitly prefixed to \emph{any} \texttt{usedir} call. Since the |
|
452 |
\ttindex{IsaMakefile}s of all object-logics distributed with Isabelle just |
|
453 |
invoke \texttt{usedir} for the real work, one may control compilation options |
|
454 |
globally via above variable. In particular, generation of \rmindex{HTML} |
|
7882 | 455 |
browsing information and document preparation is controlled here. |
7849 | 456 |
|
457 |
||
458 |
\subsection*{Options} |
|
459 |
||
7882 | 460 |
Basically, there are two different modes of operation: \emph{build mode} |
461 |
(enabled through the \texttt{-b} option) and \emph{example mode} (default). |
|
7849 | 462 |
|
463 |
Calling \texttt{usedir} with \texttt{-b} runs \texttt{isabelle} with input |
|
464 |
image \texttt{LOGIC} and output to \texttt{NAME}, as provided on the command |
|
465 |
line. This will be a batch session, running \texttt{ROOT.ML} from the current |
|
466 |
directory and then quitting. It is assumed that \texttt{ROOT.ML} contains all |
|
7883 | 467 |
{\ML} commands required to build the logic. |
7849 | 468 |
|
469 |
In example mode, \texttt{usedir} runs a read-only session of \texttt{LOGIC} |
|
7882 | 470 |
and automatically runs \texttt{ROOT.ML} from within directory \texttt{NAME}. |
471 |
It assumes that this file contains appropriate {\ML} commands to run the |
|
472 |
desired examples. |
|
7849 | 473 |
|
7882 | 474 |
\medskip The \texttt{-i} option controls theory browser data generation. It |
475 |
may be explicitly turned on or off --- as usual, the last occurrence of |
|
476 |
\texttt{-i} on the command line wins. The \texttt{-P} option specifies a path |
|
477 |
(or actual URL) to be prefixed to any \emph{non-local} reference of existing |
|
478 |
theories. Thus user sessions may easily link to existing Isabelle libraries |
|
479 |
already present on the WWW. |
|
7849 | 480 |
|
481 |
\medskip The \texttt{-d} option controls document preparation. Valid |
|
7882 | 482 |
arguments are \texttt{false} (do not prepare any document; this is default), |
483 |
or any of \texttt{dvi}, \texttt{dvi.gz}, \texttt{ps}, \texttt{ps.gz}, |
|
7849 | 484 |
\texttt{pdf}. The logic session has to provide a properly setup |
485 |
\texttt{document} directory. See \S\ref{sec:tool-document} and |
|
486 |
\S\ref{sec:tool-latex} for more details. |
|
487 |
||
8363 | 488 |
\medskip The \texttt{-D} option causes the generated document sources to be |
489 |
dumped at location \texttt{PATH}, which is relative to the session's main |
|
490 |
directory. For example, \texttt{-D document} would leave a copy of the |
|
491 |
{\LaTeX} sources in the actual document directory. Thus the Isabelle |
|
492 |
\texttt{document} or \texttt{latex} tools may be run later, facilitating much |
|
8567 | 493 |
easier debugging of {\LaTeX} errors, for example. Note that a copy of the |
494 |
Isabelle style files will be placed in \texttt{PATH} as well. |
|
8363 | 495 |
|
7849 | 496 |
\medskip Any \texttt{usedir} session is named by some \emph{session |
7882 | 497 |
identifier}. These accumulate, documenting the way sessions depend on |
498 |
others. For example, consider \texttt{Pure/FOL/ex}, which refers to the |
|
499 |
examples of {\FOL}, which in turn is built upon {\Pure}. |
|
7849 | 500 |
|
7882 | 501 |
The current session's identifier is by default just the base name of the |
502 |
\texttt{LOGIC} argument (in build mode), or of the \texttt{NAME} argument (in |
|
503 |
example mode). This may be overridden explicitly via the \texttt{-s} option. |
|
7849 | 504 |
|
505 |
||
506 |
\subsection*{Examples} |
|
507 |
||
508 |
Refer to the \texttt{IsaMakefile}s of the Isabelle distribution's |
|
509 |
object-logics as a model for your own developments. For example, see |
|
8363 | 510 |
\texttt{src/FOL/IsaMakefile}. The Isabelle \texttt{mkdir} tool (see |
511 |
\S\ref{sec:tool-mkdir}) creates \texttt{IsaMakefile}s with proper invocation |
|
512 |
of \texttt{usedir} as well. |
|
513 |
||
7849 | 514 |
|
5364 | 515 |
%%% Local Variables: |
516 |
%%% mode: latex |
|
517 |
%%% TeX-master: "system" |
|
518 |
%%% End: |