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