3188
|
1 |
|
|
2 |
% $Id$
|
|
3 |
|
|
4 |
\chapter{Basic concepts}
|
|
5 |
|
|
6 |
The \emph{Isabelle System Manual} describes Isabelle together with its
|
|
7 |
related tools and user interfaces --- as seen from an outside
|
|
8 |
(operating system oriented) view. On the other hand, see
|
|
9 |
\emph{Isabelle Reference} for all internal {\ML} level user commands.
|
|
10 |
|
|
11 |
\medskip The Isabelle system level environment is based on a few
|
|
12 |
generic concepts that are simple, but non-trivial:
|
|
13 |
\begin{itemize}
|
|
14 |
\item The \emph{Isabelle settings mechanism}, which provides
|
|
15 |
environment values to all Isabelle programs (including tools and
|
|
16 |
user interfaces).
|
|
17 |
\item \emph{Isabelle proper} (\ttindex{isabelle}), which runs logic
|
|
18 |
sessions, both interactively or in batch mode. In particular,
|
|
19 |
\texttt{isabelle} abstracts over the invocation of the actual {\ML}
|
|
20 |
system to be used.
|
|
21 |
\item The \emph{Isabelle tools wrapper} (\ttindex{isatool}), which
|
|
22 |
provides a generic startup platform for miscellaneous utilities.
|
|
23 |
Thus tools automatically benefit from the settings mechanism.
|
|
24 |
Furthermore, the shell's search path is kept clean from many small
|
|
25 |
programs.
|
|
26 |
\item The \emph{Isabelle interface wrapper}
|
|
27 |
(\ttindex{Isabelle}\footnote{Note the capital \texttt{I}!}), which
|
|
28 |
provides some abstraction over the actual user interface to be used
|
|
29 |
(this may include third-party ones).
|
|
30 |
\end{itemize}
|
|
31 |
|
|
32 |
\medskip The beginning user would probably just run one of the
|
|
33 |
interfaces (by invoking the capital \texttt{Isabelle}), and maybe some
|
|
34 |
basic other tools like \texttt{doc} (see \S\ref{sec:tool-doc}). This
|
|
35 |
assumes that the system has already been installed properly, of
|
|
36 |
course.\footnote{In case you have to do this yourself from scratch,
|
|
37 |
see the \ttindex{INSTALL} file in the top-level directory of the
|
|
38 |
distribution. The information provided there should be sufficient as
|
|
39 |
a start.}
|
|
40 |
|
|
41 |
|
|
42 |
\section{Isabelle settings} \label{sec:settings}
|
|
43 |
|
|
44 |
The Isabelle system heavily depends on the \emph{settings
|
|
45 |
mechanism}\indexbold{settings}. Basically, this is just a collection
|
|
46 |
of environment variables, e.g.\ \texttt{ISABELLE_HOME},
|
|
47 |
\texttt{ML_SYSTEM}, \texttt{ML_HOME}. These variables are \emph{not}
|
|
48 |
intended to be set directly from the shell!
|
|
49 |
|
|
50 |
Isabelle employs a somewhat more sophisticated scheme of
|
|
51 |
\emph{settings files} --- one for site-wide defaults, another for
|
|
52 |
optional user-specific modifications. With all configuration
|
|
53 |
variables in only one or two places, this is considered much more
|
|
54 |
maintainable and user-friendly than ordinary shell environment
|
|
55 |
variables.
|
|
56 |
|
|
57 |
In particular, we avoid the typical situation where prospective users
|
|
58 |
of a software package are told to put this and that in their shell
|
|
59 |
startup scripts. Isabelle requires none such administrative chores of
|
|
60 |
its end-users --- the executables can be run straight away. Usually,
|
|
61 |
users would want to put the Isabelle \texttt{bin} directory into their
|
|
62 |
shell's search path, of course.
|
|
63 |
|
|
64 |
|
|
65 |
\subsection{Building the environment}
|
|
66 |
|
|
67 |
The environment that all Isabelle programs are run in is built as
|
|
68 |
follows:
|
|
69 |
|
|
70 |
\begin{enumerate}
|
|
71 |
\item The special variable \ttindex{ISABELLE_HOME} is determined
|
|
72 |
automatically from the location of the binary that has been run
|
|
73 |
(e.g.\ \texttt{isabelle}).
|
|
74 |
|
|
75 |
You should not try to set \texttt{ISABELLE_HOME} manually. Also note
|
|
76 |
that the Isabelle executables have to be run from their original
|
|
77 |
location in the distribution directory --- copying or linking them
|
|
78 |
somewhere else just won't work!
|
|
79 |
|
|
80 |
\item The file \texttt{\$ISABELLE_HOME/etc/settings} ist run as a GNU
|
|
81 |
bash script with the variable auto-export option enabled.
|
|
82 |
|
|
83 |
The file typically contains a rather long list of assigments
|
|
84 |
\texttt{FOO="bar"}, thus providing the site default settings. The
|
|
85 |
Isabelle distribution already contains a global settings file with
|
|
86 |
sensible defaults. When installing the system, only a few of these
|
|
87 |
have to be adapted (most likely \texttt{ML_SYSTEM} and friends).
|
|
88 |
|
|
89 |
\item The file \texttt{\$ISABELLE_HOME_USER/etc/settings} (if it
|
|
90 |
exists) is run the same way as the site default settings. The
|
|
91 |
variable \texttt{ISABELLE_HOME_USER} has already been set before ---
|
|
92 |
usually to \texttt{\~\relax/isabelle}.
|
|
93 |
|
|
94 |
Thus individual users may override the site-wide defaults. See also
|
|
95 |
file \texttt{etc/user-settings.sample} in the distribution.
|
|
96 |
Typically, user settings are a few lines only, just containing the
|
|
97 |
assigments that are really required. One should definitely
|
|
98 |
\emph{not} start with a full copy the central
|
|
99 |
\texttt{\$ISABELLE_HOME/etc/settings}. This may cause severe
|
|
100 |
maintainance problems later, when the Isabelle installation is
|
|
101 |
updated or changed otherwise.
|
|
102 |
|
|
103 |
\end{enumerate}
|
|
104 |
|
|
105 |
Note that settings files are actually bash scripts. So one may use
|
|
106 |
complex shell commands, e.g.\ \texttt{if} or \texttt{case} statements
|
|
107 |
to set variables depending on the system architecture or other
|
|
108 |
environment variables. Such advanced features should be added only
|
|
109 |
with great care, though. In particular, external environment
|
|
110 |
references should be kept at a minimum.
|
|
111 |
|
|
112 |
\medskip A few variables are somewhat:
|
|
113 |
\begin{itemize}
|
|
114 |
\item \ttindex{ISABELLE} and \ttindex{ISATOOL} are set automatically
|
|
115 |
to the absolute path names of the \texttt{isabelle} and
|
|
116 |
\texttt{isatool} executables, respectively.
|
|
117 |
|
|
118 |
\item \ttindex{ISABELLE_PATH} and \ttindex{ISABELLE_OUTPUT} will have
|
|
119 |
the {\ML} system identifier (as specified by \texttt{ML_SYSTEM})
|
|
120 |
automatically appended to their values.
|
|
121 |
\end{itemize}
|
|
122 |
|
|
123 |
\medskip The Isabelle settings scheme is basically quite simple, but
|
|
124 |
non-trivial. For debugging purposes, the generated environment may be
|
|
125 |
inspected with the \texttt{getenv} Isabelle tool, see
|
|
126 |
\S\ref{sec:tool-getenv}.
|
|
127 |
|
|
128 |
|
|
129 |
\subsection{Common variables}
|
|
130 |
|
|
131 |
Below is a reference of common Isabelle settings variables. The list
|
|
132 |
is somewhat open-ended, in particular, third-party utilities or
|
|
133 |
interfaces may add their own selection.
|
|
134 |
|
|
135 |
\begin{ttdescription}
|
|
136 |
\item[FIXME] FIXME
|
|
137 |
\end{ttdescription}
|
|
138 |
|
|
139 |
|
|
140 |
\section{Isabelle proper --- \texttt{isabelle}}
|
|
141 |
|
|
142 |
The \ttindex{isabelle} executable runs logic sessions --- either
|
|
143 |
interactively or in batch mode. It provides an abstraction over the
|
|
144 |
underlying {\ML} system, and over the actual heap file locations. The usage is:
|
|
145 |
\begin{ttbox}
|
|
146 |
Usage: isabelle [OPTIONS] [INPUT] [OUTPUT]
|
|
147 |
|
|
148 |
Options are:
|
|
149 |
-e MLTEXT pass MLTEXT to the ML session
|
|
150 |
-m MODE add print mode for output
|
|
151 |
-q non-interactive session
|
|
152 |
-r open heap file read-only
|
|
153 |
|
|
154 |
INPUT (default "\$ISABELLE_LOGIC") and OUTPUT specify in/out heaps.
|
|
155 |
These are either names to be searched in the Isabelle path, or actual
|
|
156 |
file names (then containing at least one /).
|
|
157 |
If INPUT is "RAW_ML_SYSTEM", just start the bare bones ML system.
|
|
158 |
\end{ttbox}
|
|
159 |
Input files without path specifications are looked up in the
|
|
160 |
\texttt{ISABELLE_PATH} setting, which may consist of multiple
|
|
161 |
components separated by colons --- these are tried in the given order.
|
|
162 |
Short output names are relative to the directory specified by
|
|
163 |
\texttt{ISABELLE_OUTPUT} setting. In any case, actual file locations
|
|
164 |
can be given by including at least one \texttt{/} (use \texttt{./} to
|
|
165 |
refer to the current directory).
|
|
166 |
|
|
167 |
If the input heap file is not writable, or the \texttt{-r} option is
|
|
168 |
given explicitely, the session will be read-only. That is, the {\ML}
|
|
169 |
world cannot be committed back into the logic image. A writable
|
|
170 |
session enables commits into either the input file, or into an
|
|
171 |
alternative output heap file which may be given as the second
|
|
172 |
argument.
|
|
173 |
|
|
174 |
The read-write state of sessions is determined at startup only, it
|
|
175 |
cannot be changed intermediately. Also note that heap images may
|
|
176 |
require considerable amounts of disk space. Users are responsible
|
|
177 |
themselves to dispose no longer needed heap files.
|
|
178 |
|
|
179 |
|
|
180 |
\subsection*{Options}
|
|
181 |
|
|
182 |
Using \texttt{-e} one may pass {\ML} code to the Isabelle session from
|
|
183 |
the command line. Multiple \texttt{-e}'s are evaluated in the given
|
|
184 |
order.
|
|
185 |
|
|
186 |
The \texttt{-m} option addes print mode identifiers to be made active
|
|
187 |
for this session. Typically this is used by some user interface to
|
|
188 |
enable output of mathematical symbols from a special screen font, for
|
|
189 |
example (see also \S\ref{sec:fonts} about fonts and the \emph{Isabelle
|
|
190 |
Reference Manual} about print modes in general).
|
|
191 |
|
|
192 |
Isabelle normally enters an interactice {\ML} top-level loop (after
|
|
193 |
processing the \texttt{-e} texts). The \texttt{-q} option inhibits
|
|
194 |
this, providing a pure batch mode facility.
|
|
195 |
|
|
196 |
|
|
197 |
\subsection*{Examples}
|
|
198 |
|
|
199 |
Run an interactive session of the default object-logic:
|
|
200 |
\begin{ttbox}
|
|
201 |
isabelle
|
|
202 |
\end{ttbox}
|
|
203 |
Usually, this refers to one of the standard logic images, which are
|
|
204 |
read-only by default.
|
|
205 |
|
|
206 |
Run a writable session, based on \texttt{FOL}, but output to
|
|
207 |
\texttt{Foo} (in the directory specified by the
|
|
208 |
\texttt{ISABELLE_OUTPUT} setting):
|
|
209 |
\begin{ttbox}
|
|
210 |
isabelle FOL Foo
|
|
211 |
\end{ttbox}
|
|
212 |
Ending this session normally (e.g.\ by typing control-D), dumps the
|
|
213 |
whole {\ML} system state into \texttt{Foo}. Be prepared for several
|
|
214 |
megabytes!
|
|
215 |
|
|
216 |
The \texttt{Foo} session may be continued (writably!) at exactly the
|
|
217 |
same point as follows:
|
|
218 |
\begin{ttbox}
|
|
219 |
isabelle Foo
|
|
220 |
\end{ttbox}
|
|
221 |
|
|
222 |
\medskip This is a simple batch mode example, printing a certain
|
|
223 |
theorem of \texttt{FOL}:
|
|
224 |
\begin{ttbox}
|
|
225 |
isabelle -e "prth allE;" -q -r FOL
|
|
226 |
\end{ttbox}
|
|
227 |
Note that the output text will be usually interspered with some
|
|
228 |
garbage produced by the {\ML} compiler.
|
|
229 |
|