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