3188
|
1 |
|
|
2 |
% $Id$
|
|
3 |
|
3278
|
4 |
\chapter{Miscellaneous tools} \label{ch:tools}
|
3188
|
5 |
|
3217
|
6 |
Subsequently we describe various Isabelle related utilities --- in
|
|
7 |
alphabetical order.
|
|
8 |
|
|
9 |
|
|
10 |
\section{Viewing documentation --- \texttt{isatool doc}} \label{sec:tool-doc}
|
|
11 |
|
|
12 |
The \tooldx{doc} utility displays online documentation:
|
|
13 |
\begin{ttbox}
|
|
14 |
Usage: isatool doc [DOC]
|
|
15 |
|
|
16 |
View Isabelle documentation DOC, or show list of available documents.
|
|
17 |
\end{ttbox}
|
7882
|
18 |
If called without arguments, it lists all available documents. Each line
|
|
19 |
starts with an identifier, followed by a short description. Any of these
|
|
20 |
identifiers may be specified as the first argument in order to have the
|
|
21 |
corresponding document displayed.
|
3217
|
22 |
|
7882
|
23 |
\medskip The \texttt{ISABELLE_DOCS} setting specifies the list of directories
|
|
24 |
(separated by colons) to be scanned for documentations. The program for
|
|
25 |
viewing \texttt{dvi} files is determined by the \texttt{DVI_VIEWER} setting.
|
3217
|
26 |
|
|
27 |
|
|
28 |
\section{Tuning proof scripts --- \texttt{isatool expandshort}}
|
|
29 |
|
|
30 |
The \tooldx{expandshort} utility tunes {\ML} proof scripts to enhance
|
4540
|
31 |
readability:
|
3217
|
32 |
\begin{ttbox}
|
4540
|
33 |
Usage: expandshort [FILES|DIRS...]
|
3217
|
34 |
|
7498
|
35 |
Recursively find .ML files, expand shorthand goal commands. Also
|
|
36 |
contracts uses of resolve_tac, dresolve_tac, eresolve_tac,
|
7883
|
37 |
forward_tac, rewrite_goals_tac on 1-element lists; furthermore
|
|
38 |
expands tabs, which are forbidden in SML string constants.
|
3217
|
39 |
|
4540
|
40 |
Renames old versions of files by appending "~~".
|
3217
|
41 |
\end{ttbox}
|
7882
|
42 |
In the files or directories supplied as arguments, all occurrences of the
|
|
43 |
shorthand commands \texttt{br}, \texttt{be} etc.\ in proof scripts are
|
|
44 |
replaced with the corresponding full commands. The old versions of the files
|
|
45 |
are renamed to have the suffix``~\verb'~~'''.
|
4540
|
46 |
|
3217
|
47 |
|
5366
|
48 |
\section{Getting logic images --- \texttt{isatool findlogics}}
|
3217
|
49 |
|
|
50 |
The \tooldx{findlogics} utility traverses all directories specified in
|
7882
|
51 |
\texttt{ISABELLE_PATH}, looking for Isabelle logic images. Its usage is:
|
3217
|
52 |
\begin{ttbox}
|
|
53 |
Usage: isatool findlogics
|
|
54 |
|
|
55 |
Collect heap file names from ISABELLE_PATH.
|
|
56 |
\end{ttbox}
|
6414
|
57 |
The base names of all files found on the path are printed --- sorted and with
|
|
58 |
duplicates removed. Also note that \texttt{ISABELLE_PATH} implicitly depends
|
|
59 |
upon \texttt{ML_SYSTEM} and \texttt{ML_PLATFORM}. Thus switching to another
|
3217
|
60 |
{\ML} compiler may change the set of logic images available.
|
|
61 |
|
3188
|
62 |
|
|
63 |
\section{Inspecting the settings environment -- \texttt{isatool getenv}}
|
|
64 |
\label{sec:tool-getenv}
|
|
65 |
|
7882
|
66 |
The Isabelle settings environment --- as provided by the site-default and
|
|
67 |
user-specific settings files --- can be inspected with the \tooldx{getenv}
|
|
68 |
utility:
|
3188
|
69 |
\begin{ttbox}
|
|
70 |
Usage: isatool getenv [OPTIONS] [VARNAMES ...]
|
|
71 |
|
|
72 |
Options are:
|
|
73 |
-a display complete environment
|
|
74 |
-b print values only (doesn't work for -a)
|
|
75 |
|
|
76 |
Get value of VARNAMES from the Isabelle settings.
|
|
77 |
\end{ttbox}
|
|
78 |
|
7882
|
79 |
With the \texttt{-a} option, one may inspect the full process environment that
|
|
80 |
Isabelle related programs are run in. This usually contains much more
|
|
81 |
variables than are actually Isabelle settings. Normally, output is a list of
|
|
82 |
lines of the form \mbox{$name$\texttt{=}$value$}. The \texttt{-b} option
|
|
83 |
causes only the values to be printed.
|
3188
|
84 |
|
|
85 |
|
|
86 |
\subsection*{Examples}
|
|
87 |
|
7882
|
88 |
Get the {\ML} system identifier and the location where the compiler binaries
|
|
89 |
are supposed to reside as follows:
|
3188
|
90 |
\begin{ttbox}
|
|
91 |
isatool getenv ML_SYSTEM ML_HOME
|
4540
|
92 |
{\out ML_SYSTEM=smlnj-110}
|
|
93 |
{\out ML_HOME=/usr/local/smlnj-110/bin}
|
3188
|
94 |
\end{ttbox}
|
|
95 |
|
7882
|
96 |
The next one peeks at the search path that \texttt{isabelle} uses to locate
|
|
97 |
logic images:
|
3188
|
98 |
\begin{ttbox}
|
|
99 |
isatool getenv -b ISABELLE_PATH
|
4540
|
100 |
{\out /home/me/isabelle/heaps/smlnj-110:/usr/local/isabelle/heaps/smlnj-110}
|
3188
|
101 |
\end{ttbox}
|
4555
|
102 |
Here we have used the \texttt{-b} option to suppress the
|
|
103 |
\texttt{ISABELLE_PATH=} prefix. The value above is what became of the
|
|
104 |
following assignment in the default settings file:
|
3188
|
105 |
\begin{ttbox}
|
|
106 |
ISABELLE_PATH=\$ISABELLE_HOME_USER/heaps:\$ISABELLE_HOME/heaps
|
|
107 |
\end{ttbox}
|
7882
|
108 |
Note how the \texttt{ML_SYSTEM} value got appended automatically to each path
|
|
109 |
component. This is a special feature of \texttt{ISABELLE_PATH} (and also of
|
|
110 |
\texttt{ISABELLE_OUTPUT}).
|
3188
|
111 |
|
|
112 |
|
6418
|
113 |
\section{Installing standalone Isabelle executables -- \texttt{isatool install}}
|
7882
|
114 |
\label{sec:tool-install}
|
5366
|
115 |
|
7882
|
116 |
By default, the Isabelle binaries (\texttt{isabelle}, \texttt{isatool} etc.)
|
|
117 |
are just run from their location within the distribution directory, probably
|
6418
|
118 |
indirectly by the shell through its \texttt{PATH}. Other schemes of
|
|
119 |
installation are supported by the \tooldx{install} utility:
|
5366
|
120 |
\begin{ttbox}
|
6418
|
121 |
Usage: install [OPTIONS]
|
5366
|
122 |
|
5405
|
123 |
Options are:
|
7883
|
124 |
-d DISTDIR use DISTDIR as Isabelle distribution
|
|
125 |
(default ISABELLE_HOME)
|
6418
|
126 |
-k install KDE application icon on Desktop
|
|
127 |
-p DIR install standalone binaries in DIR
|
5405
|
128 |
|
6418
|
129 |
Install Isabelle executables with absolute references to the current
|
|
130 |
distribution directory.
|
5366
|
131 |
\end{ttbox}
|
|
132 |
|
6418
|
133 |
The \texttt{-d} option overrides the current Isabelle distribution directory
|
|
134 |
as determined by \texttt{ISABELLE_HOME}.
|
|
135 |
|
|
136 |
The \texttt{-p} option installs executable wrapper scripts for
|
|
137 |
\texttt{isabelle}, \texttt{isatool}, \texttt{Isabelle}, containing proper
|
|
138 |
absolute references to the Isabelle distribution directory. A typical
|
|
139 |
\texttt{DIR} specification would be some directory expected to be in the
|
|
140 |
shell's \texttt{PATH}, such as \texttt{/usr/local/bin}. It is important to
|
|
141 |
note that a plain manual copy of the original Isabelle executables just would
|
|
142 |
not work!
|
|
143 |
|
7882
|
144 |
The \texttt{-k} option creates an Isabelle application object for the popular
|
|
145 |
\textsl{K~Desktop Environment} (KDE)\index{KDE}. The icon will appear
|
|
146 |
directly on Desktop.
|
5366
|
147 |
|
|
148 |
|
5571
|
149 |
\section{Creating instances of the Isabelle logo -- \texttt{isatool
|
|
150 |
logo}}
|
|
151 |
|
|
152 |
The \tooldx{logo} utility creates any instance of the generic Isabelle logo as
|
|
153 |
an Encapsuled Postscript file (EPS):
|
|
154 |
\begin{ttbox}
|
|
155 |
Usage: logo [OPTIONS] NAME
|
|
156 |
|
|
157 |
Create instance NAME of the Isabelle logo (as EPS).
|
|
158 |
|
|
159 |
Options are:
|
|
160 |
-o OUTFILE set output file (default determined from NAME)
|
|
161 |
-q quiet mode
|
|
162 |
\end{ttbox}
|
|
163 |
You are encouraged to use this to create a derived logo for your Isabelle
|
|
164 |
project. For example, \texttt{isatool logo HOOL} creates
|
|
165 |
\texttt{isabelle_hool.eps}.
|
|
166 |
|
|
167 |
|
3188
|
168 |
\section{Isabelle's version of make --- \texttt{isatool make}}
|
|
169 |
|
3217
|
170 |
The Isabelle \tooldx{make} utility is a very simple wrapper for
|
|
171 |
ordinary Unix \texttt{make}:
|
3188
|
172 |
\begin{ttbox}
|
|
173 |
Usage: isatool make [ARGS ...]
|
|
174 |
|
7801
|
175 |
Compile the logic in current directory using IsaMakefile.
|
3188
|
176 |
ARGS are directly passed to the system make program.
|
|
177 |
\end{ttbox}
|
3217
|
178 |
Note that the Isabelle settings environment is also active. Thus one
|
3278
|
179 |
may refer to its values within the \ttindex{IsaMakefile}, e.g.\
|
3217
|
180 |
\texttt{\$(ISABELLE_OUTPUT)}. Furthermore, programs started from the
|
3278
|
181 |
make file also inherit this environment. Typically,
|
|
182 |
\texttt{IsaMakefile}s defer the real work to the \texttt{usedir}
|
|
183 |
utility, see \S\ref{sec:tool-usedir}.
|
3217
|
184 |
|
3278
|
185 |
\medskip The basic \texttt{IsaMakefile} convention is that the default
|
4540
|
186 |
target builds the actual logic, including its parents if appropriate.
|
4555
|
187 |
The \texttt{images} target is intended to build all local logic
|
|
188 |
images, while the \texttt{test} target shall build all related
|
|
189 |
examples. The \texttt{all} target shall do \texttt{images} and
|
|
190 |
\texttt{test}.
|
4540
|
191 |
|
|
192 |
|
|
193 |
\subsection*{Examples}
|
|
194 |
|
|
195 |
Refer to the \texttt{IsaMakefile}s of the Isabelle distribution's
|
4555
|
196 |
object-logics as a model for your own developements. For example, see
|
|
197 |
\texttt{src/FOL/IsaMakefile}.
|
4540
|
198 |
|
|
199 |
|
|
200 |
\section{Make all logics -- \texttt{isatool makeall}}
|
|
201 |
|
|
202 |
The \tooldx{makeall} utility applies Isabelle make to all logic
|
4555
|
203 |
directories of the distribution:
|
4540
|
204 |
\begin{ttbox}
|
|
205 |
Usage: makeall [ARGS ...]
|
|
206 |
|
|
207 |
Apply isatool make to all logics (passing ARGS).
|
|
208 |
\end{ttbox}
|
4555
|
209 |
The arguments \texttt{ARGS} are just passed verbatim to each
|
4540
|
210 |
\texttt{make} invocation.
|
3188
|
211 |
|
5366
|
212 |
%%% Local Variables:
|
|
213 |
%%% mode: latex
|
|
214 |
%%% TeX-master: "system"
|
|
215 |
%%% End:
|