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