author | wenzelm |
Wed, 09 Mar 2016 20:36:29 +0100 | |
changeset 62576 | 26179aa33fe7 |
parent 62573 | 27f90319a499 |
child 62588 | cd266473b81b |
permissions | -rw-r--r-- |
61656 | 1 |
(*:maxLineLen=78:*) |
61575 | 2 |
|
28215 | 3 |
theory Basics |
43564
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
wenzelm
parents:
41955
diff
changeset
|
4 |
imports Base |
28215 | 5 |
begin |
6 |
||
58618 | 7 |
chapter \<open>The Isabelle system environment\<close> |
28215 | 8 |
|
61575 | 9 |
text \<open> |
10 |
This manual describes Isabelle together with related tools and user |
|
11 |
interfaces as seen from a system oriented view. See also the \<^emph>\<open>Isabelle/Isar |
|
12 |
Reference Manual\<close> @{cite "isabelle-isar-ref"} for the actual Isabelle input |
|
13 |
language and related concepts, and \<^emph>\<open>The Isabelle/Isar Implementation |
|
61477 | 14 |
Manual\<close> @{cite "isabelle-implementation"} for the main concepts of the |
47823 | 15 |
underlying implementation in Isabelle/ML. |
28215 | 16 |
|
61406 | 17 |
\<^medskip> |
61575 | 18 |
The Isabelle system environment provides the following basic infrastructure |
19 |
to integrate tools smoothly. |
|
28215 | 20 |
|
61575 | 21 |
\<^enum> The \<^emph>\<open>Isabelle settings\<close> mechanism provides process environment variables |
22 |
to all Isabelle executables (including tools and user interfaces). |
|
28215 | 23 |
|
61575 | 24 |
\<^enum> The raw \<^emph>\<open>Isabelle process\<close> (@{executable_ref "isabelle_process"}) runs |
62573 | 25 |
logic sessions in batch mode. This is rarely required for regular users. |
28215 | 26 |
|
61575 | 27 |
\<^enum> The main \<^emph>\<open>Isabelle tool wrapper\<close> (@{executable_ref isabelle}) provides a |
28 |
generic startup environment Isabelle related utilities, user interfaces etc. |
|
29 |
Such tools automatically benefit from the settings mechanism. |
|
58618 | 30 |
\<close> |
28215 | 31 |
|
32 |
||
58618 | 33 |
section \<open>Isabelle settings \label{sec:settings}\<close> |
28215 | 34 |
|
58618 | 35 |
text \<open> |
62013 | 36 |
The Isabelle system heavily depends on the \<^emph>\<open>settings mechanism\<close>. |
37 |
Essentially, this is a statically scoped collection of environment |
|
38 |
variables, such as @{setting ISABELLE_HOME}, @{setting ML_SYSTEM}, @{setting |
|
39 |
ML_HOME}. These variables are \<^emph>\<open>not\<close> intended to be set directly from the |
|
40 |
shell, though. Isabelle employs a somewhat more sophisticated scheme of |
|
41 |
\<^emph>\<open>settings files\<close> --- one for site-wide defaults, another for additional |
|
42 |
user-specific modifications. With all configuration variables in clearly |
|
43 |
defined places, this scheme is more maintainable and user-friendly than |
|
44 |
global shell environment variables. |
|
28215 | 45 |
|
61575 | 46 |
In particular, we avoid the typical situation where prospective users of a |
47 |
software package are told to put several things into their shell startup |
|
48 |
scripts, before being able to actually run the program. Isabelle requires |
|
49 |
none such administrative chores of its end-users --- the executables can be |
|
50 |
invoked straight away. Occasionally, users would still want to put the |
|
51 |
@{file "$ISABELLE_HOME/bin"} directory into their shell's search path, but |
|
28238 | 52 |
this is not required. |
58618 | 53 |
\<close> |
28215 | 54 |
|
55 |
||
58618 | 56 |
subsection \<open>Bootstrapping the environment \label{sec:boot}\<close> |
28215 | 57 |
|
61575 | 58 |
text \<open> |
59 |
Isabelle executables need to be run within a proper settings environment. |
|
60 |
This is bootstrapped as described below, on the first invocation of one of |
|
61 |
the outer wrapper scripts (such as @{executable_ref isabelle}). This happens |
|
62 |
only once for each process tree, i.e.\ the environment is passed to |
|
63 |
subprocesses according to regular Unix conventions. |
|
64 |
||
65 |
\<^enum> The special variable @{setting_def ISABELLE_HOME} is determined |
|
66 |
automatically from the location of the binary that has been run. |
|
28215 | 67 |
|
61575 | 68 |
You should not try to set @{setting ISABELLE_HOME} manually. Also note |
69 |
that the Isabelle executables either have to be run from their original |
|
70 |
location in the distribution directory, or via the executable objects |
|
71 |
created by the @{tool install} tool. Symbolic links are admissible, but a |
|
72 |
plain copy of the @{file "$ISABELLE_HOME/bin"} files will not work! |
|
73 |
||
74 |
\<^enum> The file @{file "$ISABELLE_HOME/etc/settings"} is run as a |
|
75 |
@{executable_ref bash} shell script with the auto-export option for |
|
76 |
variables enabled. |
|
28238 | 77 |
|
61575 | 78 |
This file holds a rather long list of shell variable assignments, thus |
79 |
providing the site-wide default settings. The Isabelle distribution |
|
80 |
already contains a global settings file with sensible defaults for most |
|
81 |
variables. When installing the system, only a few of these may have to be |
|
82 |
adapted (probably @{setting ML_SYSTEM} etc.). |
|
83 |
||
84 |
\<^enum> The file @{file_unchecked "$ISABELLE_HOME_USER/etc/settings"} (if it |
|
85 |
exists) is run in the same way as the site default settings. Note that the |
|
86 |
variable @{setting ISABELLE_HOME_USER} has already been set before --- |
|
87 |
usually to something like \<^verbatim>\<open>$USER_HOME/.isabelle/IsabelleXXXX\<close>. |
|
61458 | 88 |
|
61575 | 89 |
Thus individual users may override the site-wide defaults. Typically, a |
90 |
user settings file contains only a few lines, with some assignments that |
|
91 |
are actually changed. Never copy the central @{file |
|
92 |
"$ISABELLE_HOME/etc/settings"} file! |
|
28215 | 93 |
|
61575 | 94 |
Since settings files are regular GNU @{executable_def bash} scripts, one may |
95 |
use complex shell commands, such as \<^verbatim>\<open>if\<close> or \<^verbatim>\<open>case\<close> statements to set |
|
96 |
variables depending on the system architecture or other environment |
|
97 |
variables. Such advanced features should be added only with great care, |
|
98 |
though. In particular, external environment references should be kept at a |
|
28215 | 99 |
minimum. |
100 |
||
61406 | 101 |
\<^medskip> |
102 |
A few variables are somewhat special: |
|
28215 | 103 |
|
61575 | 104 |
\<^item> @{setting_def ISABELLE_PROCESS} and @{setting_def ISABELLE_TOOL} are set |
105 |
automatically to the absolute path names of the @{executable |
|
106 |
"isabelle_process"} and @{executable isabelle} executables, respectively. |
|
28215 | 107 |
|
61575 | 108 |
\<^item> @{setting_ref ISABELLE_OUTPUT} will have the identifiers of the Isabelle |
109 |
distribution (cf.\ @{setting ISABELLE_IDENTIFIER}) and the ML system (cf.\ |
|
110 |
@{setting ML_IDENTIFIER}) appended automatically to its value. |
|
28215 | 111 |
|
61406 | 112 |
\<^medskip> |
61575 | 113 |
Note that the settings environment may be inspected with the @{tool getenv} |
114 |
tool. This might help to figure out the effect of complex settings scripts. |
|
115 |
\<close> |
|
28215 | 116 |
|
117 |
||
58618 | 118 |
subsection \<open>Common variables\<close> |
28215 | 119 |
|
58618 | 120 |
text \<open> |
61575 | 121 |
This is a reference of common Isabelle settings variables. Note that the |
122 |
list is somewhat open-ended. Third-party utilities or interfaces may add |
|
123 |
their own selection. Variables that are special in some sense are marked |
|
124 |
with \<open>\<^sup>*\<close>. |
|
28215 | 125 |
|
61575 | 126 |
\<^descr>[@{setting_def USER_HOME}\<open>\<^sup>*\<close>] Is the cross-platform user home directory. |
127 |
On Unix systems this is usually the same as @{setting HOME}, but on Windows |
|
128 |
it is the regular home directory of the user, not the one of within the |
|
129 |
Cygwin root file-system.\<^footnote>\<open>Cygwin itself offers another choice whether its |
|
130 |
HOME should point to the @{file_unchecked "/home"} directory tree or the |
|
61572 | 131 |
Windows user home.\<close> |
47661
012a887997f3
USER_HOME settings variable points to cross-platform user home directory;
wenzelm
parents:
45028
diff
changeset
|
132 |
|
61575 | 133 |
\<^descr>[@{setting_def ISABELLE_HOME}\<open>\<^sup>*\<close>] is the location of the top-level |
134 |
Isabelle distribution directory. This is automatically determined from the |
|
135 |
Isabelle executable that has been invoked. Do not attempt to set @{setting |
|
136 |
ISABELLE_HOME} yourself from the shell! |
|
50182 | 137 |
|
61575 | 138 |
\<^descr>[@{setting_def ISABELLE_HOME_USER}] is the user-specific counterpart of |
139 |
@{setting ISABELLE_HOME}. The default value is relative to @{file_unchecked |
|
140 |
"$USER_HOME/.isabelle"}, under rare circumstances this may be changed in the |
|
141 |
global setting file. Typically, the @{setting ISABELLE_HOME_USER} directory |
|
142 |
mimics @{setting ISABELLE_HOME} to some extend. In particular, site-wide |
|
143 |
defaults may be overridden by a private \<^verbatim>\<open>$ISABELLE_HOME_USER/etc/settings\<close>. |
|
144 |
||
145 |
\<^descr>[@{setting_def ISABELLE_PLATFORM_FAMILY}\<open>\<^sup>*\<close>] is automatically set to the |
|
146 |
general platform family: \<^verbatim>\<open>linux\<close>, \<^verbatim>\<open>macos\<close>, \<^verbatim>\<open>windows\<close>. Note that |
|
50182 | 147 |
platform-dependent tools usually need to refer to the more specific |
148 |
identification according to @{setting ISABELLE_PLATFORM}, @{setting |
|
149 |
ISABELLE_PLATFORM32}, @{setting ISABELLE_PLATFORM64}. |
|
150 |
||
61575 | 151 |
\<^descr>[@{setting_def ISABELLE_PLATFORM}\<open>\<^sup>*\<close>] is automatically set to a symbolic |
152 |
identifier for the underlying hardware and operating system. The Isabelle |
|
153 |
platform identification always refers to the 32 bit variant, even this is a |
|
154 |
64 bit machine. Note that the ML or Java runtime may have a different idea, |
|
155 |
depending on which binaries are actually run. |
|
36196
cbb9ee265cdd
added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
33952
diff
changeset
|
156 |
|
61575 | 157 |
\<^descr>[@{setting_def ISABELLE_PLATFORM64}\<open>\<^sup>*\<close>] is similar to @{setting |
158 |
ISABELLE_PLATFORM} but refers to the proper 64 bit variant on a platform |
|
159 |
that supports this; the value is empty for 32 bit. Note that the following |
|
160 |
bash expression (including the quotes) prefers the 64 bit platform, if that |
|
161 |
is available: |
|
47823 | 162 |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
163 |
@{verbatim [display] \<open>"${ISABELLE_PLATFORM64:-$ISABELLE_PLATFORM}"\<close>} |
36196
cbb9ee265cdd
added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents:
33952
diff
changeset
|
164 |
|
61575 | 165 |
\<^descr>[@{setting_def ISABELLE_PROCESS}\<open>\<^sup>*\<close>, @{setting ISABELLE_TOOL}\<open>\<^sup>*\<close>] are |
166 |
automatically set to the full path names of the @{executable |
|
167 |
"isabelle_process"} and @{executable isabelle} executables, respectively. |
|
168 |
Thus other tools and scripts need not assume that the @{file |
|
169 |
"$ISABELLE_HOME/bin"} directory is on the current search path of the shell. |
|
28215 | 170 |
|
61575 | 171 |
\<^descr>[@{setting_def ISABELLE_IDENTIFIER}\<open>\<^sup>*\<close>] refers to the name of this |
172 |
Isabelle distribution, e.g.\ ``\<^verbatim>\<open>Isabelle2012\<close>''. |
|
173 |
||
174 |
\<^descr>[@{setting_def ML_SYSTEM}, @{setting_def ML_HOME}, @{setting_def |
|
175 |
ML_OPTIONS}, @{setting_def ML_PLATFORM}, @{setting_def ML_IDENTIFIER}\<open>\<^sup>*\<close>] |
|
176 |
specify the underlying ML system to be used for Isabelle. There is only a |
|
177 |
fixed set of admissable @{setting ML_SYSTEM} names (see the @{file |
|
28238 | 178 |
"$ISABELLE_HOME/etc/settings"} file of the distribution). |
61575 | 179 |
|
28215 | 180 |
The actual compiler binary will be run from the directory @{setting |
61575 | 181 |
ML_HOME}, with @{setting ML_OPTIONS} as first arguments on the command line. |
182 |
The optional @{setting ML_PLATFORM} may specify the binary format of ML heap |
|
183 |
images, which is useful for cross-platform installations. The value of |
|
184 |
@{setting ML_IDENTIFIER} is automatically obtained by composing the values |
|
185 |
of @{setting ML_SYSTEM}, @{setting ML_PLATFORM} and the Isabelle version |
|
186 |
values. |
|
47823 | 187 |
|
61575 | 188 |
\<^descr>[@{setting_def ISABELLE_JDK_HOME}] needs to point to a full JDK (Java |
189 |
Development Kit) installation with \<^verbatim>\<open>javac\<close> and \<^verbatim>\<open>jar\<close> executables. This is |
|
190 |
essential for Isabelle/Scala and other JVM-based tools to work properly. |
|
191 |
Note that conventional \<^verbatim>\<open>JAVA_HOME\<close> usually points to the JRE (Java Runtime |
|
47823 | 192 |
Environment), not JDK. |
61575 | 193 |
|
194 |
\<^descr>[@{setting_def ISABELLE_PATH}] is a list of directories (separated by |
|
195 |
colons) where Isabelle logic images may reside. When looking up heaps files, |
|
196 |
the value of @{setting ML_IDENTIFIER} is appended to each component |
|
197 |
internally. |
|
198 |
||
199 |
\<^descr>[@{setting_def ISABELLE_OUTPUT}\<open>\<^sup>*\<close>] is a directory where output heap files |
|
200 |
should be stored by default. The ML system and Isabelle version identifier |
|
201 |
is appended here, too. |
|
202 |
||
203 |
\<^descr>[@{setting_def ISABELLE_BROWSER_INFO}] is the directory where theory |
|
62013 | 204 |
browser information is stored as HTML and PDF (see also \secref{sec:info}). |
205 |
The default value is @{file_unchecked "$ISABELLE_HOME_USER/browser_info"}. |
|
61575 | 206 |
|
207 |
\<^descr>[@{setting_def ISABELLE_LOGIC}] specifies the default logic to load if none |
|
208 |
is given explicitely by the user. The default value is \<^verbatim>\<open>HOL\<close>. |
|
209 |
||
62562
905a5db3932d
back to external line editor, due to problems of JLine with multithreading of in vs. out;
wenzelm
parents:
62559
diff
changeset
|
210 |
\<^descr>[@{setting_def ISABELLE_LINE_EDITOR}] specifies the line editor for the |
905a5db3932d
back to external line editor, due to problems of JLine with multithreading of in vs. out;
wenzelm
parents:
62559
diff
changeset
|
211 |
@{tool_ref console} interface. |
905a5db3932d
back to external line editor, due to problems of JLine with multithreading of in vs. out;
wenzelm
parents:
62559
diff
changeset
|
212 |
|
61575 | 213 |
\<^descr>[@{setting_def ISABELLE_LATEX}, @{setting_def ISABELLE_PDFLATEX}, |
214 |
@{setting_def ISABELLE_BIBTEX}] refer to {\LaTeX} related tools for Isabelle |
|
215 |
document preparation (see also \secref{sec:tool-latex}). |
|
216 |
||
217 |
\<^descr>[@{setting_def ISABELLE_TOOLS}] is a colon separated list of directories |
|
218 |
that are scanned by @{executable isabelle} for external utility programs |
|
219 |
(see also \secref{sec:isabelle-tool}). |
|
50197
b385d134926d
eval PDF_VIEWER/DVI_VIEWER command line, which allows additional quotes for program name, for example;
wenzelm
parents:
50182
diff
changeset
|
220 |
|
61575 | 221 |
\<^descr>[@{setting_def ISABELLE_DOCS}] is a colon separated list of directories |
222 |
with documentation files. |
|
223 |
||
224 |
\<^descr>[@{setting_def PDF_VIEWER}] specifies the program to be used for displaying |
|
225 |
\<^verbatim>\<open>pdf\<close> files. |
|
54683
cf48ddc266e5
clarified "isabelle display" and 'display_drafts': re-use file and program instance, open asynchronously via desktop environment;
wenzelm
parents:
52746
diff
changeset
|
226 |
|
61575 | 227 |
\<^descr>[@{setting_def DVI_VIEWER}] specifies the program to be used for displaying |
228 |
\<^verbatim>\<open>dvi\<close> files. |
|
229 |
||
230 |
\<^descr>[@{setting_def ISABELLE_TMP_PREFIX}\<open>\<^sup>*\<close>] is the prefix from which any |
|
231 |
running @{executable "isabelle_process"} derives an individual directory for |
|
232 |
temporary files. |
|
58618 | 233 |
\<close> |
28215 | 234 |
|
235 |
||
58618 | 236 |
subsection \<open>Additional components \label{sec:components}\<close> |
32323 | 237 |
|
61575 | 238 |
text \<open> |
239 |
Any directory may be registered as an explicit \<^emph>\<open>Isabelle component\<close>. The |
|
240 |
general layout conventions are that of the main Isabelle distribution |
|
241 |
itself, and the following two files (both optional) have a special meaning: |
|
32323 | 242 |
|
61575 | 243 |
\<^item> \<^verbatim>\<open>etc/settings\<close> holds additional settings that are initialized when |
244 |
bootstrapping the overall Isabelle environment, cf.\ \secref{sec:boot}. As |
|
245 |
usual, the content is interpreted as a \<^verbatim>\<open>bash\<close> script. It may refer to the |
|
246 |
component's enclosing directory via the \<^verbatim>\<open>COMPONENT\<close> shell variable. |
|
32323 | 247 |
|
61575 | 248 |
For example, the following setting allows to refer to files within the |
249 |
component later on, without having to hardwire absolute paths: |
|
250 |
@{verbatim [display] \<open>MY_COMPONENT_HOME="$COMPONENT"\<close>} |
|
32323 | 251 |
|
61575 | 252 |
Components can also add to existing Isabelle settings such as |
253 |
@{setting_def ISABELLE_TOOLS}, in order to provide component-specific |
|
254 |
tools that can be invoked by end-users. For example: |
|
255 |
@{verbatim [display] \<open>ISABELLE_TOOLS="$ISABELLE_TOOLS:$COMPONENT/lib/Tools"\<close>} |
|
32323 | 256 |
|
61575 | 257 |
\<^item> \<^verbatim>\<open>etc/components\<close> holds a list of further sub-components of the same |
258 |
structure. The directory specifications given here can be either absolute |
|
259 |
(with leading \<^verbatim>\<open>/\<close>) or relative to the component's main directory. |
|
32323 | 260 |
|
61575 | 261 |
The root of component initialization is @{setting ISABELLE_HOME} itself. |
262 |
After initializing all of its sub-components recursively, @{setting |
|
263 |
ISABELLE_HOME_USER} is included in the same manner (if that directory |
|
264 |
exists). This allows to install private components via @{file_unchecked |
|
265 |
"$ISABELLE_HOME_USER/etc/components"}, although it is often more convenient |
|
266 |
to do that programmatically via the \<^verbatim>\<open>init_component\<close> shell function in the |
|
267 |
\<^verbatim>\<open>etc/settings\<close> script of \<^verbatim>\<open>$ISABELLE_HOME_USER\<close> (or any other component |
|
268 |
directory). For example: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
269 |
@{verbatim [display] \<open>init_component "$HOME/screwdriver-2.0"\<close>} |
48838
623ba165d059
direct support for component forests via init_components;
wenzelm
parents:
48813
diff
changeset
|
270 |
|
61575 | 271 |
This is tolerant wrt.\ missing component directories, but might produce a |
272 |
warning. |
|
48838
623ba165d059
direct support for component forests via init_components;
wenzelm
parents:
48813
diff
changeset
|
273 |
|
61406 | 274 |
\<^medskip> |
61575 | 275 |
More complex situations may be addressed by initializing components listed |
276 |
in a given catalog file, relatively to some base directory: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
277 |
@{verbatim [display] \<open>init_components "$HOME/my_component_store" "some_catalog_file"\<close>} |
48838
623ba165d059
direct support for component forests via init_components;
wenzelm
parents:
48813
diff
changeset
|
278 |
|
61575 | 279 |
The component directories listed in the catalog file are treated as relative |
280 |
to the given base directory. |
|
48844 | 281 |
|
61575 | 282 |
See also \secref{sec:tool-components} for some tool-support for resolving |
283 |
components that are formally initialized but not installed yet. |
|
58618 | 284 |
\<close> |
32323 | 285 |
|
286 |
||
58618 | 287 |
section \<open>The raw Isabelle process \label{sec:isabelle-process}\<close> |
28215 | 288 |
|
58618 | 289 |
text \<open> |
62573 | 290 |
The @{executable_def "isabelle_process"} executable runs a bare-bone |
291 |
Isabelle logic session in batch mode: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
292 |
@{verbatim [display] |
62475
43e64c770f28
isabelle_process executable no longer supports writable heap images;
wenzelm
parents:
62451
diff
changeset
|
293 |
\<open>Usage: isabelle_process [OPTIONS] [HEAP] |
28215 | 294 |
|
295 |
Options are: |
|
62506 | 296 |
-e ML_EXPR evaluate ML expression on startup |
297 |
-f ML_FILE evaluate ML file on startup |
|
28215 | 298 |
-m MODE add print mode for output |
52056 | 299 |
-o OPTION override Isabelle system OPTION (via NAME=VAL or NAME) |
28215 | 300 |
|
62573 | 301 |
If HEAP is a plain name (default $ISABELLE_LOGIC), it is searched in |
302 |
$ISABELLE_PATH; if it contains a slash, it is taken as literal file; |
|
303 |
if it is RAW_ML_SYSTEM, the initial ML heap is used.\<close>} |
|
28215 | 304 |
|
62573 | 305 |
Heap files without explicit directory specifications are looked up in the |
306 |
@{setting ISABELLE_PATH} setting, which may consist of multiple components |
|
307 |
separated by colons --- these are tried in the given order with the value of |
|
308 |
@{setting ML_IDENTIFIER} appended internally. |
|
58618 | 309 |
\<close> |
28215 | 310 |
|
311 |
||
58618 | 312 |
subsubsection \<open>Options\<close> |
28215 | 313 |
|
58618 | 314 |
text \<open> |
62506 | 315 |
Options \<^verbatim>\<open>-e\<close> and \<^verbatim>\<open>-f\<close> allow to evaluate ML code, before the ML process is |
316 |
started. The source is either given literally or taken from a file. Multiple |
|
317 |
\<^verbatim>\<open>-e\<close> and \<^verbatim>\<open>-f\<close> options are evaluated in the given order. Errors lead to |
|
318 |
premature exit of the ML process with return code 1. |
|
28215 | 319 |
|
61406 | 320 |
\<^medskip> |
61575 | 321 |
The \<^verbatim>\<open>-m\<close> option adds identifiers of print modes to be made active for this |
62573 | 322 |
session. For example, \<^verbatim>\<open>-m ASCII\<close> prefers ASCII replacement syntax over |
323 |
mathematical Isabelle symbols. |
|
28215 | 324 |
|
61406 | 325 |
\<^medskip> |
61575 | 326 |
Option \<^verbatim>\<open>-o\<close> allows to override Isabelle system options for this process, |
62573 | 327 |
see also \secref{sec:system-options}. |
58618 | 328 |
\<close> |
28215 | 329 |
|
330 |
||
58618 | 331 |
subsubsection \<open>Examples\<close> |
28215 | 332 |
|
58618 | 333 |
text \<open> |
62573 | 334 |
In order to demonstrate batch execution of Isabelle, we retrieve the \<^verbatim>\<open>Main\<close> |
335 |
theory value from the theory loader within ML (observe the delicate quoting |
|
336 |
rules for the Bash shell vs.\ ML): |
|
337 |
@{verbatim [display] \<open>isabelle_process -e 'Thy_Info.get_theory "Main"' HOL\<close>} |
|
58618 | 338 |
\<close> |
28238 | 339 |
|
340 |
||
58618 | 341 |
section \<open>The Isabelle tool wrapper \label{sec:isabelle-tool}\<close> |
28238 | 342 |
|
58618 | 343 |
text \<open> |
61575 | 344 |
All Isabelle related tools and interfaces are called via a common wrapper |
345 |
--- @{executable isabelle}: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
346 |
@{verbatim [display] |
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
347 |
\<open>Usage: isabelle TOOL [ARGS ...] |
28238 | 348 |
|
28506 | 349 |
Start Isabelle tool NAME with ARGS; pass "-?" for tool specific help. |
28238 | 350 |
|
48858 | 351 |
Available tools: |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
352 |
...\<close>} |
28238 | 353 |
|
61575 | 354 |
In principle, Isabelle tools are ordinary executable scripts that are run |
355 |
within the Isabelle settings environment, see \secref{sec:settings}. The set |
|
356 |
of available tools is collected by @{executable isabelle} from the |
|
357 |
directories listed in the @{setting ISABELLE_TOOLS} setting. Do not try to |
|
358 |
call the scripts directly from the shell. Neither should you add the tool |
|
359 |
directories to your shell's search path! |
|
58618 | 360 |
\<close> |
28238 | 361 |
|
362 |
||
58618 | 363 |
subsubsection \<open>Examples\<close> |
28238 | 364 |
|
61575 | 365 |
text \<open> |
366 |
Show the list of available documentation of the Isabelle distribution: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
367 |
@{verbatim [display] \<open>isabelle doc\<close>} |
28238 | 368 |
|
369 |
View a certain document as follows: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
370 |
@{verbatim [display] \<open>isabelle doc system\<close>} |
28238 | 371 |
|
48813 | 372 |
Query the Isabelle settings environment: |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
373 |
@{verbatim [display] \<open>isabelle getenv ISABELLE_HOME_USER\<close>} |
58618 | 374 |
\<close> |
28215 | 375 |
|
62451 | 376 |
|
377 |
section \<open>YXML versus XML\<close> |
|
378 |
||
379 |
text \<open> |
|
380 |
Isabelle tools often use YXML, which is a simple and efficient syntax for |
|
381 |
untyped XML trees. The YXML format is defined as follows. |
|
382 |
||
383 |
\<^enum> The encoding is always UTF-8. |
|
384 |
||
385 |
\<^enum> Body text is represented verbatim (no escaping, no special treatment of |
|
386 |
white space, no named entities, no CDATA chunks, no comments). |
|
387 |
||
388 |
\<^enum> Markup elements are represented via ASCII control characters \<open>\<^bold>X = 5\<close> |
|
389 |
and \<open>\<^bold>Y = 6\<close> as follows: |
|
390 |
||
391 |
\begin{tabular}{ll} |
|
392 |
XML & YXML \\\hline |
|
393 |
\<^verbatim>\<open><\<close>\<open>name attribute\<close>\<^verbatim>\<open>=\<close>\<open>value \<dots>\<close>\<^verbatim>\<open>>\<close> & |
|
394 |
\<open>\<^bold>X\<^bold>Yname\<^bold>Yattribute\<close>\<^verbatim>\<open>=\<close>\<open>value\<dots>\<^bold>X\<close> \\ |
|
395 |
\<^verbatim>\<open></\<close>\<open>name\<close>\<^verbatim>\<open>>\<close> & \<open>\<^bold>X\<^bold>Y\<^bold>X\<close> \\ |
|
396 |
\end{tabular} |
|
397 |
||
398 |
There is no special case for empty body text, i.e.\ \<^verbatim>\<open><foo/>\<close> is treated |
|
399 |
like \<^verbatim>\<open><foo></foo>\<close>. Also note that \<open>\<^bold>X\<close> and \<open>\<^bold>Y\<close> may never occur in |
|
400 |
well-formed XML documents. |
|
401 |
||
402 |
Parsing YXML is pretty straight-forward: split the text into chunks |
|
403 |
separated by \<open>\<^bold>X\<close>, then split each chunk into sub-chunks separated by \<open>\<^bold>Y\<close>. |
|
404 |
Markup chunks start with an empty sub-chunk, and a second empty sub-chunk |
|
405 |
indicates close of an element. Any other non-empty chunk consists of plain |
|
406 |
text. For example, see @{file "~~/src/Pure/PIDE/yxml.ML"} or @{file |
|
407 |
"~~/src/Pure/PIDE/yxml.scala"}. |
|
408 |
||
409 |
YXML documents may be detected quickly by checking that the first two |
|
410 |
characters are \<open>\<^bold>X\<^bold>Y\<close>. |
|
411 |
\<close> |
|
412 |
||
28223 | 413 |
end |