doc-src/System/present.tex
author wenzelm
Tue, 13 Jun 2006 23:41:39 +0200
changeset 19876 11d447d5d68c
parent 17195 24df6a93517c
child 20571 cbcca0d536bf
permissions -rw-r--r--
tuned;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
     1
3753
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
     2
%% $Id$
3188
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
     3
10580
930ac2bfa637 include table of Isabelle standard symbols;
wenzelm
parents: 10564
diff changeset
     4
\chapter{Presenting theories}\label{ch:present}
3188
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
     5
7849
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
     6
Isabelle provides several ways to present the outcome of formal developments,
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
     7
including WWW-based browsable libraries or actual printable documents.
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
     8
Presentation is centered around the concept of \emph{logic sessions}.  The
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
     9
global session structure is that of a tree, with Isabelle Pure at its root,
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    10
further object-logics derived (e.g.\ HOLCF from HOL, and HOL from Pure), and
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    11
application sessions in leaf positions (usually without a separate image).
7849
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
    12
11616
wenzelm
parents: 11582
diff changeset
    13
The \texttt{mkdir} (see \S\ref{sec:tool-mkdir}) and \texttt{make} (see
wenzelm
parents: 11582
diff changeset
    14
\S\ref{sec:tool-make}) tools of Isabelle provide the primary means for
wenzelm
parents: 11582
diff changeset
    15
managing Isabelle sessions, including proper setup for presentation.  Here the
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    16
\texttt{usedir} (see \S\ref{sec:tool-usedir}) tool takes care to let the
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    17
\texttt{isabelle} process run any additional stages required for document
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    18
preparation, notably the tools \texttt{document} (see
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    19
\S\ref{sec:tool-document}) and \texttt{latex} (see \S\ref{sec:tool-latex}).
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    20
The complete tool chain for managing batch-mode Isabelle sessions is
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    21
illustrated in figure~\ref{fig:session-tools}.
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    22
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    23
\begin{figure}[htbp]
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    24
  \begin{center}
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    25
    \begin{tabular}{lp{0.6\textwidth}}
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    26
      \texttt{isatool mkdir} & invoked once by the user to create the initial
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    27
        source setup (common \texttt{IsaMakefile} plus a single session directory); \\
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    28
      \texttt{isatool make} & invoked repeatedly by the user to
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    29
        keep session output up-to-date (HTML, documents etc.); \\
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    30
      \texttt{isatool usedir} & part of the standard \texttt{IsaMakefile} entry of a session; \\
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    31
      \texttt{isabelle} & run through \texttt{isatool usedir}; \\
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    32
      \texttt{isatool document} & run by the Isabelle process if document preparation is enabled; \\
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    33
      \texttt{isatool latex} & universal {\LaTeX} tool wrapper invoked multiple times
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    34
        by \texttt{isatool document}; also useful for manual experiments; \\
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    35
    \end{tabular}
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    36
    \caption{The tool chain of Isabelle session presentation}
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    37
    \label{fig:session-tools}
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    38
  \end{center}
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    39
\end{figure}
7849
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
    40
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
    41
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    42
\section{Generating theory browser information} \label{sec:info}
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
    43
\index{theory browsing information|bold}
3188
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
    44
7849
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
    45
As a side-effect of running a logic sessions, Isabelle is able to generate
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
    46
theory browsing information, including HTML documents that show a theory's
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
    47
definition, the theorems proved in its ML file and the relationship with its
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
    48
ancestors and descendants.  Besides the HTML file that is generated for every
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
    49
theory, Isabelle stores links to all theories in an index file. These indexes
7882
wenzelm
parents: 7870
diff changeset
    50
are linked with other indexes to represent the overall tree structure of logic
wenzelm
parents: 7870
diff changeset
    51
sessions.
3188
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
    52
7258
wenzelm
parents: 7251
diff changeset
    53
Isabelle also generates graph files that represent the theory hierarchy of a
wenzelm
parents: 7251
diff changeset
    54
logic.  There is a graph browser Java applet embedded in the generated HTML
wenzelm
parents: 7251
diff changeset
    55
pages, and also a stand-alone application that allows browsing theory graphs
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    56
without having to start a WWW client first.  The latter version also includes
11582
f666c1e4133d updated;
wenzelm
parents: 10580
diff changeset
    57
features such as generating Postscript files, which are not available in the
f666c1e4133d updated;
wenzelm
parents: 10580
diff changeset
    58
applet version.  See \S\ref{sec:browse} for further information.
3753
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
    59
7258
wenzelm
parents: 7251
diff changeset
    60
\medskip
wenzelm
parents: 7251
diff changeset
    61
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    62
The easiest way to let Isabelle generate theory browsing information for
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    63
existing sessions is to append ``\texttt{-i true}'' to the
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    64
\settdx{ISABELLE_USEDIR_OPTIONS} before invoking \texttt{isatool make} (or
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    65
\texttt{./build} in the distribution).  For example, add something like this
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    66
to your Isabelle settings file
3188
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
    67
\begin{ttbox}
3753
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
    68
ISABELLE_USEDIR_OPTIONS="-i true"
3188
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
    69
\end{ttbox}
7258
wenzelm
parents: 7251
diff changeset
    70
and then change into the \texttt{src/FOL} directory of the Isabelle
wenzelm
parents: 7251
diff changeset
    71
distribution and run \texttt{isatool make}, or even \texttt{isatool make all}.
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    72
The presentation output will appear in \texttt{\$ISABELLE_BROWSER_INFO/FOL},
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    73
which usually refers to \verb,~/isabelle/browser_info/FOL,.  Note that option
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    74
\texttt{-v true} will make the internal runs of \texttt{usedir} more explicit
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    75
about such details.
7258
wenzelm
parents: 7251
diff changeset
    76
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    77
Many standard Isabelle sessions (such as \texttt{HOL/ex}) also provide actual
7882
wenzelm
parents: 7870
diff changeset
    78
printable documents.  These are prepared automatically as well if enabled like
wenzelm
parents: 7870
diff changeset
    79
this, using the \texttt{-d} option
7849
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
    80
\begin{ttbox}
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
    81
ISABELLE_USEDIR_OPTIONS="-i true -d dvi"
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
    82
