author | wenzelm |
Tue, 08 Mar 2016 18:15:16 +0100 | |
changeset 62559 | 83e815849a91 |
parent 62551 | df62e1ab7d88 |
child 62562 | 905a5db3932d |
permissions | -rw-r--r-- |
61656 | 1 |
(*:maxLineLen=78:*) |
61575 | 2 |
|
28224 | 3 |
theory Misc |
43564
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
wenzelm
parents:
41512
diff
changeset
|
4 |
imports Base |
28224 | 5 |
begin |
6 |
||
58618 | 7 |
chapter \<open>Miscellaneous tools \label{ch:tools}\<close> |
28224 | 8 |
|
58618 | 9 |
text \<open> |
61575 | 10 |
Subsequently we describe various Isabelle related utilities, given in |
11 |
alphabetical order. |
|
58618 | 12 |
\<close> |
28224 | 13 |
|
14 |
||
58618 | 15 |
section \<open>Resolving Isabelle components \label{sec:tool-components}\<close> |
48844 | 16 |
|
58618 | 17 |
text \<open> |
48844 | 18 |
The @{tool_def components} tool resolves Isabelle components: |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
19 |
@{verbatim [display] |
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
20 |
\<open>Usage: isabelle components [OPTIONS] [COMPONENTS ...] |
48844 | 21 |
|
22 |
Options are: |
|
50653
5c85f8b80b95
simplified quick start via "isabelle components -I";
wenzelm
parents:
50132
diff
changeset
|
23 |
-I init user settings |
48844 | 24 |
-R URL component repository |
25 |
(default $ISABELLE_COMPONENT_REPOSITORY) |
|
53435 | 26 |
-a resolve all missing components |
48844 | 27 |
-l list status |
28 |
||
29 |
Resolve Isabelle components via download and installation. |
|
30 |
COMPONENTS are identified via base name. |
|
31 |
||
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
32 |
ISABELLE_COMPONENT_REPOSITORY="http://isabelle.in.tum.de/components"\<close>} |
48844 | 33 |
|
61575 | 34 |
Components are initialized as described in \secref{sec:components} in a |
35 |
permissive manner, which can mark components as ``missing''. This state is |
|
36 |
amended by letting @{tool "components"} download and unpack components that |
|
37 |
are published on the default component repository @{url |
|
38 |
"http://isabelle.in.tum.de/components/"} in particular. |
|
48844 | 39 |
|
61575 | 40 |
Option \<^verbatim>\<open>-R\<close> specifies an alternative component repository. Note that |
41 |
\<^verbatim>\<open>file:///\<close> URLs can be used for local directories. |
|
48844 | 42 |
|
61575 | 43 |
Option \<^verbatim>\<open>-a\<close> selects all missing components to be resolved. Explicit |
44 |
components may be named as command line-arguments as well. Note that |
|
45 |
components are uniquely identified by their base name, while the |
|
46 |
installation takes place in the location that was specified in the attempt |
|
47 |
to initialize the component before. |
|
48844 | 48 |
|
61575 | 49 |
Option \<^verbatim>\<open>-l\<close> lists the current state of available and missing components |
50 |
with their location (full name) within the file-system. |
|
50653
5c85f8b80b95
simplified quick start via "isabelle components -I";
wenzelm
parents:
50132
diff
changeset
|
51 |
|
61575 | 52 |
Option \<^verbatim>\<open>-I\<close> initializes the user settings file to subscribe to the standard |
53 |
components specified in the Isabelle repository clone --- this does not make |
|
54 |
any sense for regular Isabelle releases. If the file already exists, it |
|
55 |
needs to be edited manually according to the printed explanation. |
|
58618 | 56 |
\<close> |
48844 | 57 |
|
58 |
||
58618 | 59 |
section \<open>Raw ML console\<close> |
57439
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
60 |
|
58618 | 61 |
text \<open> |
57439
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
62 |
The @{tool_def console} tool runs the Isabelle process with raw ML console: |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
63 |
@{verbatim [display] |
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
64 |
\<open>Usage: isabelle console [OPTIONS] |
57439
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
65 |
|
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
66 |
Options are: |
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
67 |
-d DIR include session directory |
62509
13d6948e4b12
isabelle console -r" helps to bootstrap Isabelle/Pure;
wenzelm
parents:
62451
diff
changeset
|
68 |
-l NAME logic session name (default ISABELLE_LOGIC="HOL") |
57439
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
69 |
-m MODE add print mode for output |
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
70 |
-n no build of session image on startup |
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
71 |
-o OPTION override Isabelle system OPTION (via NAME=VAL or NAME) |
62509
13d6948e4b12
isabelle console -r" helps to bootstrap Isabelle/Pure;
wenzelm
parents:
62451
diff
changeset
|
72 |
-r logic session is RAW_ML_SYSTEM |
57439
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
73 |
-s system build mode for session image |
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
74 |
|
62559 | 75 |
Run Isabelle process with raw ML console and line editor.\<close>} |
57439
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
76 |
|
62559 | 77 |
Option \<^verbatim>\<open>-l\<close> specifies the logic session name. By default, its heap image is |
78 |
checked and built on demand, but the option \<^verbatim>\<open>-n\<close> skips that. Option \<^verbatim>\<open>-r\<close> |
|
79 |
abbreviates \<^verbatim>\<open>-l RAW_ML_SYSTEM\<close>, which is relevant to bootstrap |
|
62509
13d6948e4b12
isabelle console -r" helps to bootstrap Isabelle/Pure;
wenzelm
parents:
62451
diff
changeset
|
80 |
Isabelle/Pure interactively. |
13d6948e4b12
isabelle console -r" helps to bootstrap Isabelle/Pure;
wenzelm
parents:
62451
diff
changeset
|
81 |
|
62559 | 82 |
Options \<^verbatim>\<open>-d\<close> and \<^verbatim>\<open>-s\<close> have the same meaning as for @{tool build} |
61575 | 83 |
(\secref{sec:tool-build}). |
57439
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
84 |
|
62559 | 85 |
Options \<^verbatim>\<open>-m\<close> and \<^verbatim>\<open>-o\<close> have the same meaning as for the raw @{executable |
86 |
isabelle_process} (\secref{sec:isabelle-process}). |
|
57439
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
87 |
|
62559 | 88 |
\<^medskip> |
89 |
Interaction works via the built-in line editor of Scala, which is based on |
|
90 |
JLine\<^footnote>\<open>@{url "https://github.com/jline"}\<close>. The user is connected to the raw |
|
91 |
ML toplevel loop: this is neither Isabelle/Isar nor Isabelle/ML within the |
|
92 |
usual formal context. The most relevant ML commands at this stage are @{ML |
|
93 |
use}, @{ML use_thy}, @{ML use_thys}. |
|
58618 | 94 |
\<close> |
57439
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
95 |
|
0e41f26a0250
"isabelle tty" is superseded by "isabelle console";
wenzelm
parents:
57414
diff
changeset
|
96 |
|
58618 | 97 |
section \<open>Displaying documents \label{sec:tool-display}\<close> |
28224 | 98 |
|
61575 | 99 |
text \<open> |
100 |
The @{tool_def display} tool displays documents in DVI or PDF format: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
101 |
@{verbatim [display] |
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
102 |
\<open>Usage: isabelle display DOCUMENT |
28224 | 103 |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
104 |
Display DOCUMENT (in DVI or PDF format).\<close>} |
28224 | 105 |
|
61406 | 106 |
\<^medskip> |
61575 | 107 |
The settings @{setting DVI_VIEWER} and @{setting PDF_VIEWER} determine the |
108 |
programs for viewing the corresponding file formats. Normally this opens the |
|
109 |
document via the desktop environment, potentially in an asynchronous manner |
|
110 |
with re-use of previews views. |
|
58618 | 111 |
\<close> |
28224 | 112 |
|
113 |
||
58618 | 114 |
section \<open>Viewing documentation \label{sec:tool-doc}\<close> |
28224 | 115 |
|
58618 | 116 |
text \<open> |
52444
2cfe6656d6d6
slightly improved "isabelle doc" based on Isabelle/Scala;
wenzelm
parents:
52052
diff
changeset
|
117 |
The @{tool_def doc} tool displays Isabelle documentation: |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
118 |
@{verbatim [display] |
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
119 |
\<open>Usage: isabelle doc [DOC ...] |
28224 | 120 |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
121 |
View Isabelle documentation.\<close>} |
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
122 |
|
61575 | 123 |
If called without arguments, it lists all available documents. Each line |
124 |
starts with an identifier, followed by a short description. Any of these |
|
125 |
identifiers may be specified as arguments, in order to display the |
|
126 |
corresponding document (see also \secref{sec:tool-display}). |
|
28224 | 127 |
|
61406 | 128 |
\<^medskip> |
61575 | 129 |
The @{setting ISABELLE_DOCS} setting specifies the list of directories |
130 |
(separated by colons) to be scanned for documentations. |
|
58618 | 131 |
\<close> |
28224 | 132 |
|
133 |
||
58618 | 134 |
section \<open>Shell commands within the settings environment \label{sec:tool-env}\<close> |
47828 | 135 |
|
61575 | 136 |
text \<open> |
137 |
The @{tool_def env} tool is a direct wrapper for the standard |
|
138 |
\<^verbatim>\<open>/usr/bin/env\<close> command on POSIX systems, running within the Isabelle |
|
139 |
settings environment (\secref{sec:settings}). |
|
47828 | 140 |
|
61575 | 141 |
The command-line arguments are that of the underlying version of \<^verbatim>\<open>env\<close>. For |
142 |
example, the following invokes an instance of the GNU Bash shell within the |
|
143 |
Isabelle environment: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
144 |
@{verbatim [display] \<open>isabelle env bash\<close>} |
58618 | 145 |
\<close> |
47828 | 146 |
|
147 |
||
58618 | 148 |
section \<open>Inspecting the settings environment \label{sec:tool-getenv}\<close> |
28224 | 149 |
|
58618 | 150 |
text \<open>The Isabelle settings environment --- as provided by the |
28224 | 151 |
site-default and user-specific settings files --- can be inspected |
48602 | 152 |
with the @{tool_def getenv} tool: |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
153 |
@{verbatim [display] |
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
154 |
\<open>Usage: isabelle getenv [OPTIONS] [VARNAMES ...] |
28224 | 155 |
|
156 |
Options are: |
|
157 |
-a display complete environment |
|
158 |
-b print values only (doesn't work for -a) |
|
31497 | 159 |
-d FILE dump complete environment to FILE |
160 |
(null terminated entries) |
|
28224 | 161 |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
162 |
Get value of VARNAMES from the Isabelle settings.\<close>} |
28224 | 163 |
|
61575 | 164 |
With the \<^verbatim>\<open>-a\<close> option, one may inspect the full process environment that |
165 |
Isabelle related programs are run in. This usually contains much more |
|
166 |
variables than are actually Isabelle settings. Normally, output is a list of |
|
167 |
lines of the form \<open>name\<close>\<^verbatim>\<open>=\<close>\<open>value\<close>. The \<^verbatim>\<open>-b\<close> option causes only the values |
|
168 |
to be printed. |
|
31497 | 169 |
|
61575 | 170 |
Option \<^verbatim>\<open>-d\<close> produces a dump of the complete environment to the specified |
171 |
file. Entries are terminated by the ASCII null character, i.e.\ the C string |
|
172 |
terminator. |
|
58618 | 173 |
\<close> |
28224 | 174 |
|
175 |
||
58618 | 176 |
subsubsection \<open>Examples\<close> |
28224 | 177 |
|
61575 | 178 |
text \<open> |
179 |
Get the location of @{setting ISABELLE_HOME_USER} where user-specific |
|
180 |
information is stored: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
181 |
@{verbatim [display] \<open>isabelle getenv ISABELLE_HOME_USER\<close>} |
28224 | 182 |
|
61406 | 183 |
\<^medskip> |
61575 | 184 |
Get the value only of the same settings variable, which is particularly |
185 |
useful in shell scripts: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
186 |
@{verbatim [display] \<open>isabelle getenv -b ISABELLE_OUTPUT\<close>} |
58618 | 187 |
\<close> |
28224 | 188 |
|
189 |
||
58618 | 190 |
section \<open>Installing standalone Isabelle executables \label{sec:tool-install}\<close> |
28224 | 191 |
|
61575 | 192 |
text \<open> |
193 |
By default, the main Isabelle binaries (@{executable "isabelle"} etc.) are |
|
194 |
just run from their location within the distribution directory, probably |
|
195 |
indirectly by the shell through its @{setting PATH}. Other schemes of |
|
196 |
installation are supported by the @{tool_def install} tool: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
197 |
@{verbatim [display] |
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
198 |
\<open>Usage: isabelle install [OPTIONS] BINDIR |
28224 | 199 |
|
200 |
Options are: |
|
50132 | 201 |
-d DISTDIR refer to DISTDIR as Isabelle distribution |
28224 | 202 |
(default ISABELLE_HOME) |
203 |
||
50132 | 204 |
Install Isabelle executables with absolute references to the |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
205 |
distribution directory.\<close>} |
28224 | 206 |
|
61575 | 207 |
The \<^verbatim>\<open>-d\<close> option overrides the current Isabelle distribution directory as |
208 |
determined by @{setting ISABELLE_HOME}. |
|
28224 | 209 |
|
61575 | 210 |
The \<open>BINDIR\<close> argument tells where executable wrapper scripts for |
211 |
@{executable "isabelle_process"} and @{executable isabelle} should be |
|
212 |
placed, which is typically a directory in the shell's @{setting PATH}, such |
|
213 |
as \<^verbatim>\<open>$HOME/bin\<close>. |
|
48815 | 214 |
|
61406 | 215 |
\<^medskip> |
61575 | 216 |
It is also possible to make symbolic links of the main Isabelle executables |
217 |
manually, but making separate copies outside the Isabelle distribution |
|
218 |
directory will not work! |
|
219 |
\<close> |
|
28224 | 220 |
|
221 |
||
58618 | 222 |
section \<open>Creating instances of the Isabelle logo\<close> |
28224 | 223 |
|
61575 | 224 |
text \<open> |
225 |
The @{tool_def logo} tool creates instances of the generic Isabelle logo as |
|
226 |
EPS and PDF, for inclusion in {\LaTeX} documents. |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
227 |
@{verbatim [display] |
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
228 |
\<open>Usage: isabelle logo [OPTIONS] XYZ |
28224 | 229 |
|
49072
747835eb2782
"isabelle logo" produces EPS and PDF format simultaneously;
wenzelm
parents:
48985
diff
changeset
|
230 |
Create instance XYZ of the Isabelle logo (as EPS and PDF). |
28224 | 231 |
|
232 |
Options are: |
|
49072
747835eb2782
"isabelle logo" produces EPS and PDF format simultaneously;
wenzelm
parents:
48985
diff
changeset
|
233 |
-n NAME alternative output base name (default "isabelle_xyx") |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
234 |
-q quiet mode\<close>} |
48936 | 235 |
|
61575 | 236 |
Option \<^verbatim>\<open>-n\<close> specifies an alternative (base) name for the generated files. |
237 |
The default is \<^verbatim>\<open>isabelle_\<close>\<open>xyz\<close> in lower-case. |
|
48936 | 238 |
|
61503 | 239 |
Option \<^verbatim>\<open>-q\<close> omits printing of the result file name. |
48936 | 240 |
|
61406 | 241 |
\<^medskip> |
61575 | 242 |
Implementors of Isabelle tools and applications are encouraged to make |
243 |
derived Isabelle logos for their own projects using this template. |
|
244 |
\<close> |
|
28224 | 245 |
|
246 |
||
58618 | 247 |
section \<open>Output the version identifier of the Isabelle distribution\<close> |
28224 | 248 |
|
58618 | 249 |
text \<open> |
48602 | 250 |
The @{tool_def version} tool displays Isabelle version information: |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
251 |
@{verbatim [display] |
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
252 |
\<open>Usage: isabelle version [OPTIONS] |
41511 | 253 |
|
254 |
Options are: |
|
255 |
-i short identification (derived from Mercurial id) |
|
256 |
||
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
257 |
Display Isabelle version information.\<close>} |
41511 | 258 |
|
61406 | 259 |
\<^medskip> |
61575 | 260 |
The default is to output the full version string of the Isabelle |
261 |
distribution, e.g.\ ``\<^verbatim>\<open>Isabelle2012: May 2012\<close>. |
|
41511 | 262 |
|
61575 | 263 |
The \<^verbatim>\<open>-i\<close> option produces a short identification derived from the Mercurial |
264 |
id of the @{setting ISABELLE_HOME} directory. |
|
58618 | 265 |
\<close> |
28224 | 266 |
|
267 |
end |