author | wenzelm |
Sat, 10 Jun 2017 21:48:02 +0200 | |
changeset 66061 | 880db47fed30 |
parent 65505 | 741fad555d82 |
child 66576 | 7d4da1c62de7 |
permissions | -rw-r--r-- |
61656 | 1 |
(*:maxLineLen=78:*) |
61575 | 2 |
|
48578 | 3 |
theory Sessions |
4 |
imports Base |
|
5 |
begin |
|
6 |
||
58618 | 7 |
chapter \<open>Isabelle sessions and build management \label{ch:session}\<close> |
48584 | 8 |
|
61575 | 9 |
text \<open> |
10 |
An Isabelle \<^emph>\<open>session\<close> consists of a collection of related theories that may |
|
11 |
be associated with formal documents (\chref{ch:present}). There is also a |
|
12 |
notion of \<^emph>\<open>persistent heap\<close> image to capture the state of a session, |
|
13 |
similar to object-code in compiled programming languages. Thus the concept |
|
14 |
of session resembles that of a ``project'' in common IDE environments, but |
|
15 |
the specific name emphasizes the connection to interactive theorem proving: |
|
16 |
the session wraps-up the results of user-interaction with the prover in a |
|
17 |
persistent form. |
|
48584 | 18 |
|
61575 | 19 |
Application sessions are built on a given parent session, which may be built |
20 |
recursively on other parents. Following this path in the hierarchy |
|
21 |
eventually leads to some major object-logic session like \<open>HOL\<close>, which itself |
|
22 |
is based on \<open>Pure\<close> as the common root of all sessions. |
|
48584 | 23 |
|
61575 | 24 |
Processing sessions may take considerable time. Isabelle build management |
25 |
helps to organize this efficiently. This includes support for parallel build |
|
26 |
jobs, in addition to the multithreaded theory and proof checking that is |
|
27 |
already provided by the prover process itself. |
|
28 |
\<close> |
|
48604 | 29 |
|
48578 | 30 |
|
58618 | 31 |
section \<open>Session ROOT specifications \label{sec:session-root}\<close> |
48578 | 32 |
|
61575 | 33 |
text \<open> |
34 |
Session specifications reside in files called \<^verbatim>\<open>ROOT\<close> within certain |
|
35 |
directories, such as the home locations of registered Isabelle components or |
|
36 |
additional project directories given by the user. |
|
48579 | 37 |
|
61575 | 38 |
The ROOT file format follows the lexical conventions of the \<^emph>\<open>outer syntax\<close> |
39 |
of Isabelle/Isar, see also @{cite "isabelle-isar-ref"}. This defines common |
|
40 |
forms like identifiers, names, quoted strings, verbatim text, nested |
|
41 |
comments etc. The grammar for @{syntax session_chapter} and @{syntax |
|
42 |
session_entry} is given as syntax diagram below; each ROOT file may contain |
|
43 |
multiple specifications like this. Chapters help to organize browser info |
|
44 |
(\secref{sec:info}), but have no formal meaning. The default chapter is |
|
45 |
``\<open>Unsorted\<close>''. |
|
48579 | 46 |
|
61575 | 47 |
Isabelle/jEdit @{cite "isabelle-jedit"} includes a simple editing mode |
48 |
\<^verbatim>\<open>isabelle-root\<close> for session ROOT files, which is enabled by default for any |
|
49 |
file of that name. |
|
48579 | 50 |
|
55112
b1a5d603fd12
prefer rail cartouche -- avoid back-slashed quotes;
wenzelm
parents:
54705
diff
changeset
|
51 |
@{rail \<open> |
51417 | 52 |
@{syntax_def session_chapter}: @'chapter' @{syntax name} |
53 |
; |
|
54 |
||
48579 | 55 |
@{syntax_def session_entry}: @'session' spec '=' (@{syntax name} '+')? body |
56 |
; |
|
56533
cd8b6d849b6a
explicit 'document_files' in session ROOT specifications;
wenzelm
parents:
55112
diff
changeset
|
57 |
body: description? options? (theories+) \<newline> files? (document_files*) |
48579 | 58 |
; |
48738
f8c1a5b9488f
simplified session specifications: names are taken verbatim and current directory is default;
wenzelm
parents:
48737
diff
changeset
|
59 |
spec: @{syntax name} groups? dir? |
48579 | 60 |
; |
61 |
groups: '(' (@{syntax name} +) ')' |
|
62 |
; |
|
63 |
dir: @'in' @{syntax name} |
|
64 |
; |
|
65 |
description: @'description' @{syntax text} |
|
66 |
; |
|
67 |
options: @'options' opts |
|
68 |
; |
|
48605
e777363440d6
allow negative int values as well, according to real = int | float;
wenzelm
parents:
48604
diff
changeset
|
69 |
opts: '[' ( (@{syntax name} '=' value | @{syntax name}) + ',' ) ']' |
e777363440d6
allow negative int values as well, according to real = int | float;
wenzelm
parents:
48604
diff
changeset
|
70 |
; |
e777363440d6
allow negative int values as well, according to real = int | float;
wenzelm
parents:
48604
diff
changeset
|
71 |
value: @{syntax name} | @{syntax real} |
48579 | 72 |
; |
65504 | 73 |
sessions: @'sessions' (@{syntax name}+) |
65374 | 74 |
; |
75 |
theories: @'theories' opts? (theory_entry*) |
|
48579 | 76 |
; |
65504 | 77 |
theory_entry: @{syntax name} ('(' @'global' ')')? |
78 |
; |
|
56533
cd8b6d849b6a
explicit 'document_files' in session ROOT specifications;
wenzelm
parents:
55112
diff
changeset
|
79 |
files: @'files' (@{syntax name}+) |
cd8b6d849b6a
explicit 'document_files' in session ROOT specifications;
wenzelm
parents:
55112
diff
changeset
|
80 |
; |
cd8b6d849b6a
explicit 'document_files' in session ROOT specifications;
wenzelm
parents:
55112
diff
changeset
|
81 |
document_files: @'document_files' ('(' dir ')')? (@{syntax name}+) |
55112
b1a5d603fd12
prefer rail cartouche -- avoid back-slashed quotes;
wenzelm
parents:
54705
diff
changeset
|
82 |
\<close>} |
48579 | 83 |
|
61575 | 84 |
\<^descr> \isakeyword{session}~\<open>A = B + body\<close> defines a new session \<open>A\<close> based on |
65504 | 85 |
parent session \<open>B\<close>, with its content given in \<open>body\<close> (imported sessions, |
86 |
theories and auxiliary source files). Note that a parent (like \<open>HOL\<close>) is |
|
87 |
mandatory in practical applications: only Isabelle/Pure can bootstrap itself |
|
88 |
from nothing. |
|
48579 | 89 |
|
65504 | 90 |
All such session specifications together describe a hierarchy (graph) of |
61575 | 91 |
sessions, with globally unique names. The new session name \<open>A\<close> should be |
92 |
sufficiently long and descriptive to stand on its own in a potentially large |
|
93 |
library. |
|
48579 | 94 |
|
61575 | 95 |
\<^descr> \isakeyword{session}~\<open>A (groups)\<close> indicates a collection of groups where |
96 |
the new session is a member. Group names are uninterpreted and merely follow |
|
97 |
certain conventions. For example, the Isabelle distribution tags some |
|
98 |
important sessions by the group name called ``\<open>main\<close>''. Other projects may |
|
99 |
invent their own conventions, but this requires some care to avoid clashes |
|
48604 | 100 |
within this unchecked name space. |
48579 | 101 |
|
61575 | 102 |
\<^descr> \isakeyword{session}~\<open>A\<close>~\isakeyword{in}~\<open>dir\<close> specifies an explicit |
103 |
directory for this session; by default this is the current directory of the |
|
104 |
\<^verbatim>\<open>ROOT\<close> file. |
|
48579 | 105 |
|
61575 | 106 |
All theories and auxiliary source files are located relatively to the |
107 |
session directory. The prover process is run within the same as its current |
|
108 |
working directory. |
|
48579 | 109 |
|
61575 | 110 |
\<^descr> \isakeyword{description}~\<open>text\<close> is a free-form annotation for this |
111 |
session. |
|
48579 | 112 |
|
61575 | 113 |
\<^descr> \isakeyword{options}~\<open>[x = a, y = b, z]\<close> defines separate options |
114 |
(\secref{sec:system-options}) that are used when processing this session, |
|
115 |
but \<^emph>\<open>without\<close> propagation to child sessions. Note that \<open>z\<close> abbreviates \<open>z = |
|
116 |
true\<close> for Boolean options. |
|
117 |
||
65504 | 118 |
\<^descr> \isakeyword{sessions}~\<open>names\<close> specifies sessions that are \<^emph>\<open>imported\<close> into |
119 |
the current name space of theories. This allows to refer to a theory \<open>A\<close> |
|
120 |
from session \<open>B\<close> by the qualified name \<open>B.A\<close> --- although it is loaded again |
|
121 |
into the current ML process, which is in contrast to a theory that is |
|
122 |
already present in the \<^emph>\<open>parent\<close> session. |
|
123 |
||
65505 | 124 |
Theories that are imported from other sessions are excluded from the current |
125 |
session document. |
|
126 |
||
61575 | 127 |
\<^descr> \isakeyword{theories}~\<open>options names\<close> specifies a block of theories that |
128 |
are processed within an environment that is augmented by the given options, |
|
129 |
in addition to the global session options given before. Any number of blocks |
|
130 |
of \isakeyword{theories} may be given. Options are only active for each |
|
48604 | 131 |
\isakeyword{theories} block separately. |
48579 | 132 |
|
65374 | 133 |
A theory name that is followed by \<open>(\<close>\isakeyword{global}\<open>)\<close> is treated |
134 |
literally in other session specifications or theory imports. In contrast, |
|
135 |
the default is to qualify theory names by the session name, in order to |
|
65504 | 136 |
ensure globally unique names in big session graphs. |
65374 | 137 |
|
61575 | 138 |
\<^descr> \isakeyword{files}~\<open>files\<close> lists additional source files that are involved |
139 |
in the processing of this session. This should cover anything outside the |
|
140 |
formal content of the theory sources. In contrast, files that are loaded |
|
141 |
formally within a theory, e.g.\ via @{command "ML_file"}, need not be |
|
51055 | 142 |
declared again. |
48579 | 143 |
|
61575 | 144 |
\<^descr> \isakeyword{document_files}~\<open>(\<close>\isakeyword{in}~\<open>base_dir) files\<close> lists |
145 |
source files for document preparation, typically \<^verbatim>\<open>.tex\<close> and \<^verbatim>\<open>.sty\<close> for |
|
146 |
{\LaTeX}. Only these explicitly given files are copied from the base |
|
147 |
directory to the document output directory, before formal document |
|
148 |
processing is started (see also \secref{sec:tool-document}). The local path |
|
149 |
structure of the \<open>files\<close> is preserved, which allows to reconstruct the |
|
150 |
original directory hierarchy of \<open>base_dir\<close>. |
|
56533
cd8b6d849b6a
explicit 'document_files' in session ROOT specifications;
wenzelm
parents:
55112
diff
changeset
|
151 |
|
61493 | 152 |
\<^descr> \isakeyword{document_files}~\<open>files\<close> abbreviates |
61575 | 153 |
\isakeyword{document_files}~\<open>(\<close>\isakeyword{in}~\<open>document) files\<close>, i.e.\ |
154 |
document sources are taken from the base directory \<^verbatim>\<open>document\<close> within the |
|
155 |
session root directory. |
|
58618 | 156 |
\<close> |
48579 | 157 |
|
51055 | 158 |
|
58618 | 159 |
subsubsection \<open>Examples\<close> |
48580 | 160 |
|
61575 | 161 |
text \<open> |
63680 | 162 |
See \<^file>\<open>~~/src/HOL/ROOT\<close> for a diversity of practically relevant situations, |
163 |
although it uses relatively complex quasi-hierarchic naming conventions like |
|
164 |
\<^verbatim>\<open>HOL-SPARK\<close>, \<^verbatim>\<open>HOL-SPARK-Examples\<close>. An alternative is to use unqualified |
|
165 |
names that are relatively long and descriptive, as in the Archive of Formal |
|
166 |
Proofs (\<^url>\<open>http://afp.sourceforge.net\<close>), for example. |
|
61575 | 167 |
\<close> |
48578 | 168 |
|
169 |
||
58618 | 170 |
section \<open>System build options \label{sec:system-options}\<close> |
48578 | 171 |
|
61575 | 172 |
text \<open> |
63680 | 173 |
See \<^file>\<open>~~/etc/options\<close> for the main defaults provided by the Isabelle |
61575 | 174 |
distribution. Isabelle/jEdit @{cite "isabelle-jedit"} includes a simple |
175 |
editing mode \<^verbatim>\<open>isabelle-options\<close> for this file-format. |
|
48693
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48684
diff
changeset
|
176 |
|
61575 | 177 |
The following options are particularly relevant to build Isabelle sessions, |
178 |
in particular with document preparation (\chref{ch:present}). |
|
51055 | 179 |
|
61575 | 180 |
\<^item> @{system_option_def "browser_info"} controls output of HTML browser |
181 |
info, see also \secref{sec:info}. |
|
51055 | 182 |
|
61575 | 183 |
\<^item> @{system_option_def "document"} specifies the document output format, |
184 |
see @{tool document} option \<^verbatim>\<open>-o\<close> in \secref{sec:tool-document}. In |
|
185 |
practice, the most relevant values are \<^verbatim>\<open>document=false\<close> or |
|
186 |
\<^verbatim>\<open>document=pdf\<close>. |
|
51055 | 187 |
|
61575 | 188 |
\<^item> @{system_option_def "document_output"} specifies an alternative |
189 |
directory for generated output of the document preparation system; the |
|
190 |
default is within the @{setting "ISABELLE_BROWSER_INFO"} hierarchy as |
|
191 |
explained in \secref{sec:info}. See also @{tool mkroot}, which generates a |
|
192 |
default configuration with output readily available to the author of the |
|
193 |
document. |
|
51055 | 194 |
|
61575 | 195 |
\<^item> @{system_option_def "document_variants"} specifies document variants as |
196 |
a colon-separated list of \<open>name=tags\<close> entries, corresponding to @{tool |
|
197 |
document} options \<^verbatim>\<open>-n\<close> and \<^verbatim>\<open>-t\<close>. |
|
51055 | 198 |
|
61575 | 199 |
For example, \<^verbatim>\<open>document_variants=document:outline=/proof,/ML\<close> indicates |
200 |
two documents: the one called \<^verbatim>\<open>document\<close> with default tags, and the other |
|
201 |
called \<^verbatim>\<open>outline\<close> where proofs and ML sections are folded. |
|
51055 | 202 |
|
61575 | 203 |
Document variant names are just a matter of conventions. It is also |
204 |
possible to use different document variant names (without tags) for |
|
205 |
different document root entries, see also \secref{sec:tool-document}. |
|
51055 | 206 |
|
61575 | 207 |
\<^item> @{system_option_def "threads"} determines the number of worker threads |
208 |
for parallel checking of theories and proofs. The default \<open>0\<close> means that a |
|
209 |
sensible maximum value is determined by the underlying hardware. For |
|
210 |
machines with many cores or with hyperthreading, this is often requires |
|
211 |
manual adjustment (on the command-line or within personal settings or |
|
212 |
preferences, not within a session \<^verbatim>\<open>ROOT\<close>). |
|
51055 | 213 |
|
63827
b24d0e53dd03
option "checkpoint" helps to fine-tune global heap space management;
wenzelm
parents:
63680
diff
changeset
|
214 |
\<^item> @{system_option_def "checkpoint"} helps to fine-tune the global heap |
b24d0e53dd03
option "checkpoint" helps to fine-tune global heap space management;
wenzelm
parents:
63680
diff
changeset
|
215 |
space management. This is relevant for big sessions that may exhaust the |
b24d0e53dd03
option "checkpoint" helps to fine-tune global heap space management;
wenzelm
parents:
63680
diff
changeset
|
216 |
small 32-bit address space of the ML process (which is used by default). |
b24d0e53dd03
option "checkpoint" helps to fine-tune global heap space management;
wenzelm
parents:
63680
diff
changeset
|
217 |
When the option is enabled for some \isakeyword{theories} block, a full |
b24d0e53dd03
option "checkpoint" helps to fine-tune global heap space management;
wenzelm
parents:
63680
diff
changeset
|
218 |
sharing stage of immutable values in memory happens \<^emph>\<open>before\<close> loading the |
b24d0e53dd03
option "checkpoint" helps to fine-tune global heap space management;
wenzelm
parents:
63680
diff
changeset
|
219 |
specified theories. |
b24d0e53dd03
option "checkpoint" helps to fine-tune global heap space management;
wenzelm
parents:
63680
diff
changeset
|
220 |
|
61575 | 221 |
\<^item> @{system_option_def "condition"} specifies a comma-separated list of |
222 |
process environment variables (or Isabelle settings) that are required for |
|
223 |
the subsequent theories to be processed. Conditions are considered |
|
224 |
``true'' if the corresponding environment value is defined and non-empty. |
|
51055 | 225 |
|
61602 | 226 |
\<^item> @{system_option_def "timeout"} and @{system_option_def "timeout_scale"} |
227 |
specify a real wall-clock timeout for the session as a whole: the two |
|
228 |
values are multiplied and taken as the number of seconds. Typically, |
|
229 |
@{system_option "timeout"} is given for individual sessions, and |
|
230 |
@{system_option "timeout_scale"} as global adjustment to overall hardware |
|
231 |
performance. |
|
232 |
||
233 |
The timer is controlled outside the ML process by the JVM that runs |
|
234 |
Isabelle/Scala. Thus it is relatively reliable in canceling processes that |
|
235 |
get out of control, even if there is a deadlock without CPU time usage. |
|
51055 | 236 |
|
64308 | 237 |
\<^item> @{system_option_def "profiling"} specifies a mode for global ML |
238 |
profiling. Possible values are the empty string (disabled), \<^verbatim>\<open>time\<close> for |
|
239 |
@{ML profile_time} and \<^verbatim>\<open>allocations\<close> for @{ML profile_allocations}. |
|
240 |
Results appear near the bottom of the session log file. |
|
241 |
||
61575 | 242 |
The @{tool_def options} tool prints Isabelle system options. Its |
48693
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48684
diff
changeset
|
243 |
command-line usage is: |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
244 |
@{verbatim [display] |
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
245 |
\<open>Usage: isabelle options [OPTIONS] [MORE_OPTIONS ...] |
48693
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48684
diff
changeset
|
246 |
|
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48684
diff
changeset
|
247 |
Options are: |
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48684
diff
changeset
|
248 |
-b include $ISABELLE_BUILD_OPTIONS |
52735 | 249 |
-g OPTION get value of OPTION |
50531
f841ac0cb757
clarified "isabelle options" command line, to make it more close to "isabelle components";
wenzelm
parents:
50406
diff
changeset
|
250 |
-l list options |
48693
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48684
diff
changeset
|
251 |
-x FILE export to FILE in YXML format |
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48684
diff
changeset
|
252 |
|
50531
f841ac0cb757
clarified "isabelle options" command line, to make it more close to "isabelle components";
wenzelm
parents:
50406
diff
changeset
|
253 |
Report Isabelle system options, augmented by MORE_OPTIONS given as |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
254 |
arguments NAME=VAL or NAME.\<close>} |
48693
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48684
diff
changeset
|
255 |
|
61575 | 256 |
The command line arguments provide additional system options of the form |
257 |
\<open>name\<close>\<^verbatim>\<open>=\<close>\<open>value\<close> or \<open>name\<close> for Boolean options. |
|
258 |
||
259 |
Option \<^verbatim>\<open>-b\<close> augments the implicit environment of system options by the ones |
|
260 |
of @{setting ISABELLE_BUILD_OPTIONS}, cf.\ \secref{sec:tool-build}. |
|
48693
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48684
diff
changeset
|
261 |
|
61575 | 262 |
Option \<^verbatim>\<open>-g\<close> prints the value of the given option. Option \<^verbatim>\<open>-l\<close> lists all |
263 |
options with their declaration and current value. |
|
48693
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48684
diff
changeset
|
264 |
|
61575 | 265 |
Option \<^verbatim>\<open>-x\<close> specifies a file to export the result in YXML format, instead |
266 |
of printing it in human-readable form. |
|
58618 | 267 |
\<close> |
48578 | 268 |
|
269 |
||
58618 | 270 |
section \<open>Invoking the build process \label{sec:tool-build}\<close> |
48578 | 271 |
|
61575 | 272 |
text \<open> |
273 |
The @{tool_def build} tool invokes the build process for Isabelle sessions. |
|
274 |
It manages dependencies between sessions, related sources of theories and |
|
275 |
auxiliary files, and target heap images. Accordingly, it runs instances of |
|
276 |
the prover process with optional document preparation. Its command-line |
|
277 |
usage is:\<^footnote>\<open>Isabelle/Scala provides the same functionality via |
|
61572 | 278 |
\<^verbatim>\<open>isabelle.Build.build\<close>.\<close> |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
279 |
@{verbatim [display] |
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
280 |
\<open>Usage: isabelle build [OPTIONS] [SESSIONS ...] |
48578 | 281 |
|
282 |
Options are: |
|
48737
f3bbb9ca57d6
added build option -D: include session directory and select its sessions;
wenzelm
parents:
48693
diff
changeset
|
283 |
-D DIR include session directory and select its sessions |
64265 | 284 |
-N cyclic shuffling of NUMA CPU nodes (performance tuning) |
49131 | 285 |
-R operate on requirements of selected sessions |
60106 | 286 |
-X NAME exclude sessions from group NAME and all descendants |
48578 | 287 |
-a select all sessions |
288 |
-b build heap images |
|
48595 | 289 |
-c clean build |
48737
f3bbb9ca57d6
added build option -D: include session directory and select its sessions;
wenzelm
parents:
48693
diff
changeset
|
290 |
-d DIR include session directory |
48578 | 291 |
-g NAME select session group NAME |
292 |
-j INT maximum number of parallel jobs (default 1) |
|
59891
9ce697050455
added isabelle build option -k, for fast off-line checking of theory sources;
wenzelm
parents:
59446
diff
changeset
|
293 |
-k KEYWORD check theory sources for conflicts with proposed keywords |
48903 | 294 |
-l list session source files |
48578 | 295 |
-n no build -- test dependencies only |
52056 | 296 |
-o OPTION override Isabelle system OPTION (via NAME=VAL or NAME) |
48578 | 297 |
-s system build mode: produce output in ISABELLE_HOME |
298 |
-v verbose |
|
60106 | 299 |
-x NAME exclude session NAME and all descendants |
48578 | 300 |
|
62596 | 301 |
Build and manage Isabelle sessions, depending on implicit settings: |
302 |
||
48578 | 303 |
ISABELLE_BUILD_OPTIONS="..." |
304 |
||
305 |
ML_PLATFORM="..." |
|
306 |
ML_HOME="..." |
|
307 |
ML_SYSTEM="..." |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
308 |
ML_OPTIONS="..."\<close>} |
48578 | 309 |
|
61406 | 310 |
\<^medskip> |
61575 | 311 |
Isabelle sessions are defined via session ROOT files as described in |
312 |
(\secref{sec:session-root}). The totality of sessions is determined by |
|
313 |
collecting such specifications from all Isabelle component directories |
|
314 |
(\secref{sec:components}), augmented by more directories given via options |
|
315 |
\<^verbatim>\<open>-d\<close>~\<open>DIR\<close> on the command line. Each such directory may contain a session |
|
61503 | 316 |
\<^verbatim>\<open>ROOT\<close> file with several session specifications. |
48578 | 317 |
|
61575 | 318 |
Any session root directory may refer recursively to further directories of |
319 |
the same kind, by listing them in a catalog file \<^verbatim>\<open>ROOTS\<close> line-by-line. This |
|
320 |
helps to organize large collections of session specifications, or to make |
|
321 |
\<^verbatim>\<open>-d\<close> command line options persistent (say within |
|
61503 | 322 |
\<^verbatim>\<open>$ISABELLE_HOME_USER/ROOTS\<close>). |
48684
9170e10c651e
re-introduced ROOTS catalog files (cf. 47330b712f8f) which help to organize AFP or make -d options persistent;
wenzelm
parents:
48683
diff
changeset
|
323 |
|
61406 | 324 |
\<^medskip> |
61575 | 325 |
The subset of sessions to be managed is determined via individual \<open>SESSIONS\<close> |
326 |
given as command-line arguments, or session groups that are given via one or |
|
327 |
more options \<^verbatim>\<open>-g\<close>~\<open>NAME\<close>. Option \<^verbatim>\<open>-a\<close> selects all sessions. The build tool |
|
328 |
takes session dependencies into account: the set of selected sessions is |
|
329 |
completed by including all ancestors. |
|
48578 | 330 |
|
61406 | 331 |
\<^medskip> |
61575 | 332 |
One or more options \<^verbatim>\<open>-x\<close>~\<open>NAME\<close> specify sessions to be excluded. All |
333 |
descendents of excluded sessions are removed from the selection as specified |
|
334 |
above. Option \<^verbatim>\<open>-X\<close> is analogous to this, but excluded sessions are |
|
335 |
specified by session group membership. |
|
59892
2a616319c171
added isabelle build option -x, to exclude sessions;
wenzelm
parents:
59891
diff
changeset
|
336 |
|
61406 | 337 |
\<^medskip> |
61575 | 338 |
Option \<^verbatim>\<open>-R\<close> reverses the selection in the sense that it refers to its |
339 |
requirements: all ancestor sessions excluding the original selection. This |
|
340 |
allows to prepare the stage for some build process with different options, |
|
341 |
before running the main build itself (without option \<^verbatim>\<open>-R\<close>). |
|
49131 | 342 |
|
61406 | 343 |
\<^medskip> |
61575 | 344 |
Option \<^verbatim>\<open>-D\<close> is similar to \<^verbatim>\<open>-d\<close>, but selects all sessions that are defined |
345 |
in the given directories. |
|
48737
f3bbb9ca57d6
added build option -D: include session directory and select its sessions;
wenzelm
parents:
48693
diff
changeset
|
346 |
|
61406 | 347 |
\<^medskip> |
348 |
The build process depends on additional options |
|
61575 | 349 |
(\secref{sec:system-options}) that are passed to the prover eventually. The |
350 |
settings variable @{setting_ref ISABELLE_BUILD_OPTIONS} allows to provide |
|
61602 | 351 |
additional defaults, e.g.\ \<^verbatim>\<open>ISABELLE_BUILD_OPTIONS="document=pdf threads=4"\<close>. |
352 |
Moreover, the environment of system build options may be augmented on the |
|
353 |
command line via \<^verbatim>\<open>-o\<close>~\<open>name\<close>\<^verbatim>\<open>=\<close>\<open>value\<close> or \<^verbatim>\<open>-o\<close>~\<open>name\<close>, which abbreviates |
|
354 |
\<^verbatim>\<open>-o\<close>~\<open>name\<close>\<^verbatim>\<open>=true\<close> for Boolean options. Multiple occurrences of \<^verbatim>\<open>-o\<close> on |
|
355 |
the command-line are applied in the given order. |
|
48578 | 356 |
|
61406 | 357 |
\<^medskip> |
61575 | 358 |
Option \<^verbatim>\<open>-b\<close> ensures that heap images are produced for all selected |
359 |
sessions. By default, images are only saved for inner nodes of the hierarchy |
|
360 |
of sessions, as required for other sessions to continue later on. |
|
48578 | 361 |
|
61406 | 362 |
\<^medskip> |
61575 | 363 |
Option \<^verbatim>\<open>-c\<close> cleans all descendants of the selected sessions before |
364 |
performing the specified build operation. |
|
48595 | 365 |
|
61406 | 366 |
\<^medskip> |
61575 | 367 |
Option \<^verbatim>\<open>-n\<close> omits the actual build process after the preparatory stage |
368 |
(including optional cleanup). Note that the return code always indicates the |
|
369 |
status of the set of selected sessions. |
|
48595 | 370 |
|
61406 | 371 |
\<^medskip> |
61575 | 372 |
Option \<^verbatim>\<open>-j\<close> specifies the maximum number of parallel build jobs (prover |
373 |
processes). Each prover process is subject to a separate limit of parallel |
|
374 |
worker threads, cf.\ system option @{system_option_ref threads}. |
|
48578 | 375 |
|
61406 | 376 |
\<^medskip> |
64265 | 377 |
Option \<^verbatim>\<open>-N\<close> enables cyclic shuffling of NUMA CPU nodes. This may help |
378 |
performance tuning on Linux servers with separate CPU/memory modules. |
|
379 |
||
380 |
\<^medskip> |
|
61575 | 381 |
Option \<^verbatim>\<open>-s\<close> enables \<^emph>\<open>system mode\<close>, which means that resulting heap images |
63669 | 382 |
and log files are stored in @{path "$ISABELLE_HOME/heaps"} instead of the |
383 |
default location @{setting ISABELLE_OUTPUT} (which is normally in @{setting |
|
384 |
ISABELLE_HOME_USER}, i.e.\ the user's home directory). |
|
48578 | 385 |
|
61406 | 386 |
\<^medskip> |
61575 | 387 |
Option \<^verbatim>\<open>-v\<close> increases the general level of verbosity. Option \<^verbatim>\<open>-l\<close> lists |
388 |
the source files that contribute to a session. |
|
59891
9ce697050455
added isabelle build option -k, for fast off-line checking of theory sources;
wenzelm
parents:
59446
diff
changeset
|
389 |
|
61406 | 390 |
\<^medskip> |
61575 | 391 |
Option \<^verbatim>\<open>-k\<close> specifies a newly proposed keyword for outer syntax (multiple |
392 |
uses allowed). The theory sources are checked for conflicts wrt.\ this |
|
393 |
hypothetical change of syntax, e.g.\ to reveal occurrences of identifiers |
|
394 |
that need to be quoted. |
|
395 |
\<close> |
|
59891
9ce697050455
added isabelle build option -k, for fast off-line checking of theory sources;
wenzelm
parents:
59446
diff
changeset
|
396 |
|
48578 | 397 |
|
58618 | 398 |
subsubsection \<open>Examples\<close> |
48578 | 399 |
|
58618 | 400 |
text \<open> |
48578 | 401 |
Build a specific logic image: |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
402 |
@{verbatim [display] \<open>isabelle build -b HOLCF\<close>} |
48578 | 403 |
|
61406 | 404 |
\<^smallskip> |
405 |
Build the main group of logic images: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
406 |
@{verbatim [display] \<open>isabelle build -b -g main\<close>} |
48578 | 407 |
|
61406 | 408 |
\<^smallskip> |
61575 | 409 |
Provide a general overview of the status of all Isabelle sessions, without |
410 |
building anything: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
411 |
@{verbatim [display] \<open>isabelle build -a -n -v\<close>} |
48578 | 412 |
|
61406 | 413 |
\<^smallskip> |
61575 | 414 |
Build all sessions with HTML browser info and PDF document preparation: |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
415 |
@{verbatim [display] \<open>isabelle build -a -o browser_info -o document=pdf\<close>} |
48578 | 416 |
|
61406 | 417 |
\<^smallskip> |
61575 | 418 |
Build all sessions with a maximum of 8 parallel prover processes and 4 |
419 |
worker threads each (on a machine with many cores): |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
420 |
@{verbatim [display] \<open>isabelle build -a -j8 -o threads=4\<close>} |
48595 | 421 |
|
61406 | 422 |
\<^smallskip> |
61575 | 423 |
Build some session images with cleanup of their descendants, while retaining |
424 |
their ancestry: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
425 |
@{verbatim [display] \<open>isabelle build -b -c HOL-Algebra HOL-Word\<close>} |
48595 | 426 |
|
61406 | 427 |
\<^smallskip> |
428 |
Clean all sessions without building anything: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
429 |
@{verbatim [display] \<open>isabelle build -a -n -c\<close>} |
48737
f3bbb9ca57d6
added build option -D: include session directory and select its sessions;
wenzelm
parents:
48693
diff
changeset
|
430 |
|
61406 | 431 |
\<^smallskip> |
61575 | 432 |
Build all sessions from some other directory hierarchy, according to the |
433 |
settings variable \<^verbatim>\<open>AFP\<close> that happens to be defined inside the Isabelle |
|
434 |
environment: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
435 |
@{verbatim [display] \<open>isabelle build -D '$AFP'\<close>} |
49131 | 436 |
|
61406 | 437 |
\<^smallskip> |
61575 | 438 |
Inform about the status of all sessions required for AFP, without building |
439 |
anything yet: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
440 |
@{verbatim [display] \<open>isabelle build -D '$AFP' -R -v -n\<close>} |
58618 | 441 |
\<close> |
48578 | 442 |
|
443 |
end |