author | wenzelm |
Mon, 14 Oct 2019 19:14:03 +0200 | |
changeset 70861 | cb07f21c9916 |
parent 70859 | 6e6254bbce1f |
child 70862 | a4ccd277e9c4 |
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 |
|
69593 | 51 |
\<^rail>\<open> |
51417 | 52 |
@{syntax_def session_chapter}: @'chapter' @{syntax name} |
53 |
; |
|
54 |
||
66971 | 55 |
@{syntax_def session_entry}: @'session' @{syntax system_name} groups? dir? '=' \<newline> |
70678
36c8c32346cb
clarified syntax: 'directories' and 'theories' belong together;
wenzelm
parents:
70677
diff
changeset
|
56 |
(@{syntax system_name} '+')? description? options? \<newline> |
36c8c32346cb
clarified syntax: 'directories' and 'theories' belong together;
wenzelm
parents:
70677
diff
changeset
|
57 |
sessions? directories? (theories*) \<newline> |
36c8c32346cb
clarified syntax: 'directories' and 'theories' belong together;
wenzelm
parents:
70677
diff
changeset
|
58 |
(document_files*) (export_files*) |
48579 | 59 |
; |
60 |
groups: '(' (@{syntax name} +) ')' |
|
61 |
; |
|
68808 | 62 |
dir: @'in' @{syntax embedded} |
48579 | 63 |
; |
64 |
description: @'description' @{syntax text} |
|
65 |
; |
|
66 |
options: @'options' opts |
|
67 |
; |
|
48605
e777363440d6
allow negative int values as well, according to real = int | float;
wenzelm
parents:
48604
diff
changeset
|
68 |
opts: '[' ( (@{syntax name} '=' value | @{syntax name}) + ',' ) ']' |
e777363440d6
allow negative int values as well, according to real = int | float;
wenzelm
parents:
48604
diff
changeset
|
69 |
; |
e777363440d6
allow negative int values as well, according to real = int | float;
wenzelm
parents:
48604
diff
changeset
|
70 |
value: @{syntax name} | @{syntax real} |
48579 | 71 |
; |
66916 | 72 |
sessions: @'sessions' (@{syntax system_name}+) |
65374 | 73 |
; |
70681 | 74 |
directories: @'directories' (dir+) |
70678
36c8c32346cb
clarified syntax: 'directories' and 'theories' belong together;
wenzelm
parents:
70677
diff
changeset
|
75 |
; |
66970
13857f49d215
clarified ROOT syntax: 'sessions' and 'theories' are optional, but need to be non-empty;
wenzelm
parents:
66916
diff
changeset
|
76 |
theories: @'theories' opts? (theory_entry+) |
48579 | 77 |
; |
66916 | 78 |
theory_entry: @{syntax system_name} ('(' @'global' ')')? |
65504 | 79 |
; |
68808 | 80 |
document_files: @'document_files' ('(' dir ')')? (@{syntax embedded}+) |
68292 | 81 |
; |
69671 | 82 |
export_files: @'export_files' ('(' dir ')')? ('[' nat ']')? \<newline> |
83 |
(@{syntax embedded}+) |
|
69593 | 84 |
\<close> |
48579 | 85 |
|
61575 | 86 |
\<^descr> \isakeyword{session}~\<open>A = B + body\<close> defines a new session \<open>A\<close> based on |
66759 | 87 |
parent session \<open>B\<close>, with its content given in \<open>body\<close> (imported sessions and |
88 |
theories). Note that a parent (like \<open>HOL\<close>) is mandatory in practical |
|
89 |
applications: only Isabelle/Pure can bootstrap itself from nothing. |
|
48579 | 90 |
|
65504 | 91 |
All such session specifications together describe a hierarchy (graph) of |
61575 | 92 |
sessions, with globally unique names. The new session name \<open>A\<close> should be |
93 |
sufficiently long and descriptive to stand on its own in a potentially large |
|
94 |
library. |
|
48579 | 95 |
|
61575 | 96 |
\<^descr> \isakeyword{session}~\<open>A (groups)\<close> indicates a collection of groups where |
97 |
the new session is a member. Group names are uninterpreted and merely follow |
|
98 |
certain conventions. For example, the Isabelle distribution tags some |
|
99 |
important sessions by the group name called ``\<open>main\<close>''. Other projects may |
|
100 |
invent their own conventions, but this requires some care to avoid clashes |
|
48604 | 101 |
within this unchecked name space. |
48579 | 102 |
|
61575 | 103 |
\<^descr> \isakeyword{session}~\<open>A\<close>~\isakeyword{in}~\<open>dir\<close> specifies an explicit |
104 |
directory for this session; by default this is the current directory of the |
|
105 |
\<^verbatim>\<open>ROOT\<close> file. |
|
48579 | 106 |
|
66759 | 107 |
All theory files are located relatively to the session directory. The prover |
108 |
process is run within the same as its current 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 |
||
70678
36c8c32346cb
clarified syntax: 'directories' and 'theories' belong together;
wenzelm
parents:
70677
diff
changeset
|
127 |
\<^descr> \isakeyword{directories}~\<open>dirs\<close> specifies additional directories for |
36c8c32346cb
clarified syntax: 'directories' and 'theories' belong together;
wenzelm
parents:
70677
diff
changeset
|
128 |
import of theory files via \isakeyword{theories} within \<^verbatim>\<open>ROOT\<close> or |
36c8c32346cb
clarified syntax: 'directories' and 'theories' belong together;
wenzelm
parents:
70677
diff
changeset
|
129 |
\<^theory_text>\<open>imports\<close> within a theory; \<open>dirs\<close> are relative to the main session |
36c8c32346cb
clarified syntax: 'directories' and 'theories' belong together;
wenzelm
parents:
70677
diff
changeset
|
130 |
directory (cf.\ \isakeyword{session} \dots \isakeyword{in}~\<open>dir\<close>). These |
70681 | 131 |
directories need to be exclusively assigned to a unique session, without |
132 |
implicit sharing of file-system locations. |
|
70678
36c8c32346cb
clarified syntax: 'directories' and 'theories' belong together;
wenzelm
parents:
70677
diff
changeset
|
133 |
|
61575 | 134 |
\<^descr> \isakeyword{theories}~\<open>options names\<close> specifies a block of theories that |
135 |
are processed within an environment that is augmented by the given options, |
|
136 |
in addition to the global session options given before. Any number of blocks |
|
137 |
of \isakeyword{theories} may be given. Options are only active for each |
|
48604 | 138 |
\isakeyword{theories} block separately. |
48579 | 139 |
|
65374 | 140 |
A theory name that is followed by \<open>(\<close>\isakeyword{global}\<open>)\<close> is treated |
66993 | 141 |
literally in other session specifications or theory imports --- the normal |
142 |
situation is to qualify theory names by the session name; this ensures |
|
143 |
globally unique names in big session graphs. Global theories are usually the |
|
144 |
entry points to major logic sessions: \<open>Pure\<close>, \<open>Main\<close>, \<open>Complex_Main\<close>, |
|
145 |
\<open>HOLCF\<close>, \<open>IFOL\<close>, \<open>FOL\<close>, \<open>ZF\<close>, \<open>ZFC\<close> etc. Regular Isabelle applications |
|
146 |
should not claim any global theory names. |
|
65374 | 147 |
|
61575 | 148 |
\<^descr> \isakeyword{document_files}~\<open>(\<close>\isakeyword{in}~\<open>base_dir) files\<close> lists |
149 |
source files for document preparation, typically \<^verbatim>\<open>.tex\<close> and \<^verbatim>\<open>.sty\<close> for |
|
150 |
{\LaTeX}. Only these explicitly given files are copied from the base |
|
151 |
directory to the document output directory, before formal document |
|
152 |
processing is started (see also \secref{sec:tool-document}). The local path |
|
153 |
structure of the \<open>files\<close> is preserved, which allows to reconstruct the |
|
68292 | 154 |
original directory hierarchy of \<open>base_dir\<close>. The default \<open>base_dir\<close> is |
155 |
\<^verbatim>\<open>document\<close> within the session root directory. |
|
56533
cd8b6d849b6a
explicit 'document_files' in session ROOT specifications;
wenzelm
parents:
55112
diff
changeset
|
156 |
|
69671 | 157 |
\<^descr> \isakeyword{export_files}~\<open>(\<close>\isakeyword{in}~\<open>target_dir) [number] |
69811
18f61ce86425
clarified 'export_files' in session ROOT: require explicit "isabelle build -e";
wenzelm
parents:
69755
diff
changeset
|
158 |
patterns\<close> specifies theory exports that may get written to the file-system, |
18f61ce86425
clarified 'export_files' in session ROOT: require explicit "isabelle build -e";
wenzelm
parents:
69755
diff
changeset
|
159 |
e.g. via @{tool_ref build} with option \<^verbatim>\<open>-e\<close> (\secref{sec:tool-build}). The |
18f61ce86425
clarified 'export_files' in session ROOT: require explicit "isabelle build -e";
wenzelm
parents:
69755
diff
changeset
|
160 |
\<open>target_dir\<close> specification is relative to the session root directory; its |
18f61ce86425
clarified 'export_files' in session ROOT: require explicit "isabelle build -e";
wenzelm
parents:
69755
diff
changeset
|
161 |
default is \<^verbatim>\<open>export\<close>. Exports are selected via \<open>patterns\<close> as in @{tool_ref |
18f61ce86425
clarified 'export_files' in session ROOT: require explicit "isabelle build -e";
wenzelm
parents:
69755
diff
changeset
|
162 |
export} (\secref{sec:tool-export}). The number given in brackets (default: |
18f61ce86425
clarified 'export_files' in session ROOT: require explicit "isabelle build -e";
wenzelm
parents:
69755
diff
changeset
|
163 |
0) specifies elements that should be pruned from each name: it allows to |
18f61ce86425
clarified 'export_files' in session ROOT: require explicit "isabelle build -e";
wenzelm
parents:
69755
diff
changeset
|
164 |
reduce the resulting directory hierarchy at the danger of overwriting files |
18f61ce86425
clarified 'export_files' in session ROOT: require explicit "isabelle build -e";
wenzelm
parents:
69755
diff
changeset
|
165 |
due to loss of uniqueness. |
58618 | 166 |
\<close> |
48579 | 167 |
|
51055 | 168 |
|
58618 | 169 |
subsubsection \<open>Examples\<close> |
48580 | 170 |
|
61575 | 171 |
text \<open> |
63680 | 172 |
See \<^file>\<open>~~/src/HOL/ROOT\<close> for a diversity of practically relevant situations, |
173 |
although it uses relatively complex quasi-hierarchic naming conventions like |
|
174 |
\<^verbatim>\<open>HOL-SPARK\<close>, \<^verbatim>\<open>HOL-SPARK-Examples\<close>. An alternative is to use unqualified |
|
175 |
names that are relatively long and descriptive, as in the Archive of Formal |
|
67605 | 176 |
Proofs (\<^url>\<open>https://isa-afp.org\<close>), for example. |
61575 | 177 |
\<close> |
48578 | 178 |
|
179 |
||
58618 | 180 |
section \<open>System build options \label{sec:system-options}\<close> |
48578 | 181 |
|
61575 | 182 |
text \<open> |
63680 | 183 |
See \<^file>\<open>~~/etc/options\<close> for the main defaults provided by the Isabelle |
61575 | 184 |
distribution. Isabelle/jEdit @{cite "isabelle-jedit"} includes a simple |
185 |
editing mode \<^verbatim>\<open>isabelle-options\<close> for this file-format. |
|
48693
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48684
diff
changeset
|
186 |
|
61575 | 187 |
The following options are particularly relevant to build Isabelle sessions, |
188 |
in particular with document preparation (\chref{ch:present}). |
|
51055 | 189 |
|
61575 | 190 |
\<^item> @{system_option_def "browser_info"} controls output of HTML browser |
191 |
info, see also \secref{sec:info}. |
|
51055 | 192 |
|
61575 | 193 |
\<^item> @{system_option_def "document"} specifies the document output format, |
194 |
see @{tool document} option \<^verbatim>\<open>-o\<close> in \secref{sec:tool-document}. In |
|
195 |
practice, the most relevant values are \<^verbatim>\<open>document=false\<close> or |
|
196 |
\<^verbatim>\<open>document=pdf\<close>. |
|
51055 | 197 |
|
61575 | 198 |
\<^item> @{system_option_def "document_output"} specifies an alternative |
199 |
directory for generated output of the document preparation system; the |
|
200 |
default is within the @{setting "ISABELLE_BROWSER_INFO"} hierarchy as |
|
201 |
explained in \secref{sec:info}. See also @{tool mkroot}, which generates a |
|
202 |
default configuration with output readily available to the author of the |
|
203 |
document. |
|
51055 | 204 |
|
61575 | 205 |
\<^item> @{system_option_def "document_variants"} specifies document variants as |
206 |
a colon-separated list of \<open>name=tags\<close> entries, corresponding to @{tool |
|
207 |
document} options \<^verbatim>\<open>-n\<close> and \<^verbatim>\<open>-t\<close>. |
|
51055 | 208 |
|
61575 | 209 |
For example, \<^verbatim>\<open>document_variants=document:outline=/proof,/ML\<close> indicates |
210 |
two documents: the one called \<^verbatim>\<open>document\<close> with default tags, and the other |
|
211 |
called \<^verbatim>\<open>outline\<close> where proofs and ML sections are folded. |
|
51055 | 212 |
|
61575 | 213 |
Document variant names are just a matter of conventions. It is also |
214 |
possible to use different document variant names (without tags) for |
|
215 |
different document root entries, see also \secref{sec:tool-document}. |
|
51055 | 216 |
|
68513 | 217 |
\<^item> @{system_option_def "document_tags"} specifies alternative command tags |
218 |
as a comma-separated list of items: either ``\<open>command\<close>\<^verbatim>\<open>%\<close>\<open>tag\<close>'' for a |
|
219 |
specific command, or ``\<^verbatim>\<open>%\<close>\<open>tag\<close>'' as default for all other commands. This |
|
220 |
is occasionally useful to control the global visibility of commands via |
|
221 |
session options (e.g.\ in \<^verbatim>\<open>ROOT\<close>). |
|
67140 | 222 |
|
61575 | 223 |
\<^item> @{system_option_def "threads"} determines the number of worker threads |
224 |
for parallel checking of theories and proofs. The default \<open>0\<close> means that a |
|
225 |
sensible maximum value is determined by the underlying hardware. For |
|
226 |
machines with many cores or with hyperthreading, this is often requires |
|
227 |
manual adjustment (on the command-line or within personal settings or |
|
228 |
preferences, not within a session \<^verbatim>\<open>ROOT\<close>). |
|
51055 | 229 |
|
61575 | 230 |
\<^item> @{system_option_def "condition"} specifies a comma-separated list of |
231 |
process environment variables (or Isabelle settings) that are required for |
|
232 |
the subsequent theories to be processed. Conditions are considered |
|
233 |
``true'' if the corresponding environment value is defined and non-empty. |
|
51055 | 234 |
|
61602 | 235 |
\<^item> @{system_option_def "timeout"} and @{system_option_def "timeout_scale"} |
236 |
specify a real wall-clock timeout for the session as a whole: the two |
|
237 |
values are multiplied and taken as the number of seconds. Typically, |
|
238 |
@{system_option "timeout"} is given for individual sessions, and |
|
239 |
@{system_option "timeout_scale"} as global adjustment to overall hardware |
|
240 |
performance. |
|
241 |
||
242 |
The timer is controlled outside the ML process by the JVM that runs |
|
243 |
Isabelle/Scala. Thus it is relatively reliable in canceling processes that |
|
244 |
get out of control, even if there is a deadlock without CPU time usage. |
|
51055 | 245 |
|
64308 | 246 |
\<^item> @{system_option_def "profiling"} specifies a mode for global ML |
247 |
profiling. Possible values are the empty string (disabled), \<^verbatim>\<open>time\<close> for |
|
69593 | 248 |
\<^ML>\<open>profile_time\<close> and \<^verbatim>\<open>allocations\<close> for \<^ML>\<open>profile_allocations\<close>. |
64308 | 249 |
Results appear near the bottom of the session log file. |
250 |
||
69854
cc0b3e177b49
system option "system_heaps" supersedes various command-line options for "system build mode";
wenzelm
parents:
69811
diff
changeset
|
251 |
\<^item> @{system_option_def "system_heaps"} determines the directories for |
cc0b3e177b49
system option "system_heaps" supersedes various command-line options for "system build mode";
wenzelm
parents:
69811
diff
changeset
|
252 |
session heap images: \<^path>\<open>$ISABELLE_HEAPS\<close> is the user directory and |
cc0b3e177b49
system option "system_heaps" supersedes various command-line options for "system build mode";
wenzelm
parents:
69811
diff
changeset
|
253 |
\<^path>\<open>$ISABELLE_HEAPS_SYSTEM\<close> the system directory (usually within the |
cc0b3e177b49
system option "system_heaps" supersedes various command-line options for "system build mode";
wenzelm
parents:
69811
diff
changeset
|
254 |
Isabelle application). For \<^verbatim>\<open>system_heaps=false\<close>, heaps are stored in the |
cc0b3e177b49
system option "system_heaps" supersedes various command-line options for "system build mode";
wenzelm
parents:
69811
diff
changeset
|
255 |
user directory and may be loaded from both directories. For |
cc0b3e177b49
system option "system_heaps" supersedes various command-line options for "system build mode";
wenzelm
parents:
69811
diff
changeset
|
256 |
\<^verbatim>\<open>system_heaps=true\<close>, store and load happens only in the system directory. |
cc0b3e177b49
system option "system_heaps" supersedes various command-line options for "system build mode";
wenzelm
parents:
69811
diff
changeset
|
257 |
|
61575 | 258 |
The @{tool_def options} tool prints Isabelle system options. Its |
48693
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48684
diff
changeset
|
259 |
command-line usage is: |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
260 |
@{verbatim [display] |
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
261 |
\<open>Usage: isabelle options [OPTIONS] [MORE_OPTIONS ...] |
48693
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48684
diff
changeset
|
262 |
|
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48684
diff
changeset
|
263 |
Options are: |
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48684
diff
changeset
|
264 |
-b include $ISABELLE_BUILD_OPTIONS |
52735 | 265 |
-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
|
266 |
-l list options |
48693
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48684
diff
changeset
|
267 |
-x FILE export to FILE in YXML format |
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48684
diff
changeset
|
268 |
|
50531
f841ac0cb757
clarified "isabelle options" command line, to make it more close to "isabelle components";
wenzelm
parents:
50406
diff
changeset
|
269 |
Report Isabelle system options, augmented by MORE_OPTIONS given as |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
270 |
arguments NAME=VAL or NAME.\<close>} |
48693
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48684
diff
changeset
|
271 |
|
61575 | 272 |
The command line arguments provide additional system options of the form |
273 |
\<open>name\<close>\<^verbatim>\<open>=\<close>\<open>value\<close> or \<open>name\<close> for Boolean options. |
|
274 |
||
275 |
Option \<^verbatim>\<open>-b\<close> augments the implicit environment of system options by the ones |
|
276 |
of @{setting ISABELLE_BUILD_OPTIONS}, cf.\ \secref{sec:tool-build}. |
|
48693
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48684
diff
changeset
|
277 |
|
61575 | 278 |
Option \<^verbatim>\<open>-g\<close> prints the value of the given option. Option \<^verbatim>\<open>-l\<close> lists all |
279 |
options with their declaration and current value. |
|
48693
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48684
diff
changeset
|
280 |
|
61575 | 281 |
Option \<^verbatim>\<open>-x\<close> specifies a file to export the result in YXML format, instead |
282 |
of printing it in human-readable form. |
|
58618 | 283 |
\<close> |
48578 | 284 |
|
285 |
||
58618 | 286 |
section \<open>Invoking the build process \label{sec:tool-build}\<close> |
48578 | 287 |
|
61575 | 288 |
text \<open> |
289 |
The @{tool_def build} tool invokes the build process for Isabelle sessions. |
|
290 |
It manages dependencies between sessions, related sources of theories and |
|
291 |
auxiliary files, and target heap images. Accordingly, it runs instances of |
|
292 |
the prover process with optional document preparation. Its command-line |
|
293 |
usage is:\<^footnote>\<open>Isabelle/Scala provides the same functionality via |
|
61572 | 294 |
\<^verbatim>\<open>isabelle.Build.build\<close>.\<close> |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
295 |
@{verbatim [display] |
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
296 |
\<open>Usage: isabelle build [OPTIONS] [SESSIONS ...] |
48578 | 297 |
|
298 |
Options are: |
|
66737
2edc0c42c883
option -B for "isabelle build" and "isabelle imports";
wenzelm
parents:
66671
diff
changeset
|
299 |
-B NAME include session NAME and all descendants |
48737
f3bbb9ca57d6
added build option -D: include session directory and select its sessions;
wenzelm
parents:
48693
diff
changeset
|
300 |
-D DIR include session directory and select its sessions |
64265 | 301 |
-N cyclic shuffling of NUMA CPU nodes (performance tuning) |
49131 | 302 |
-R operate on requirements of selected sessions |
66745 | 303 |
-S soft build: only observe changes of sources, not heap images |
60106 | 304 |
-X NAME exclude sessions from group NAME and all descendants |
48578 | 305 |
-a select all sessions |
306 |
-b build heap images |
|
48595 | 307 |
-c clean build |
48737
f3bbb9ca57d6
added build option -D: include session directory and select its sessions;
wenzelm
parents:
48693
diff
changeset
|
308 |
-d DIR include session directory |
69811
18f61ce86425
clarified 'export_files' in session ROOT: require explicit "isabelle build -e";
wenzelm
parents:
69755
diff
changeset
|
309 |
-e export files from session specification into file-system |
66841 | 310 |
-f fresh build |
48578 | 311 |
-g NAME select session group NAME |
312 |
-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
|
313 |
-k KEYWORD check theory sources for conflicts with proposed keywords |
48903 | 314 |
-l list session source files |
48578 | 315 |
-n no build -- test dependencies only |
52056 | 316 |
-o OPTION override Isabelle system OPTION (via NAME=VAL or NAME) |
48578 | 317 |
-v verbose |
60106 | 318 |
-x NAME exclude session NAME and all descendants |
48578 | 319 |
|
62596 | 320 |
Build and manage Isabelle sessions, depending on implicit settings: |
321 |
||
48578 | 322 |
ISABELLE_BUILD_OPTIONS="..." |
323 |
||
324 |
ML_PLATFORM="..." |
|
325 |
ML_HOME="..." |
|
326 |
ML_SYSTEM="..." |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
327 |
ML_OPTIONS="..."\<close>} |
48578 | 328 |
|
61406 | 329 |
\<^medskip> |
61575 | 330 |
Isabelle sessions are defined via session ROOT files as described in |
331 |
(\secref{sec:session-root}). The totality of sessions is determined by |
|
332 |
collecting such specifications from all Isabelle component directories |
|
333 |
(\secref{sec:components}), augmented by more directories given via options |
|
334 |
\<^verbatim>\<open>-d\<close>~\<open>DIR\<close> on the command line. Each such directory may contain a session |
|
61503 | 335 |
\<^verbatim>\<open>ROOT\<close> file with several session specifications. |
48578 | 336 |
|
61575 | 337 |
Any session root directory may refer recursively to further directories of |
338 |
the same kind, by listing them in a catalog file \<^verbatim>\<open>ROOTS\<close> line-by-line. This |
|
339 |
helps to organize large collections of session specifications, or to make |
|
66576 | 340 |
\<^verbatim>\<open>-d\<close> command line options persistent (e.g.\ in |
61503 | 341 |
\<^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
|
342 |
|
61406 | 343 |
\<^medskip> |
61575 | 344 |
The subset of sessions to be managed is determined via individual \<open>SESSIONS\<close> |
345 |
given as command-line arguments, or session groups that are given via one or |
|
346 |
more options \<^verbatim>\<open>-g\<close>~\<open>NAME\<close>. Option \<^verbatim>\<open>-a\<close> selects all sessions. The build tool |
|
347 |
takes session dependencies into account: the set of selected sessions is |
|
348 |
completed by including all ancestors. |
|
48578 | 349 |
|
61406 | 350 |
\<^medskip> |
68734
c14a2cc9b5ef
isabelle build options -c -x -B refer to imports_graph;
wenzelm
parents:
68523
diff
changeset
|
351 |
One or more options \<^verbatim>\<open>-B\<close>~\<open>NAME\<close> specify base sessions to be included (all |
c14a2cc9b5ef
isabelle build options -c -x -B refer to imports_graph;
wenzelm
parents:
68523
diff
changeset
|
352 |
descendants wrt.\ the session parent or import graph). |
66737
2edc0c42c883
option -B for "isabelle build" and "isabelle imports";
wenzelm
parents:
66671
diff
changeset
|
353 |
|
2edc0c42c883
option -B for "isabelle build" and "isabelle imports";
wenzelm
parents:
66671
diff
changeset
|
354 |
\<^medskip> |
68734
c14a2cc9b5ef
isabelle build options -c -x -B refer to imports_graph;
wenzelm
parents:
68523
diff
changeset
|
355 |
One or more options \<^verbatim>\<open>-x\<close>~\<open>NAME\<close> specify sessions to be excluded (all |
c14a2cc9b5ef
isabelle build options -c -x -B refer to imports_graph;
wenzelm
parents:
68523
diff
changeset
|
356 |
descendants wrt.\ the session parent or import graph). Option \<^verbatim>\<open>-X\<close> is |
c14a2cc9b5ef
isabelle build options -c -x -B refer to imports_graph;
wenzelm
parents:
68523
diff
changeset
|
357 |
analogous to this, but excluded sessions are specified by session group |
c14a2cc9b5ef
isabelle build options -c -x -B refer to imports_graph;
wenzelm
parents:
68523
diff
changeset
|
358 |
membership. |
59892
2a616319c171
added isabelle build option -x, to exclude sessions;
wenzelm
parents:
59891
diff
changeset
|
359 |
|
61406 | 360 |
\<^medskip> |
61575 | 361 |
Option \<^verbatim>\<open>-R\<close> reverses the selection in the sense that it refers to its |
362 |
requirements: all ancestor sessions excluding the original selection. This |
|
363 |
allows to prepare the stage for some build process with different options, |
|
364 |
before running the main build itself (without option \<^verbatim>\<open>-R\<close>). |
|
49131 | 365 |
|
61406 | 366 |
\<^medskip> |
61575 | 367 |
Option \<^verbatim>\<open>-D\<close> is similar to \<^verbatim>\<open>-d\<close>, but selects all sessions that are defined |
368 |
in the given directories. |
|
48737
f3bbb9ca57d6
added build option -D: include session directory and select its sessions;
wenzelm
parents:
48693
diff
changeset
|
369 |
|
61406 | 370 |
\<^medskip> |
66745 | 371 |
Option \<^verbatim>\<open>-S\<close> indicates a ``soft build'': the selection is restricted to |
372 |
those sessions that have changed sources (according to actually imported |
|
373 |
theories). The status of heap images is ignored. |
|
374 |
||
375 |
\<^medskip> |
|
61406 | 376 |
The build process depends on additional options |
61575 | 377 |
(\secref{sec:system-options}) that are passed to the prover eventually. The |
378 |
settings variable @{setting_ref ISABELLE_BUILD_OPTIONS} allows to provide |
|
61602 | 379 |
additional defaults, e.g.\ \<^verbatim>\<open>ISABELLE_BUILD_OPTIONS="document=pdf threads=4"\<close>. |
380 |
Moreover, the environment of system build options may be augmented on the |
|
381 |
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 |
|
382 |
\<^verbatim>\<open>-o\<close>~\<open>name\<close>\<^verbatim>\<open>=true\<close> for Boolean options. Multiple occurrences of \<^verbatim>\<open>-o\<close> on |
|
383 |
the command-line are applied in the given order. |
|
48578 | 384 |
|
61406 | 385 |
\<^medskip> |
61575 | 386 |
Option \<^verbatim>\<open>-b\<close> ensures that heap images are produced for all selected |
387 |
sessions. By default, images are only saved for inner nodes of the hierarchy |
|
388 |
of sessions, as required for other sessions to continue later on. |
|
48578 | 389 |
|
61406 | 390 |
\<^medskip> |
68734
c14a2cc9b5ef
isabelle build options -c -x -B refer to imports_graph;
wenzelm
parents:
68523
diff
changeset
|
391 |
Option \<^verbatim>\<open>-c\<close> cleans the selected sessions (all descendants wrt.\ the session |
c14a2cc9b5ef
isabelle build options -c -x -B refer to imports_graph;
wenzelm
parents:
68523
diff
changeset
|
392 |
parent or import graph) before performing the specified build operation. |
48595 | 393 |
|
61406 | 394 |
\<^medskip> |
69811
18f61ce86425
clarified 'export_files' in session ROOT: require explicit "isabelle build -e";
wenzelm
parents:
69755
diff
changeset
|
395 |
Option \<^verbatim>\<open>-e\<close> executes the \isakeyword{export_files} directives from the ROOT |
18f61ce86425
clarified 'export_files' in session ROOT: require explicit "isabelle build -e";
wenzelm
parents:
69755
diff
changeset
|
396 |
specification of all explicitly selected sessions: the status of the session |
18f61ce86425
clarified 'export_files' in session ROOT: require explicit "isabelle build -e";
wenzelm
parents:
69755
diff
changeset
|
397 |
build database needs to be OK, but the session could have been built |
18f61ce86425
clarified 'export_files' in session ROOT: require explicit "isabelle build -e";
wenzelm
parents:
69755
diff
changeset
|
398 |
earlier. Using \isakeyword{export_files}, a session may serve as abstract |
18f61ce86425
clarified 'export_files' in session ROOT: require explicit "isabelle build -e";
wenzelm
parents:
69755
diff
changeset
|
399 |
interface for add-on build artefacts, but these are only materialized on |
18f61ce86425
clarified 'export_files' in session ROOT: require explicit "isabelle build -e";
wenzelm
parents:
69755
diff
changeset
|
400 |
explicit request: without option \<^verbatim>\<open>-e\<close> there is no effect on the physical |
18f61ce86425
clarified 'export_files' in session ROOT: require explicit "isabelle build -e";
wenzelm
parents:
69755
diff
changeset
|
401 |
file-system yet. |
18f61ce86425
clarified 'export_files' in session ROOT: require explicit "isabelle build -e";
wenzelm
parents:
69755
diff
changeset
|
402 |
|
18f61ce86425
clarified 'export_files' in session ROOT: require explicit "isabelle build -e";
wenzelm
parents:
69755
diff
changeset
|
403 |
\<^medskip> |
66841 | 404 |
Option \<^verbatim>\<open>-f\<close> forces a fresh build of all selected sessions and their |
405 |
requirements. |
|
406 |
||
407 |
\<^medskip> |
|
61575 | 408 |
Option \<^verbatim>\<open>-n\<close> omits the actual build process after the preparatory stage |
409 |
(including optional cleanup). Note that the return code always indicates the |
|
410 |
status of the set of selected sessions. |
|
48595 | 411 |
|
61406 | 412 |
\<^medskip> |
61575 | 413 |
Option \<^verbatim>\<open>-j\<close> specifies the maximum number of parallel build jobs (prover |
414 |
processes). Each prover process is subject to a separate limit of parallel |
|
415 |
worker threads, cf.\ system option @{system_option_ref threads}. |
|
48578 | 416 |
|
61406 | 417 |
\<^medskip> |
64265 | 418 |
Option \<^verbatim>\<open>-N\<close> enables cyclic shuffling of NUMA CPU nodes. This may help |
419 |
performance tuning on Linux servers with separate CPU/memory modules. |
|
420 |
||
421 |
\<^medskip> |
|
61575 | 422 |
Option \<^verbatim>\<open>-v\<close> increases the general level of verbosity. Option \<^verbatim>\<open>-l\<close> lists |
423 |
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
|
424 |
|
61406 | 425 |
\<^medskip> |
61575 | 426 |
Option \<^verbatim>\<open>-k\<close> specifies a newly proposed keyword for outer syntax (multiple |
427 |
uses allowed). The theory sources are checked for conflicts wrt.\ this |
|
428 |
hypothetical change of syntax, e.g.\ to reveal occurrences of identifiers |
|
429 |
that need to be quoted. |
|
430 |
\<close> |
|
59891
9ce697050455
added isabelle build option -k, for fast off-line checking of theory sources;
wenzelm
parents:
59446
diff
changeset
|
431 |
|
48578 | 432 |
|
58618 | 433 |
subsubsection \<open>Examples\<close> |
48578 | 434 |
|
58618 | 435 |
text \<open> |
48578 | 436 |
Build a specific logic image: |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
437 |
@{verbatim [display] \<open>isabelle build -b HOLCF\<close>} |
48578 | 438 |
|
61406 | 439 |
\<^smallskip> |
440 |
Build the main group of logic images: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
441 |
@{verbatim [display] \<open>isabelle build -b -g main\<close>} |
48578 | 442 |
|
61406 | 443 |
\<^smallskip> |
66748 | 444 |
Build all descendants (and requirements) of \<^verbatim>\<open>FOL\<close> and \<^verbatim>\<open>ZF\<close>: |
445 |
@{verbatim [display] \<open>isabelle build -B FOL -B ZF\<close>} |
|
446 |
||
447 |
\<^smallskip> |
|
448 |
Build all sessions where sources have changed (ignoring heaps): |
|
449 |
@{verbatim [display] \<open>isabelle build -a -S\<close>} |
|
450 |
||
451 |
\<^smallskip> |
|
61575 | 452 |
Provide a general overview of the status of all Isabelle sessions, without |
453 |
building anything: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
454 |
@{verbatim [display] \<open>isabelle build -a -n -v\<close>} |
48578 | 455 |
|
61406 | 456 |
\<^smallskip> |
61575 | 457 |
Build all sessions with HTML browser info and PDF document preparation: |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
458 |
@{verbatim [display] \<open>isabelle build -a -o browser_info -o document=pdf\<close>} |
48578 | 459 |
|
61406 | 460 |
\<^smallskip> |
61575 | 461 |
Build all sessions with a maximum of 8 parallel prover processes and 4 |
462 |
worker threads each (on a machine with many cores): |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
463 |
@{verbatim [display] \<open>isabelle build -a -j8 -o threads=4\<close>} |
48595 | 464 |
|
61406 | 465 |
\<^smallskip> |
61575 | 466 |
Build some session images with cleanup of their descendants, while retaining |
467 |
their ancestry: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
468 |
@{verbatim [display] \<open>isabelle build -b -c HOL-Algebra HOL-Word\<close>} |
48595 | 469 |
|
61406 | 470 |
\<^smallskip> |
471 |
Clean all sessions without building anything: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
472 |
@{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
|
473 |
|
61406 | 474 |
\<^smallskip> |
61575 | 475 |
Build all sessions from some other directory hierarchy, according to the |
476 |
settings variable \<^verbatim>\<open>AFP\<close> that happens to be defined inside the Isabelle |
|
477 |
environment: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
478 |
@{verbatim [display] \<open>isabelle build -D '$AFP'\<close>} |
49131 | 479 |
|
61406 | 480 |
\<^smallskip> |
61575 | 481 |
Inform about the status of all sessions required for AFP, without building |
482 |
anything yet: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
483 |
@{verbatim [display] \<open>isabelle build -D '$AFP' -R -v -n\<close>} |
58618 | 484 |
\<close> |
48578 | 485 |
|
66671 | 486 |
|
68152
619de043389f
guard result exports via export_pattern -- avoid bombing client via huge blobs;
wenzelm
parents:
68116
diff
changeset
|
487 |
section \<open>Retrieve theory exports \label{sec:tool-export}\<close> |
68116 | 488 |
|
489 |
text \<open> |
|
490 |
The @{tool_def "export"} tool retrieves theory exports from the session |
|
491 |
database. Its command-line usage is: @{verbatim [display] |
|
492 |
\<open>Usage: isabelle export [OPTIONS] SESSION |
|
493 |
||
494 |
Options are: |
|
68314
2acbf8129d8b
clarified option -O: avoid conflict with build/dump option -D;
wenzelm
parents:
68292
diff
changeset
|
495 |
-O DIR output directory for exported files (default: "export") |
68116 | 496 |
-d DIR include session directory |
497 |
-l list exports |
|
498 |
-n no build of session |
|
499 |
-o OPTION override Isabelle system OPTION (via NAME=VAL or NAME) |
|
69671 | 500 |
-p NUM prune path of exported files by NUM elements |
68514 | 501 |
-x PATTERN extract files matching pattern (e.g.\ "*:**" for all) |
68116 | 502 |
|
503 |
List or export theory exports for SESSION: named blobs produced by |
|
68290 | 504 |
isabelle build. Option -l or -x is required; option -x may be repeated. |
68116 | 505 |
|
506 |
The PATTERN language resembles glob patterns in the shell, with ? and * |
|
507 |
(both excluding ":" and "/"), ** (excluding ":"), and [abc] or [^abc], |
|
508 |
and variants {pattern1,pattern2,pattern3}.\<close>} |
|
509 |
||
510 |
\<^medskip> |
|
511 |
The specified session is updated via @{tool build} |
|
69854
cc0b3e177b49
system option "system_heaps" supersedes various command-line options for "system build mode";
wenzelm
parents:
69811
diff
changeset
|
512 |
(\secref{sec:tool-build}), with the same options \<^verbatim>\<open>-d\<close>, \<^verbatim>\<open>-o\<close>. The option |
cc0b3e177b49
system option "system_heaps" supersedes various command-line options for "system build mode";
wenzelm
parents:
69811
diff
changeset
|
513 |
\<^verbatim>\<open>-n\<close> suppresses the implicit build process: it means that a potentially |
cc0b3e177b49
system option "system_heaps" supersedes various command-line options for "system build mode";
wenzelm
parents:
69811
diff
changeset
|
514 |
outdated session database is used! |
68116 | 515 |
|
516 |
\<^medskip> |
|
517 |
Option \<^verbatim>\<open>-l\<close> lists all stored exports, with compound names |
|
518 |
\<open>theory\<close>\<^verbatim>\<open>:\<close>\<open>name\<close>. |
|
519 |
||
520 |
\<^medskip> |
|
521 |
Option \<^verbatim>\<open>-x\<close> extracts stored exports whose compound name matches the given |
|
522 |
pattern. Note that wild cards ``\<^verbatim>\<open>?\<close>'' and ``\<^verbatim>\<open>*\<close>'' do not match the |
|
523 |
separators ``\<^verbatim>\<open>:\<close>'' and ``\<^verbatim>\<open>/\<close>''; the wild card \<^verbatim>\<open>**\<close> matches over directory |
|
524 |
name hierarchies separated by ``\<^verbatim>\<open>/\<close>''. Thus the pattern ``\<^verbatim>\<open>*:**\<close>'' matches |
|
68290 | 525 |
\<^emph>\<open>all\<close> theory exports. Multiple options \<^verbatim>\<open>-x\<close> refer to the union of all |
526 |
specified patterns. |
|
68116 | 527 |
|
68314
2acbf8129d8b
clarified option -O: avoid conflict with build/dump option -D;
wenzelm
parents:
68292
diff
changeset
|
528 |
Option \<^verbatim>\<open>-O\<close> specifies an alternative output directory for option \<^verbatim>\<open>-x\<close>: the |
68116 | 529 |
default is \<^verbatim>\<open>export\<close> within the current directory. Each theory creates its |
530 |
own sub-directory hierarchy, using the session-qualified theory name. |
|
69671 | 531 |
|
532 |
Option \<^verbatim>\<open>-p\<close> specifies the number of elements that should be pruned from |
|
533 |
each name: it allows to reduce the resulting directory hierarchy at the |
|
534 |
danger of overwriting files due to loss of uniqueness. |
|
68116 | 535 |
\<close> |
536 |
||
68348 | 537 |
|
538 |
section \<open>Dump PIDE session database \label{sec:tool-dump}\<close> |
|
539 |
||
540 |
text \<open> |
|
541 |
The @{tool_def "dump"} tool dumps information from the cumulative PIDE |
|
542 |
session database (which is processed on the spot). Its command-line usage |
|
543 |
is: @{verbatim [display] |
|
544 |
\<open>Usage: isabelle dump [OPTIONS] [SESSIONS ...] |
|
545 |
||
546 |
Options are: |
|
547 |
-A NAMES dump named aspects (default: ...) |
|
548 |
-B NAME include session NAME and all descendants |
|
549 |
-D DIR include session directory and select its sessions |
|
550 |
-O DIR output directory for dumped files (default: "dump") |
|
551 |
-R operate on requirements of selected sessions |
|
552 |
-X NAME exclude sessions from group NAME and all descendants |
|
553 |
-a select all sessions |
|
554 |
-d DIR include session directory |
|
555 |
-g NAME select session group NAME |
|
70858 | 556 |
-l NAME logic session name (default "Pure") |
68348 | 557 |
-o OPTION override Isabelle system OPTION (via NAME=VAL or NAME) |
558 |
-v verbose |
|
559 |
-x NAME exclude session NAME and all descendants |
|
560 |
||
561 |
Dump cumulative PIDE session database, with the following aspects: |
|
562 |
...\<close>} |
|
563 |
||
564 |
\<^medskip> Options \<^verbatim>\<open>-B\<close>, \<^verbatim>\<open>-D\<close>, \<^verbatim>\<open>-R\<close>, \<^verbatim>\<open>-X\<close>, \<^verbatim>\<open>-a\<close>, \<^verbatim>\<open>-d\<close>, \<^verbatim>\<open>-g\<close>, \<^verbatim>\<open>-x\<close> and the |
|
565 |
remaining command-line arguments specify sessions as in @{tool build} |
|
566 |
(\secref{sec:tool-build}): the cumulative PIDE database of all their loaded |
|
567 |
theories is dumped to the output directory of option \<^verbatim>\<open>-O\<close> (default: \<^verbatim>\<open>dump\<close> |
|
568 |
in the current directory). |
|
569 |
||
70859
6e6254bbce1f
split into standard partitions, for improved scalability;
wenzelm
parents:
70858
diff
changeset
|
570 |
\<^medskip> Option \<^verbatim>\<open>-b\<close> specifies an optional base logic image, for improved |
6e6254bbce1f
split into standard partitions, for improved scalability;
wenzelm
parents:
70858
diff
changeset
|
571 |
scalability of the PIDE session. Its theories are processed separately, |
6e6254bbce1f
split into standard partitions, for improved scalability;
wenzelm
parents:
70858
diff
changeset
|
572 |
always starting from the \<^emph>\<open>Pure\<close> session. |
6e6254bbce1f
split into standard partitions, for improved scalability;
wenzelm
parents:
70858
diff
changeset
|
573 |
|
68348 | 574 |
\<^medskip> Option \<^verbatim>\<open>-o\<close> overrides Isabelle system options as for @{tool build} |
575 |
(\secref{sec:tool-build}). |
|
576 |
||
577 |
\<^medskip> Option \<^verbatim>\<open>-v\<close> increases the general level of verbosity. |
|
578 |
||
579 |
\<^medskip> Option \<^verbatim>\<open>-A\<close> specifies named aspects of the dump, as a comma-separated |
|
580 |
list. The default is to dump all known aspects, as given in the command-line |
|
581 |
usage of the tool. The underlying Isabelle/Scala function |
|
582 |
\<^verbatim>\<open>isabelle.Dump.dump()\<close> takes aspects as user-defined operations on the |
|
583 |
final PIDE state and document version. This allows to imitate Prover IDE |
|
584 |
rendering under program control. |
|
585 |
\<close> |
|
586 |
||
587 |
||
588 |
subsubsection \<open>Examples\<close> |
|
589 |
||
590 |
text \<open> |
|
591 |
Dump all Isabelle/ZF sessions (which are rather small): |
|
592 |
@{verbatim [display] \<open>isabelle dump -v -B ZF\<close>} |
|
593 |
||
594 |
\<^smallskip> |
|
595 |
Dump the quite substantial \<^verbatim>\<open>HOL-Analysis\<close> session, using main Isabelle/HOL |
|
596 |
as starting point: |
|
597 |
@{verbatim [display] \<open>isabelle dump -v -l HOL HOL-Analysis\<close>} |
|
598 |
||
599 |
\<^smallskip> |
|
600 |
Dump all sessions connected to HOL-Analysis, including a full bootstrap of |
|
601 |
Isabelle/HOL from Isabelle/Pure: |
|
602 |
@{verbatim [display] \<open>isabelle dump -v -l Pure -B HOL-Analysis\<close>} |
|
603 |
||
604 |
This results in uniform PIDE markup for everything, except for the |
|
605 |
Isabelle/Pure bootstrap process itself. Producing that on the spot requires |
|
606 |
several GB of heap space, both for the Isabelle/Scala and Isabelle/ML |
|
607 |
process (in 64bit mode). Here are some relevant settings (\secref{sec:boot}) |
|
608 |
for such ambitious applications: |
|
609 |
@{verbatim [display] |
|
610 |
\<open>ISABELLE_TOOL_JAVA_OPTIONS="-Xms4g -Xmx32g -Xss16m" |
|
611 |
ML_OPTIONS="--minheap 4G --maxheap 32G" |
|
612 |
\<close>} |
|
69599 | 613 |
\<close> |
68348 | 614 |
|
69599 | 615 |
|
616 |
section \<open>Update theory sources based on PIDE markup \label{sec:tool-update}\<close> |
|
617 |
||
618 |
text \<open> |
|
619 |
The @{tool_def "update"} tool updates theory sources based on markup that is |
|
620 |
produced from a running PIDE session (similar to @{tool dump} |
|
621 |
\secref{sec:tool-dump}). Its command-line usage is: @{verbatim [display] |
|
622 |
\<open>Usage: isabelle update [OPTIONS] [SESSIONS ...] |
|
623 |
||
624 |
Options are: |
|
625 |
-B NAME include session NAME and all descendants |
|
626 |
-D DIR include session directory and select its sessions |
|
627 |
-R operate on requirements of selected sessions |
|
628 |
-X NAME exclude sessions from group NAME and all descendants |
|
629 |
-a select all sessions |
|
630 |
-d DIR include session directory |
|
631 |
-g NAME select session group NAME |
|
632 |
-l NAME logic session name (default ISABELLE_LOGIC="HOL") |
|
633 |
-o OPTION override Isabelle system OPTION (via NAME=VAL or NAME) |
|
634 |
-u OPT overide update option: shortcut for "-o update_OPT" |
|
635 |
-v verbose |
|
636 |
-x NAME exclude session NAME and all descendants |
|
637 |
||
638 |
Update theory sources based on PIDE markup.\<close>} |
|
639 |
||
640 |
\<^medskip> Options \<^verbatim>\<open>-B\<close>, \<^verbatim>\<open>-D\<close>, \<^verbatim>\<open>-R\<close>, \<^verbatim>\<open>-X\<close>, \<^verbatim>\<open>-a\<close>, \<^verbatim>\<open>-d\<close>, \<^verbatim>\<open>-g\<close>, \<^verbatim>\<open>-x\<close> and the |
|
641 |
remaining command-line arguments specify sessions as in @{tool build} |
|
642 |
(\secref{sec:tool-build}) or @{tool dump} (\secref{sec:tool-dump}). |
|
643 |
||
69854
cc0b3e177b49
system option "system_heaps" supersedes various command-line options for "system build mode";
wenzelm
parents:
69811
diff
changeset
|
644 |
\<^medskip> Option \<^verbatim>\<open>-l\<close> specifies the underlying logic image. |
69599 | 645 |
|
646 |
\<^medskip> Option \<^verbatim>\<open>-v\<close> increases the general level of verbosity. |
|
647 |
||
648 |
\<^medskip> Option \<^verbatim>\<open>-o\<close> overrides Isabelle system options as for @{tool build} |
|
649 |
(\secref{sec:tool-build}). Option \<^verbatim>\<open>-u\<close> refers to specific \<^verbatim>\<open>update\<close> |
|
650 |
options, by relying on naming convention: ``\<^verbatim>\<open>-u\<close>~\<open>OPT\<close>'' is a shortcut for |
|
651 |
``\<^verbatim>\<open>-o\<close>~\<^verbatim>\<open>update_\<close>\<open>OPT\<close>''. |
|
652 |
||
653 |
\<^medskip> The following update options are supported: |
|
654 |
||
655 |
\<^item> @{system_option update_inner_syntax_cartouches} to update inner syntax |
|
656 |
(types, terms, etc.)~to use cartouches, instead of double-quoted strings |
|
657 |
or atomic identifiers. For example, ``\<^theory_text>\<open>lemma \<doublequote>x = |
|
69610 | 658 |
x\<doublequote>\<close>'' is replaced by ``\<^theory_text>\<open>lemma \<open>x = x\<close>\<close>'', and ``\<^theory_text>\<open>assume |
659 |
A\<close>'' is replaced by ``\<^theory_text>\<open>assume \<open>A\<close>\<close>''. |
|
69599 | 660 |
|
661 |
\<^item> @{system_option update_mixfix_cartouches} to update mixfix templates to |
|
662 |
use cartouches instead of double-quoted strings. For example, ``\<^theory_text>\<open>(infixl |
|
663 |
\<doublequote>+\<doublequote> 65)\<close>'' is replaced by ``\<^theory_text>\<open>(infixl \<open>+\<close> |
|
664 |
65)\<close>''. |
|
665 |
||
666 |
\<^item> @{system_option update_control_cartouches} to update antiquotations to |
|
667 |
use the compact form with control symbol and cartouche argument. For |
|
668 |
example, ``\<open>@{term \<doublequote>x + y\<doublequote>}\<close>'' is replaced by |
|
669 |
``\<open>\<^term>\<open>x + y\<close>\<close>'' (the control symbol is literally \<^verbatim>\<open>\<^term>\<close>.) |
|
670 |
||
69603 | 671 |
\<^item> @{system_option update_path_cartouches} to update file-system paths to |
672 |
use cartouches: this depends on language markup provided by semantic |
|
673 |
processing of parsed input. |
|
674 |
||
69599 | 675 |
It is also possible to produce custom updates in Isabelle/ML, by reporting |
676 |
\<^ML>\<open>Markup.update\<close> with the precise source position and a replacement |
|
677 |
text. This operation should be made conditional on specific system options, |
|
678 |
similar to the ones above. Searching the above option names in ML sources of |
|
679 |
\<^dir>\<open>$ISABELLE_HOME/src/Pure\<close> provides some examples. |
|
680 |
||
69602 | 681 |
Updates can be in conflict by producing nested or overlapping edits: this |
682 |
may require to run @{tool update} multiple times. |
|
69599 | 683 |
\<close> |
684 |
||
685 |
||
686 |
subsubsection \<open>Examples\<close> |
|
687 |
||
688 |
text \<open> |
|
689 |
Update some cartouche notation in all theory sources required for session |
|
690 |
\<^verbatim>\<open>HOL-Analysis\<close>: |
|
691 |
||
692 |
@{verbatim [display] \<open>isabelle update -u mixfix_cartouches -l Pure HOL-Analysis\<close>} |
|
693 |
||
694 |
\<^smallskip> Update the same for all application sessions based on \<^verbatim>\<open>HOL-Analysis\<close> --- |
|
695 |
its image is taken as starting point and its sources are not touched: |
|
696 |
||
697 |
@{verbatim [display] \<open>isabelle update -u mixfix_cartouches -l HOL-Analysis -B HOL-Analysis\<close>} |
|
698 |
||
699 |
\<^smallskip> This two-stage approach reduces resource requirements of the running PIDE |
|
700 |
session: a base image like \<^verbatim>\<open>HOL-Analysis\<close> (or \<^verbatim>\<open>HOL\<close>, \<^verbatim>\<open>HOL-Library\<close>) is |
|
701 |
more compact than importing all required theory (and ML) source files from |
|
702 |
\<^verbatim>\<open>Pure\<close>. |
|
703 |
||
704 |
\<^smallskip> Update sessions that build on \<^verbatim>\<open>HOL-Proofs\<close>, which need to be run |
|
705 |
separately with special options as follows: |
|
706 |
||
707 |
@{verbatim [display] \<open>isabelle update -u mixfix_cartouches -l HOL-Proofs -B HOL-Proofs |
|
69601 | 708 |
-o record_proofs=2\<close>} |
69599 | 709 |
|
710 |
\<^smallskip> See also the end of \secref{sec:tool-dump} for hints on increasing |
|
711 |
Isabelle/ML heap sizes for very big PIDE processes that include many |
|
712 |
sessions, notably from the Archive of Formal Proofs. |
|
68348 | 713 |
\<close> |
714 |
||
48578 | 715 |
end |