\end{ttbox}
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    83
Enabling options \texttt{-i} and \texttt{-d} simultaneausly as shown above
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    84
causes an appropriate ``document'' link to be included in the HTML index.
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    85
Documents (or raw document sources) may be generated independently of browser
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    86
information as well, see \S\ref{sec:tool-document} for further details.
3753
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
    87
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    88
\bigskip The theory browsing information is stored in a sub-directory
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    89
directory determined by the \settdx{ISABELLE_BROWSER_INFO} setting plus a
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    90
prefix corresponding to the session identifier (according to the tree
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    91
structure of sub-sessions by default).  A complete WWW view of all standard
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    92
object-logics and examples of the Isabelle distribution is available at the
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    93
Cambridge or Munich Isabelle sites:
6623
021728c71030 pdf setup;
wenzelm
parents: 6148
diff changeset
    94
\begin{center}\small
021728c71030 pdf setup;
wenzelm
parents: 6148
diff changeset
    95
  \begin{tabular}{l}
021728c71030 pdf setup;
wenzelm
parents: 6148
diff changeset
    96
    \url{http://www.cl.cam.ac.uk/Research/HVG/Isabelle/library/} \\
021728c71030 pdf setup;
wenzelm
parents: 6148
diff changeset
    97
    \url{http://isabelle.in.tum.de/library/} \\
021728c71030 pdf setup;
wenzelm
parents: 6148
diff changeset
    98
  \end{tabular}
021728c71030 pdf setup;
wenzelm
parents: 6148
diff changeset
    99
\end{center}
021728c71030 pdf setup;
wenzelm
parents: 6148
diff changeset
   100
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   101
\medskip In order to present your own theories on the web, simply copy the
9209
862c8b83ab55 presentation: self-contained session dirs;
wenzelm
parents: 8656
diff changeset
   102
corresponding subdirectory from \texttt{ISABELLE_BROWSER_INFO} to your WWW
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   103
server, having generated browser info like this:
7251
35de2117b5dd Modified section about generation of theory browsing information.
berghofe
parents: 6623
diff changeset
   104
\begin{ttbox}
7861
wenzelm
parents: 7849
diff changeset
   105
isatool usedir -i true HOL Foo
7251
35de2117b5dd Modified section about generation of theory browsing information.
berghofe
parents: 6623
diff changeset
   106
\end{ttbox}
7861
wenzelm
parents: 7849
diff changeset
   107
This assumes that directory \texttt{Foo} contains some \texttt{ROOT.ML} file
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   108
to load all your theories, and HOL is your parent logic image (\texttt{isatool
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   109
  mkdir} assists in setting up Isabelle session directories, see
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   110
\S\ref{sec:tool-mkdir}).  Theory browser information for HOL should have been
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   111
generated already beforehand.  Alternatively, one may specify an external link
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   112
to an existing body of HTML data by giving \texttt{usedir} a \texttt{-P}
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   113
option like this:
7258
wenzelm
parents: 7251
diff changeset
   114
\begin{ttbox}
7861
wenzelm
parents: 7849
diff changeset
   115
isatool usedir -i true -P http://isabelle.in.tum.de/library/ HOL Foo
7258
wenzelm
parents: 7251
diff changeset
   116
\end{ttbox}
wenzelm
parents: 7251
diff changeset
   117
8363
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   118
\medskip For production use, the \texttt{usedir} tool is usually invoked in an
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   119
appropriate \texttt{IsaMakefile}, via the Isabelle \texttt{make} utility.
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   120
There is a separate \texttt{mkdir} tool to provide easy setup of all this,
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   121
with only minimal manual editing required.
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   122
\begin{ttbox}
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   123
isatool mkdir HOL Foo && isatool make
8363
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   124
\end{ttbox}
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   125
See \S\ref{sec:tool-mkdir} for more information on preparing Isabelle session
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   126
directories, including the setup for documents.
3753
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
   127
7849
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   128
3753
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
   129
\section{Browsing theory graphs} \label{sec:browse}
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
   130
\index{theory graph browser|bold} 
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
   131
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   132
The Isabelle graph browser is a general tool for visualizing dependency
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   133
graphs.  Certain nodes of the graph (i.e.~theories) can be grouped together in
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   134
``directories'', whose contents may be hidden, thus enabling the user to
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   135
collapse irrelevant portions of information.  The browser is written in Java,
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   136
it can be used both as a stand-alone application and as an applet.  Note that
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   137
the option \texttt{-g} of \texttt{isatool usedir} (see
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   138
\S\ref{sec:tool-usedir}) creates graph presentations in batch mode for
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   139
inclusion in session documents.
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   140
3188
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
   141
3753
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
   142
\subsection{Invoking the graph browser}
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   143
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   144
The stand-alone version of the graph browser is wrapped up as an
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   145
Isabelle tool called \tooldx{browser}:
3753
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
   146
\begin{ttbox}
9237
161fb7f00414 fixed usage;
wenzelm
parents: 9209
diff changeset
   147
Usage: browser [OPTIONS] [GRAPHFILE]
161fb7f00414 fixed usage;
wenzelm
parents: 9209
diff changeset
   148
161fb7f00414 fixed usage;
wenzelm
parents: 9209
diff changeset
   149
  Options are:
161fb7f00414 fixed usage;
wenzelm
parents: 9209
diff changeset
   150
    -d           delete file after use
12583
2fcf06f05afa isatool browser -o;
wenzelm
parents: 12464
diff changeset
   151
    -o FILE      output to FILE (ps, eps, pdf)
3753
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
   152
\end{ttbox}
9209
862c8b83ab55 presentation: self-contained session dirs;
wenzelm
parents: 8656
diff changeset
   153
When no filename is specified, the browser automatically changes to the
862c8b83ab55 presentation: self-contained session dirs;
wenzelm
parents: 8656
diff changeset
   154
directory \texttt{ISABELLE_BROWSER_INFO}.
3753
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
   155
13047
wenzelm
parents: 13018
diff changeset
   156
\medskip The \texttt{-d} option causes the source file (!)\ to be deleted
wenzelm
parents: 13018
diff changeset
   157
after the browser terminates; this is mainly intended for detaching
wenzelm
parents: 13018
diff changeset
   158
interactive graph views from a running Isabelle session.
12583
2fcf06f05afa isatool browser -o;
wenzelm
parents: 12464
diff changeset
   159
2fcf06f05afa isatool browser -o;
wenzelm
parents: 12464
diff changeset
   160
The \texttt{-o} option indicates batch-mode operation, with the output written
2fcf06f05afa isatool browser -o;
wenzelm
parents: 12464
diff changeset
   161
to the indicated file; note that \texttt{pdf} produces an \texttt{eps} copy as
2fcf06f05afa isatool browser -o;
wenzelm
parents: 12464
diff changeset
   162
well.
2fcf06f05afa isatool browser -o;
wenzelm
parents: 12464
diff changeset
   163
13047
wenzelm
parents: 13018
diff changeset
   164
\medskip The applet version of the browser is part of the standard WWW theory
wenzelm
parents: 13018
diff changeset
   165
presentation, see the link ``theory dependencies'' within each session index.
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   166
3188
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
   167
3753
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
   168
\subsection{Using the graph browser}
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   169
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   170
The browser's main window, which is shown in figure
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   171
\ref{fig:browserwindow}, consists of two sub-windows: In the left
7849
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   172
sub-window, the directory tree is displayed. The graph itself is
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   173
displayed in the right sub-window.
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   174
\begin{figure}[ht]
6623
021728c71030 pdf setup;
wenzelm
parents: 6148
diff changeset
   175
  \includegraphics[width=\textwidth]{browser_screenshot}
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   176
  \caption{\label{fig:browserwindow} Browser main window}
3753
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
   177
\end{figure}
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
   178
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   179
3753
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
   180
\subsubsection*{The directory tree window}
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   181
7882
wenzelm
parents: 7870
diff changeset
   182
We describe the usage of the directory browser and the meaning of the
wenzelm
parents: 7870
diff changeset
   183
different items in the browser window.
3753
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
   184
\begin{itemize}
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   185
  
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   186
\item A red arrow before a directory name indicates that the directory
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   187
  is currently ``folded'', i.e.~the nodes in this directory are
7849
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   188
  collapsed to one single node. In the right sub-window, the names of
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   189
  nodes corresponding to folded directories are enclosed in square
7849
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   190
  brackets and displayed in red color.
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   191
  
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   192
\item A green downward arrow before a directory name indicates that
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   193
  the directory is currently ``unfolded''. It can be folded by
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   194
  clicking on the directory name.  Clicking on the name for a second
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   195
  time unfolds the directory again.  Alternatively, a directory can
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   196
  also be unfolded by clicking on the corresponding node in the right
7849
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   197
  sub-window.
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   198
  
7882
wenzelm
parents: 7870
diff changeset
   199
\item Blue arrows stand before ordinary node names. When clicking on such a
wenzelm
parents: 7870
diff changeset
   200
  name (i.e.\ that of a theory), the graph display window focuses to the
wenzelm
parents: 7870
diff changeset
   201
  corresponding node. Double clicking invokes a text viewer window in which
wenzelm
parents: 7870
diff changeset
   202
  the contents of the theory file are displayed.
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   203
3753
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
   204
\end{itemize}
3188
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
   205
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   206
3753
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
   207
\subsubsection*{The graph display window}
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   208
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   209
When pointing on an ordinary node, an upward and a downward arrow is
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   210
shown.  Initially, both of these arrows are green. Clicking on the
3753
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
   211
upward or downward arrow collapses all predecessor or successor nodes,
7849
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   212
respectively. The arrow's color then changes to red, indicating that
3753
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
   213
the predecessor or successor nodes are currently collapsed. The node
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   214
corresponding to the collapsed nodes has the name ``{\tt [....]}''. To
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   215
uncollapse the nodes again, simply click on the red arrow or on the
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   216
node with the name ``{\tt [....]}''. Similar to the directory browser,
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   217
the contents of theory files can be displayed by double clicking on
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   218
the corresponding node.
3188
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
   219
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   220
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   221
\subsubsection*{The ``File'' menu}
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   222
4555
wenzelm
parents: 4540
diff changeset
   223
Please note that due to Java security restrictions this menu is not
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   224
available in the applet version. The meaning of the menu items is as
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   225
follows:
3753
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
   226
\begin{description}
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   227
  
7882
wenzelm
parents: 7870
diff changeset
   228
\item[Open \dots] Open a new graph file.
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   229
  
11582
f666c1e4133d updated;
wenzelm
parents: 10580
diff changeset
   230
\item[Export to PostScript] Outputs the current graph in Postscript format,
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   231
  appropriately scaled to fit on one single sheet of A4 paper.  The resulting
11582
f666c1e4133d updated;
wenzelm
parents: 10580
diff changeset
   232
  file can be printed directly.
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   233
  
11582
f666c1e4133d updated;
wenzelm
parents: 10580
diff changeset
   234
\item[Export to EPS] Outputs the current graph in Encapsulated Postscript
f666c1e4133d updated;
wenzelm
parents: 10580
diff changeset
   235
  format. The resulting file can be included in other documents.
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   236
3753
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
   237
\item[Quit] Quit the graph browser.
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   238
3753
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
   239
\end{description}
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
   240
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   241
3753
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
   242
\subsection*{*Syntax of graph definition files}
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   243
3753
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
   244
A graph definition file has the following syntax:
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
   245
\begin{eqnarray*}
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   246
  \mbox{\it graph} & = & \{ \: \mbox{\it vertex \tt ;} \: \} ^ + \\
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   247
  vertex & = & \mbox{\it vertexname} \: \mbox{\it vertexID} \: \mbox{\it dirname} \: [ \mbox{\tt +} ]
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   248
  \: \mbox{\it path} \: [ \mbox{\tt <} | \mbox{\tt >} ] \: \{ \: \mbox{\it vertexID} \: \} ^ *
3753
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
   249
\end{eqnarray*}
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   250
3753
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
   251
The meaning of the items in a vertex description is as follows:
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
   252
\begin{description}
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   253
  
3753
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
   254
\item[vertexname] The name of the vertex.
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   255
  
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   256
\item[vertexID] The vertex identifier. Note that there may be two
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   257
  vertices with equal names, whereas identifiers must be unique.
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   258
  
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   259
\item[dirname] The name of the ``directory'' the vertex should be
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   260
  placed in.  A ``{\tt +}'' sign after {\it dirname} indicates that
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   261
  the nodes in the directory are initially visible. Directories are
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   262
  initially invisible by default.
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   263
  
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   264
\item[path] The path of the corresponding theory file. This is
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   265
  specified relatively to the path of the graph definition file.
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   266
  
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   267
\item[List of successor/predecessor nodes] A ``{\tt <}'' sign before
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   268
  the list means that successor nodes are listed, a ``{\tt >}'' sign
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   269
  means that predecessor nodes are listed. If neither ``{\tt <}'' nor
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   270
  ``{\tt >}'' is found, the browser assumes that successor nodes are
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   271
  listed.
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3753
diff changeset
   272
3753
5fd734bed0d4 Added section describing the theory browser.
berghofe
parents: 3217
diff changeset
   273
\end{description}
5364
ffa6d795c4b3 emacs local vars;
wenzelm
parents: 4555
diff changeset
   274
ffa6d795c4b3 emacs local vars;
wenzelm
parents: 4555
diff changeset
   275
8363
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   276
\section{Creating Isabelle session directories --- \texttt{isatool mkdir}}
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   277
\label{sec:tool-mkdir}
7849
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   278
8363
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   279
The \tooldx{mkdir} utility prepares Isabelle session source directories,
11582
f666c1e4133d updated;
wenzelm
parents: 10580
diff changeset
   280
including a sensible default setup of \texttt{IsaMakefile}, \texttt{ROOT.ML},
f666c1e4133d updated;
wenzelm
parents: 10580
diff changeset
   281
and a \texttt{document} directory with a minimal \texttt{root.tex} that is
13047
wenzelm
parents: 13018
diff changeset
   282
sufficient to print all theories of the session (in the order of appearance);
wenzelm
parents: 13018
diff changeset
   283
see \S\ref{sec:tool-document} for further information on Isabelle document
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   284
preparation.  The usage of \texttt{isatool mkdir} is:
8363
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   285
\begin{ttbox}
9237
161fb7f00414 fixed usage;
wenzelm
parents: 9209
diff changeset
   286
Usage: mkdir [OPTIONS] [LOGIC] NAME
8363
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   287
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   288
  Options are:
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   289
    -I FILE      alternative IsaMakefile output
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   290
    -P           include parent logic target
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   291
    -b           setup build mode (session outputs heap image)
11582
f666c1e4133d updated;
wenzelm
parents: 10580
diff changeset
   292
    -q           quiet mode
8363
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   293
11582
f666c1e4133d updated;
wenzelm
parents: 10580
diff changeset
   294
  Prepare session directory, including IsaMakefile and document source,
8363
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   295
  with parent LOGIC (default ISABELLE_LOGIC=\$ISABELLE_LOGIC)
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   296
\end{ttbox}
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   297
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   298
The \texttt{mkdir} tool is conservative in the sense that any existing
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   299
\texttt{IsaMakefile} etc.\ is left unchanged.  Thus it is safe to invoke it
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   300
multiple times, although later runs may not have the desired effect.
8363
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   301
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   302
Note that \texttt{mkdir} is unable to change \texttt{IsaMakefile}
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   303
incrementally --- manual changes are required for multiple sub-sessions.  On
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   304
order to get an initial working session, the only editing needed is to add
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   305
appropriate \texttt{use_thy} calls to the generated \texttt{ROOT.ML} file.
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   306
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   307
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   308
\subsection*{Options}
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   309
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   310
The \texttt{-I} option specifies an alternative to \texttt{IsaMakefile} for
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   311
dependencies.  Note that ``\texttt{-}'' refers to \emph{stdout}, i.e.\ 
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   312
``\texttt{-I-}'' provides an easy way to peek at \texttt{mkdir}'s idea of
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   313
\texttt{make} setup required for some particular of Isabelle session.
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   314
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   315
\medskip The \texttt{-P} option includes a target for the parent
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   316
\texttt{LOGIC} session in the generated \texttt{IsaMakefile}.  The
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   317
corresponding sources are assumed to be located within the Isabelle
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   318
distribution.
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   319
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   320
\medskip The \texttt{-b} option sets up the current directory as the base for
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   321
a new session that provides an actual logic image, as opposed to one that only
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   322
runs several theories based on an existing image.  Note that in the latter
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   323
case, everything except \texttt{IsaMakefile} would be placed into a separate
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   324
directory \texttt{NAME}, rather than the current one.  See
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   325
\S\ref{sec:tool-usedir} for further information on \emph{build mode} vs.\ 
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   326
\emph{example mode} of the \texttt{usedir} utility.
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   327
11582
f666c1e4133d updated;
wenzelm
parents: 10580
diff changeset
   328
\medskip The \texttt{-q} enables quiet mode, suppressing further notes on how
f666c1e4133d updated;
wenzelm
parents: 10580
diff changeset
   329
to proceed.
8363
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   330
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   331
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   332
\subsection*{Examples}
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   333
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   334
The standard setup of a single ``example session'' based on the default logic,
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   335
with proper document generation is generated like this:
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   336
\begin{ttbox}
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   337
isatool mkdir Foo && isatool make
8363
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   338
\end{ttbox}
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   339
\noindent The theory sources should be put into the \texttt{Foo} directory, and its
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   340
\texttt{ROOT.ML} should be edited to load all required theories.  Invoking
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   341
\texttt{isatool make} again would run the whole session, generating browser
8363
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   342
information and the document automatically.  The \texttt{IsaMakefile} is
13047
wenzelm
parents: 13018
diff changeset
   343
typically tuned manually later, e.g.\ adding source dependencies, or changing
wenzelm
parents: 13018
diff changeset
   344
the options passed to \texttt{usedir}.
8363
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   345
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   346
\medskip Large projects may demand further sessions, potentially with separate
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   347
logic images being created.  This usually requires manual editing of the
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   348
generated \texttt{IsaMakefile}, which is meant to cover all of the sub-session
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   349
directories at the same time (this is the deeper reasong why
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   350
\texttt{IsaMakefile} is not made part of the initial session directory created
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   351
by \texttt{isatool mkdir}).  See \texttt{src/HOL/IsaMakefile} of the Isabelle
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   352
distribution for a full-blown example.
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   353
8363
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   354
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   355
\section{Running Isabelle sessions --- \texttt{isatool usedir}} \label{sec:tool-usedir}
7849
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   356
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   357
The \tooldx{usedir} utility builds object-logic images, or runs example
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   358
sessions based on existing logics. Its usage is:
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   359
\begin{ttbox}
11582
f666c1e4133d updated;
wenzelm
parents: 10580
diff changeset
   360
9237
161fb7f00414 fixed usage;
wenzelm
parents: 9209
diff changeset
   361
Usage: usedir [OPTIONS] LOGIC NAME
7849
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   362
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   363
  Options are:
17195
24df6a93517c isatool usedir: added option -C;
wenzelm
parents: 17099
diff changeset
   364
    -C BOOL      copy existing document directory to -D PATH (default true)
8363
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   365
    -D PATH      dump generated document sources into PATH
7849
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   366
    -P PATH      set path for remote theory browsing information
17054
a7da4123523e isatool usedir: option -V and -f;
wenzelm
parents: 14921
diff changeset
   367
    -V VERSION   declare alternative document VERSION
7849
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   368
    -b           build mode (output heap image, using current dir)
8363
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   369
    -c BOOL      tell ML system to compress output image (default true)
7849
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   370
    -d FORMAT    build document as FORMAT (default false)
17054
a7da4123523e isatool usedir: option -V and -f;
wenzelm
parents: 14921
diff changeset
   371
    -f NAME      use ML file NAME (default ROOT.ML)
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   372
    -g BOOL      generate session graph image for document (default false)
10564
42f41f966db4 usedir: -m option;
wenzelm
parents: 9695
diff changeset
   373
    -i BOOL      generate theory browser information (default false)
42f41f966db4 usedir: -m option;
wenzelm
parents: 9695
diff changeset
   374
    -m MODE      add print mode for output
11582
f666c1e4133d updated;
wenzelm
parents: 10580
diff changeset
   375
    -p LEVEL     set level of detail for proof objects
7849
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   376
    -r           reset session path
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   377
    -s NAME      override session NAME
11582
f666c1e4133d updated;
wenzelm
parents: 10580
diff changeset
   378
    -v BOOL      be verbose (default false)
7849
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   379
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   380
  Build object-logic or run examples. Also creates browsing
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   381
  information (HTML etc.) according to settings.
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   382
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   383
  ISABELLE_USEDIR_OPTIONS=
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   384
\end{ttbox}
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   385
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   386
Note that the value of the \settdx{ISABELLE_USEDIR_OPTIONS} setting is
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   387
implicitly prefixed to \emph{any} \texttt{usedir} call. Since the
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   388
\ttindex{IsaMakefile}s of all object-logics distributed with Isabelle just
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   389
invoke \texttt{usedir} for the real work, one may control compilation options
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   390
globally via above variable. In particular, generation of \rmindex{HTML}
7882
wenzelm
parents: 7870
diff changeset
   391
browsing information and document preparation is controlled here.
7849
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   392
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   393
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   394
\subsection*{Options}
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   395
7882
wenzelm
parents: 7870
diff changeset
   396
Basically, there are two different modes of operation: \emph{build mode}
wenzelm
parents: 7870
diff changeset
   397
(enabled through the \texttt{-b} option) and \emph{example mode} (default).
7849
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   398
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   399
Calling \texttt{usedir} with \texttt{-b} runs \texttt{isabelle} with input
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   400
image \texttt{LOGIC} and output to \texttt{NAME}, as provided on the command
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   401
line. This will be a batch session, running \texttt{ROOT.ML} from the current
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   402
directory and then quitting.  It is assumed that \texttt{ROOT.ML} contains all
7883
wenzelm
parents: 7882
diff changeset
   403
{\ML} commands required to build the logic.
7849
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   404
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   405
In example mode, \texttt{usedir} runs a read-only session of \texttt{LOGIC}
7882
wenzelm
parents: 7870
diff changeset
   406
and automatically runs \texttt{ROOT.ML} from within directory \texttt{NAME}.
wenzelm
parents: 7870
diff changeset
   407
It assumes that this file contains appropriate {\ML} commands to run the
wenzelm
parents: 7870
diff changeset
   408
desired examples.
7849
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   409
7882
wenzelm
parents: 7870
diff changeset
   410
\medskip The \texttt{-i} option controls theory browser data generation. It
wenzelm
parents: 7870
diff changeset
   411
may be explicitly turned on or off --- as usual, the last occurrence of
10564
42f41f966db4 usedir: -m option;
wenzelm
parents: 9695
diff changeset
   412
\texttt{-i} on the command line wins.
42f41f966db4 usedir: -m option;
wenzelm
parents: 9695
diff changeset
   413
42f41f966db4 usedir: -m option;
wenzelm
parents: 9695
diff changeset
   414
The \texttt{-P} option specifies a path (or actual URL) to be prefixed to any
42f41f966db4 usedir: -m option;
wenzelm
parents: 9695
diff changeset
   415
\emph{non-local} reference of existing theories.  Thus user sessions may
42f41f966db4 usedir: -m option;
wenzelm
parents: 9695
diff changeset
   416
easily link to existing Isabelle libraries already present on the WWW.
42f41f966db4 usedir: -m option;
wenzelm
parents: 9695
diff changeset
   417
42f41f966db4 usedir: -m option;
wenzelm
parents: 9695
diff changeset
   418
The \texttt{-m} options specifies additional print modes to be activated
42f41f966db4 usedir: -m option;
wenzelm
parents: 9695
diff changeset
   419
temporarily while the session is processed.
7849
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   420
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   421
\medskip The \texttt{-d} option controls document preparation.  Valid
7882
wenzelm
parents: 7870
diff changeset
   422
arguments are \texttt{false} (do not prepare any document; this is default),
wenzelm
parents: 7870
diff changeset
   423
or any of \texttt{dvi}, \texttt{dvi.gz}, \texttt{ps}, \texttt{ps.gz},
7849
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   424
\texttt{pdf}.  The logic session has to provide a properly setup
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   425
\texttt{document} directory.  See \S\ref{sec:tool-document} and
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   426
\S\ref{sec:tool-latex} for more details.
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   427
17099
3016fd89574f usedir: tuned option -V;
wenzelm
parents: 17054
diff changeset
   428
\medskip The \texttt{-V} option declares alternative document versions,
3016fd89574f usedir: tuned option -V;
wenzelm
parents: 17054
diff changeset
   429
consisting of name/tags pairs (cf.\ options \texttt{-n} and \texttt{-t} of the
3016fd89574f usedir: tuned option -V;
wenzelm
parents: 17054
diff changeset
   430
\texttt{document} tool, \S\ref{sec:tool-document}).  The standard document is
3016fd89574f usedir: tuned option -V;
wenzelm
parents: 17054
diff changeset
   431
equivalent to ``\texttt{document=theory,proof,ML}'', which means that all
3016fd89574f usedir: tuned option -V;
wenzelm
parents: 17054
diff changeset
   432
theory begin/end commands, proof body texts, and ML code will be presented
3016fd89574f usedir: tuned option -V;
wenzelm
parents: 17054
diff changeset
   433
faithfully.  An alternative version ``\texttt{outline=/proof/ML}'' would fold
3016fd89574f usedir: tuned option -V;
wenzelm
parents: 17054
diff changeset
   434
proof and ML parts, replacing the original text by a short place-holder.  The
3016fd89574f usedir: tuned option -V;
wenzelm
parents: 17054
diff changeset
   435
form ``$name$\verb,=-,'' means to remove document $name$ from the list of
3016fd89574f usedir: tuned option -V;
wenzelm
parents: 17054
diff changeset
   436
versions to be processed.  Any number of \texttt{-V} options may be given;
3016fd89574f usedir: tuned option -V;
wenzelm
parents: 17054
diff changeset
   437
later declarations have precedence over earlier ones.
17054
a7da4123523e isatool usedir: option -V and -f;
wenzelm
parents: 14921
diff changeset
   438
a7da4123523e isatool usedir: option -V and -f;
wenzelm
parents: 14921
diff changeset
   439
\medskip The \texttt{-g} option produces images of the theory dependency graph
a7da4123523e isatool usedir: option -V and -f;
wenzelm
parents: 14921
diff changeset
   440
(cf.\ \S\ref{sec:browse}) for inclusion in the generated document, both as
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   441
\texttt{session_graph.eps} and \texttt{session_graph.pdf} at the same time.
13047
wenzelm
parents: 13018
diff changeset
   442
To include this in the final {\LaTeX} document one could say
wenzelm
parents: 13018
diff changeset
   443
\verb,\includegraphics{session_graph}, in \texttt{document/root.tex} (omitting
wenzelm
parents: 13018
diff changeset
   444
the file-name extension enables {\LaTeX} to select to correct version, either
wenzelm
parents: 13018
diff changeset
   445
for the DVI or PDF output path).
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   446
17195
24df6a93517c isatool usedir: added option -C;
wenzelm
parents: 17099
diff changeset
   447
\medskip The \texttt{-D} option causes the generated document sources to be
13018
5164177cf0a6 isatool usedir -D generated Foo && isatool document Foo/generated;
wenzelm
parents: 12689
diff changeset
   448
dumped at location \texttt{PATH}; this path is relative to the session's main
17195
24df6a93517c isatool usedir: added option -C;
wenzelm
parents: 17099
diff changeset
   449
directory.  If the \texttt{-C} option is true, this will include a copy of an
24df6a93517c isatool usedir: added option -C;
wenzelm
parents: 17099
diff changeset
   450
existing \texttt{document} directory as provided by the user.  For example,
24df6a93517c isatool usedir: added option -C;
wenzelm
parents: 17099
diff changeset
   451
\texttt{isatool usedir -D generated HOL Foo} produces a complete set of
24df6a93517c isatool usedir: added option -C;
wenzelm
parents: 17099
diff changeset
   452
document sources at \texttt{Foo/generated}.  Subsequent invocation of
24df6a93517c isatool usedir: added option -C;
wenzelm
parents: 17099
diff changeset
   453
\texttt{isatool document Foo/generated} (see also \S\ref{sec:tool-document})
24df6a93517c isatool usedir: added option -C;
wenzelm
parents: 17099
diff changeset
   454
will process the final result independently of an Isabelle job.  This
24df6a93517c isatool usedir: added option -C;
wenzelm
parents: 17099
diff changeset
   455
decoupled mode of operation facilitates debugging of serious {\LaTeX} errors,
24df6a93517c isatool usedir: added option -C;
wenzelm
parents: 17099
diff changeset
   456
for example.
8363
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   457
11582
f666c1e4133d updated;
wenzelm
parents: 10580
diff changeset
   458
\medskip The \texttt{-p} option determines the level of detail for internal
f666c1e4133d updated;
wenzelm
parents: 10580
diff changeset
   459
proof objects, see also the \emph{Isabelle Reference
f666c1e4133d updated;
wenzelm
parents: 10580
diff changeset
   460
  Manual}~\cite{isabelle-ref}.
f666c1e4133d updated;
wenzelm
parents: 10580
diff changeset
   461
f666c1e4133d updated;
wenzelm
parents: 10580
diff changeset
   462
\medskip The \texttt{-v} option causes additional information to be printed
13047
wenzelm
parents: 13018
diff changeset
   463
while running the session, notably the location of prepared documents.
11582
f666c1e4133d updated;
wenzelm
parents: 10580
diff changeset
   464
7849
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   465
\medskip Any \texttt{usedir} session is named by some \emph{session
7882
wenzelm
parents: 7870
diff changeset
   466
  identifier}. These accumulate, documenting the way sessions depend on
wenzelm
parents: 7870
diff changeset
   467
others. For example, consider \texttt{Pure/FOL/ex}, which refers to the
9695
ec7d7f877712 proper setup of iman.sty/extra.sty/ttbox.sty;
wenzelm
parents: 9237
diff changeset
   468
examples of FOL, which in turn is built upon Pure.
7849
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   469
7882
wenzelm
parents: 7870
diff changeset
   470
The current session's identifier is by default just the base name of the
wenzelm
parents: 7870
diff changeset
   471
\texttt{LOGIC} argument (in build mode), or of the \texttt{NAME} argument (in
wenzelm
parents: 7870
diff changeset
   472
example mode). This may be overridden explicitly via the \texttt{-s} option.
7849
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   473
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   474
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   475
\subsection*{Examples}
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   476
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   477
Refer to the \texttt{IsaMakefile}s of the Isabelle distribution's
29a2a1d71128 updated;
wenzelm
parents: 7258
diff changeset
   478
object-logics as a model for your own developments.  For example, see
8363
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   479
\texttt{src/FOL/IsaMakefile}.  The Isabelle \texttt{mkdir} tool (see
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   480
\S\ref{sec:tool-mkdir}) creates \texttt{IsaMakefile}s with proper invocation
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   481
of \texttt{usedir} as well.
242dab4f164a added isatool mkdir;
wenzelm
parents: 7980
diff changeset
   482
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   483
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   484
\section{Preparing Isabelle session documents --- \texttt{isatool document}}
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   485
\label{sec:tool-document}
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   486
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   487
The \tooldx{document} utility prepares logic session documents, processing the
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   488
sources both as provided by the user and generated by Isabelle.  Its usage is:
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   489
\begin{ttbox}
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   490
Usage: document [OPTIONS] [DIR]
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   491
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   492
  Options are:
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   493
    -c           cleanup -- be aggressive in removing old stuff
17054
a7da4123523e isatool usedir: option -V and -f;
wenzelm
parents: 14921
diff changeset
   494
    -n NAME      specify document name (default 'document')
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   495
    -o FORMAT    specify output format: dvi (default), dvi.gz, ps,
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   496
                 ps.gz, pdf
17054
a7da4123523e isatool usedir: option -V and -f;
wenzelm
parents: 14921
diff changeset
   497
    -t TAGS      specify tagged region markup
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   498
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   499
  Prepare the theory session document in DIR (default 'document')
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   500
  producing the specified output format.
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   501
\end{ttbox}
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   502
This tool is usually run automatically as part of the corresponding Isabelle
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   503
batch process, provided document preparation has been enabled (cf.\ the
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   504
\texttt{-d} option of the \texttt{usedir} utility, \S\ref{sec:tool-usedir}).
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   505
It may be manually invoked on the generated browser information document
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   506
output as well, e.g.\ in case of errors encountered in the batch run.
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   507
17054
a7da4123523e isatool usedir: option -V and -f;
wenzelm
parents: 14921
diff changeset
   508
\medskip The \texttt{-c} option tells the \texttt{document} tool to dispose
a7da4123523e isatool usedir: option -V and -f;
wenzelm
parents: 14921
diff changeset
   509
the document sources after successful operation.  This is the right thing to
a7da4123523e isatool usedir: option -V and -f;
wenzelm
parents: 14921
diff changeset
   510
do for sources generated by an Isabelle process, but take care of your files
a7da4123523e isatool usedir: option -V and -f;
wenzelm
parents: 14921
diff changeset
   511
in manual document preparation!
a7da4123523e isatool usedir: option -V and -f;
wenzelm
parents: 14921
diff changeset
   512
a7da4123523e isatool usedir: option -V and -f;
wenzelm
parents: 14921
diff changeset
   513
\medskip The \texttt{-n} and \texttt{-o} option specify the final output file
a7da4123523e isatool usedir: option -V and -f;
wenzelm
parents: 14921
diff changeset
   514
name and format, the default is ``\texttt{document.dvi}''.  Note that the
a7da4123523e isatool usedir: option -V and -f;
wenzelm
parents: 14921
diff changeset
   515
result will appear in the parent of the target \texttt{DIR}.
a7da4123523e isatool usedir: option -V and -f;
wenzelm
parents: 14921
diff changeset
   516
a7da4123523e isatool usedir: option -V and -f;
wenzelm
parents: 14921
diff changeset
   517
\medskip The \texttt{-t} option tells {\LaTeX} how to interpret tagged
a7da4123523e isatool usedir: option -V and -f;
wenzelm
parents: 14921
diff changeset
   518
Isabelle command regions.  Tags are specified as a comma separated list of
a7da4123523e isatool usedir: option -V and -f;
wenzelm
parents: 14921
diff changeset
   519
modifier/name pairs: ``\verb,+,$foo$'' (or just ``$foo$'') means to keep,
a7da4123523e isatool usedir: option -V and -f;
wenzelm
parents: 14921
diff changeset
   520
``\verb,-,$foo$'' to drop, and ``\verb,/,$foo$'' to fold text tagged as $foo$.
a7da4123523e isatool usedir: option -V and -f;
wenzelm
parents: 14921
diff changeset
   521
The builtin default is equivalent to the tag specification
a7da4123523e isatool usedir: option -V and -f;
wenzelm
parents: 14921
diff changeset
   522
``\texttt{/theory,/proof,/ML,+visible,-invisible}''; see also the {\LaTeX}
a7da4123523e isatool usedir: option -V and -f;
wenzelm
parents: 14921
diff changeset
   523
macros \verb,\isakeeptag,, \verb,\isadroptag,, and \verb,\isafoldtag, in
a7da4123523e isatool usedir: option -V and -f;
wenzelm
parents: 14921
diff changeset
   524
\texttt{isabelle.sty}.
a7da4123523e isatool usedir: option -V and -f;
wenzelm
parents: 14921
diff changeset
   525
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   526
\medskip Document preparation requires a properly setup ``\texttt{document}''
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   527
directory within the logic session sources.  This directory is supposed to
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   528
contain all the files needed to produce the final document --- apart from the
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   529
actual theories which are generated by Isabelle.
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   530
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   531
\medskip For most practical purposes, the \texttt{document} tool is smart
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   532
enough to create any of the specified output formats, taking \texttt{root.tex}
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   533
supplied by the user as a starting point.  This even includes multiple runs of
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   534
{\LaTeX} to accommodate references and bibliographies (the latter assumes
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   535
\texttt{root.bib} within the same directory).
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   536
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   537
In more complex situations, a separate \texttt{IsaMakefile} for the document
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   538
sources may be given instead.  This should provide targets for any admissible
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   539
document format; these have to produce corresponding output files named after
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   540
\texttt{root} as well, e.g.\ \texttt{root.dvi} for target format \texttt{dvi}.
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   541
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   542
\medskip When running the session, Isabelle copies the original
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   543
\texttt{document} directory into its proper place within
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   544
\texttt{ISABELLE_BROWSER_INFO} according to the session path.  Then, for any
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   545
processed theory $A$ some {\LaTeX} source is generated and put there as
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   546
$A$\texttt{.tex}.  Furthermore, a list of all generated theory files is put
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   547
into \texttt{session.tex}.  Typically, the root {\LaTeX} file provided by the
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   548
user would include \texttt{session.tex} to get a document containing all the
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   549
theories.
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   550
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   551
The {\LaTeX} versions of the theories require some macros defined in
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   552
\texttt{isabelle.sty} as distributed with Isabelle.  Doing
13047
wenzelm
parents: 13018
diff changeset
   553
\verb,\usepackage{isabelle}, in \texttt{root.tex} should be fine; the
wenzelm
parents: 13018
diff changeset
   554
underlying Isabelle \texttt{latex} utility already includes an appropriate
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   555
{\TeX} inputs path.
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   556
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   557
If the text contains any references to Isabelle symbols (such as
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   558
\verb,\<forall>,) then \texttt{isabellesym.sty} should be included as well.
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   559
This package contains a standard set of {\LaTeX} macro definitions
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   560
\verb,\isasym,$foo$ corresponding to \verb,\<,$foo$\verb,>, (see
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   561
Appendix~\ref{app:symbols} for a complete list of predefined Isabelle
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   562
symbols).  Users may invent further symbols as well, just by providing
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   563
{\LaTeX} macros in a similar fashion as in \texttt{isabellesym.sty} of the
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   564
distribution.
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   565
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   566
For proper setup of PDF documents (with hyperlinks, bookmarks, and thumbnail
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   567
images), we recommend to include \verb,pdfsetup.sty, as well.  It is safe to
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   568
do so even without using PDF~\LaTeX.
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   569
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   570
\medskip As a final step of document preparation within Isabelle,
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   571
\texttt{isatool document -c} is run on the resulting \texttt{document}
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   572
directory.  Thus the actual output document is built and installed in its
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   573
proper place (as linked by the session's \texttt{index.html} if option
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   574
\texttt{-i} of \texttt{usedir} has been enabled, cf.\ \S\ref{sec:info}).  The
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   575
generated sources are deleted after successful run of {\LaTeX} and friends.
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   576
Note that a separate copy of the sources may be retained by passing an option
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   577
\texttt{-D} to the \texttt{usedir} utility when running the session (see also
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   578
\S\ref{sec:tool-usedir}).
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   579
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   580
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   581
\section{Running {\LaTeX} within the Isabelle environment --- \texttt{isatool latex}}
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   582
\label{sec:tool-latex}
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   583
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   584
The \tooldx{latex} utility provides the basic interface for Isabelle document
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   585
preparation.  Its usage is:
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   586
\begin{ttbox}
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   587
Usage: latex [OPTIONS] [FILE]
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   588
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   589
  Options are:
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   590
    -o FORMAT    specify output format: dvi (default), dvi.gz, ps,
14921
4ad751fa50c1 added option 'isatool latex -o syms';
wenzelm
parents: 13047
diff changeset
   591
                 ps.gz, pdf, bbl, png, sty, syms
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   592
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   593
  Run LaTeX (and related tools) on FILE (default root.tex),
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   594
  producing the specified output format.
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   595
\end{ttbox}
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   596
Appropriate {\LaTeX}-related programs are run on the input file, according to
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   597
the given output format: \texttt{latex}, \texttt{pdflatex}, \texttt{dvips},
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   598
\texttt{bibtex} (for \texttt{bbl}), and \texttt{thumbpdf} (for \texttt{png}).
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   599
The actual commands are determined from the settings environment
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   600
(\texttt{ISABELLE_LATEX} etc., see \S\ref{sec:settings}).
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   601
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   602
The \texttt{sty} output format causes the Isabelle style files to be updated
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   603
from the distribution.  This is useful in special situations where the
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   604
document sources are to be processed another time by separate tools (cf.\ 
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   605
option \texttt{-D} of the \texttt{usedir} utility, see
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   606
\S\ref{sec:tool-usedir}).
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   607
14921
4ad751fa50c1 added option 'isatool latex -o syms';
wenzelm
parents: 13047
diff changeset
   608
The \texttt{syms} output is for internal use; it generates lists of symbols
4ad751fa50c1 added option 'isatool latex -o syms';
wenzelm
parents: 13047
diff changeset
   609
that are available without loading additional {\LaTeX} packages.
4ad751fa50c1 added option 'isatool latex -o syms';
wenzelm
parents: 13047
diff changeset
   610
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   611
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   612
\subsubsection*{Examples}
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   613
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   614
Invoking \texttt{isatool latex} by hand may be occasionally useful when
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   615
debugging failed attempts of the automatic document preparation stage of
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   616
batch-mode Isabelle.  The abortive process leaves the sources at a certain
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   617
place within \texttt{ISABELLE_BROWSER_INFO}, see the runtime error message for
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   618
details.  This enables users to inspect {\LaTeX} runs in further detail, e.g.\ 
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   619
like this:
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   620
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   621
\begin{ttbox}
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   622
  cd ~/isabelle/browser_info/HOL/Test/document
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   623
  isatool latex -o pdf
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   624
\end{ttbox}
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   625
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   626
5364
ffa6d795c4b3 emacs local vars;
wenzelm
parents: 4555
diff changeset
   627
%%% Local Variables: 
ffa6d795c4b3 emacs local vars;
wenzelm
parents: 4555
diff changeset
   628
%%% mode: latex
ffa6d795c4b3 emacs local vars;
wenzelm
parents: 4555
diff changeset
   629
%%% TeX-master: "system"
ffa6d795c4b3 emacs local vars;
wenzelm
parents: 4555
diff changeset
   630
%%% End: