author | wenzelm |
Sat, 10 Sep 2022 16:12:52 +0200 | |
changeset 76107 | 4dedb6e2dac2 |
parent 76089 | 13ae8dff47b6 |
child 76110 | 0605eb327e60 |
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 |
|
75986
27d98da31985
support 'chapter_definition' with description for presentation purposes;
wenzelm
parents:
75559
diff
changeset
|
41 |
comments etc. The grammar for @{syntax chapter_def}, @{syntax chapter_entry} |
27d98da31985
support 'chapter_definition' with description for presentation purposes;
wenzelm
parents:
75559
diff
changeset
|
42 |
and @{syntax session_entry} is given as syntax diagram below. Each ROOT file |
27d98da31985
support 'chapter_definition' with description for presentation purposes;
wenzelm
parents:
75559
diff
changeset
|
43 |
may contain multiple specifications like this. Chapters help to organize |
27d98da31985
support 'chapter_definition' with description for presentation purposes;
wenzelm
parents:
75559
diff
changeset
|
44 |
browser info (\secref{sec:info}), but have no formal meaning. The default |
76005
a9bbf075f431
include groups from 'chapter_definition' in session info, based on the state of chapter_defs after processing all ROOT files (thus the declaration order does not matter);
wenzelm
parents:
75998
diff
changeset
|
45 |
chapter is ``\<open>Unsorted\<close>''. Chapter definitions, which are optional, allow to |
a9bbf075f431
include groups from 'chapter_definition' in session info, based on the state of chapter_defs after processing all ROOT files (thus the declaration order does not matter);
wenzelm
parents:
75998
diff
changeset
|
46 |
associate additional information. |
48579 | 47 |
|
61575 | 48 |
Isabelle/jEdit @{cite "isabelle-jedit"} includes a simple editing mode |
49 |
\<^verbatim>\<open>isabelle-root\<close> for session ROOT files, which is enabled by default for any |
|
50 |
file of that name. |
|
48579 | 51 |
|
69593 | 52 |
\<^rail>\<open> |
76005
a9bbf075f431
include groups from 'chapter_definition' in session info, based on the state of chapter_defs after processing all ROOT files (thus the declaration order does not matter);
wenzelm
parents:
75998
diff
changeset
|
53 |
@{syntax_def chapter_def}: @'chapter_definition' @{syntax name} \<newline> |
a9bbf075f431
include groups from 'chapter_definition' in session info, based on the state of chapter_defs after processing all ROOT files (thus the declaration order does not matter);
wenzelm
parents:
75998
diff
changeset
|
54 |
groups? description? |
75986
27d98da31985
support 'chapter_definition' with description for presentation purposes;
wenzelm
parents:
75559
diff
changeset
|
55 |
; |
27d98da31985
support 'chapter_definition' with description for presentation purposes;
wenzelm
parents:
75559
diff
changeset
|
56 |
|
27d98da31985
support 'chapter_definition' with description for presentation purposes;
wenzelm
parents:
75559
diff
changeset
|
57 |
@{syntax_def chapter_entry}: @'chapter' @{syntax name} |
51417 | 58 |
; |
59 |
||
66971 | 60 |
@{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
|
61 |
(@{syntax system_name} '+')? description? options? \<newline> |
36c8c32346cb
clarified syntax: 'directories' and 'theories' belong together;
wenzelm
parents:
70677
diff
changeset
|
62 |
sessions? directories? (theories*) \<newline> |
72600
2fa4f25d9d07
official support for document theories from other sessions;
wenzelm
parents:
72574
diff
changeset
|
63 |
(document_theories?) (document_files*) \<newline> |
2fa4f25d9d07
official support for document theories from other sessions;
wenzelm
parents:
72574
diff
changeset
|
64 |
(export_files*) |
48579 | 65 |
; |
66 |
groups: '(' (@{syntax name} +) ')' |
|
67 |
; |
|
68808 | 68 |
dir: @'in' @{syntax embedded} |
48579 | 69 |
; |
70 |
description: @'description' @{syntax text} |
|
71 |
; |
|
72 |
options: @'options' opts |
|
73 |
; |
|
48605
e777363440d6
allow negative int values as well, according to real = int | float;
wenzelm
parents:
48604
diff
changeset
|
74 |
opts: '[' ( (@{syntax name} '=' value | @{syntax name}) + ',' ) ']' |
e777363440d6
allow negative int values as well, according to real = int | float;
wenzelm
parents:
48604
diff
changeset
|
75 |
; |
e777363440d6
allow negative int values as well, according to real = int | float;
wenzelm
parents:
48604
diff
changeset
|
76 |
value: @{syntax name} | @{syntax real} |
48579 | 77 |
; |
66916 | 78 |
sessions: @'sessions' (@{syntax system_name}+) |
65374 | 79 |
; |
70681 | 80 |
directories: @'directories' (dir+) |
70678
36c8c32346cb
clarified syntax: 'directories' and 'theories' belong together;
wenzelm
parents:
70677
diff
changeset
|
81 |
; |
66970
13857f49d215
clarified ROOT syntax: 'sessions' and 'theories' are optional, but need to be non-empty;
wenzelm
parents:
66916
diff
changeset
|
82 |
theories: @'theories' opts? (theory_entry+) |
48579 | 83 |
; |
66916 | 84 |
theory_entry: @{syntax system_name} ('(' @'global' ')')? |
65504 | 85 |
; |
72600
2fa4f25d9d07
official support for document theories from other sessions;
wenzelm
parents:
72574
diff
changeset
|
86 |
document_theories: @'document_theories' (@{syntax name}+) |
2fa4f25d9d07
official support for document theories from other sessions;
wenzelm
parents:
72574
diff
changeset
|
87 |
; |
68808 | 88 |
document_files: @'document_files' ('(' dir ')')? (@{syntax embedded}+) |
68292 | 89 |
; |
69671 | 90 |
export_files: @'export_files' ('(' dir ')')? ('[' nat ']')? \<newline> |
91 |
(@{syntax embedded}+) |
|
69593 | 92 |
\<close> |
48579 | 93 |
|
76005
a9bbf075f431
include groups from 'chapter_definition' in session info, based on the state of chapter_defs after processing all ROOT files (thus the declaration order does not matter);
wenzelm
parents:
75998
diff
changeset
|
94 |
\<^descr> \isakeyword{chapter{\isacharunderscorekeyword}definition}~\<open>A (groups)\<close> |
a9bbf075f431
include groups from 'chapter_definition' in session info, based on the state of chapter_defs after processing all ROOT files (thus the declaration order does not matter);
wenzelm
parents:
75998
diff
changeset
|
95 |
associates a collection of groups with chapter \<open>A\<close>. All sessions that belong |
a9bbf075f431
include groups from 'chapter_definition' in session info, based on the state of chapter_defs after processing all ROOT files (thus the declaration order does not matter);
wenzelm
parents:
75998
diff
changeset
|
96 |
to this chapter will automatically become members of these groups. |
a9bbf075f431
include groups from 'chapter_definition' in session info, based on the state of chapter_defs after processing all ROOT files (thus the declaration order does not matter);
wenzelm
parents:
75998
diff
changeset
|
97 |
|
61575 | 98 |
\<^descr> \isakeyword{session}~\<open>A = B + body\<close> defines a new session \<open>A\<close> based on |
66759 | 99 |
parent session \<open>B\<close>, with its content given in \<open>body\<close> (imported sessions and |
100 |
theories). Note that a parent (like \<open>HOL\<close>) is mandatory in practical |
|
101 |
applications: only Isabelle/Pure can bootstrap itself from nothing. |
|
48579 | 102 |
|
65504 | 103 |
All such session specifications together describe a hierarchy (graph) of |
61575 | 104 |
sessions, with globally unique names. The new session name \<open>A\<close> should be |
105 |
sufficiently long and descriptive to stand on its own in a potentially large |
|
106 |
library. |
|
48579 | 107 |
|
61575 | 108 |
\<^descr> \isakeyword{session}~\<open>A (groups)\<close> indicates a collection of groups where |
109 |
the new session is a member. Group names are uninterpreted and merely follow |
|
110 |
certain conventions. For example, the Isabelle distribution tags some |
|
111 |
important sessions by the group name called ``\<open>main\<close>''. Other projects may |
|
112 |
invent their own conventions, but this requires some care to avoid clashes |
|
48604 | 113 |
within this unchecked name space. |
48579 | 114 |
|
61575 | 115 |
\<^descr> \isakeyword{session}~\<open>A\<close>~\isakeyword{in}~\<open>dir\<close> specifies an explicit |
116 |
directory for this session; by default this is the current directory of the |
|
117 |
\<^verbatim>\<open>ROOT\<close> file. |
|
48579 | 118 |
|
66759 | 119 |
All theory files are located relatively to the session directory. The prover |
120 |
process is run within the same as its current working directory. |
|
48579 | 121 |
|
76005
a9bbf075f431
include groups from 'chapter_definition' in session info, based on the state of chapter_defs after processing all ROOT files (thus the declaration order does not matter);
wenzelm
parents:
75998
diff
changeset
|
122 |
\<^descr> \isakeyword{description}~\<open>text\<close> is a free-form description for this |
a9bbf075f431
include groups from 'chapter_definition' in session info, based on the state of chapter_defs after processing all ROOT files (thus the declaration order does not matter);
wenzelm
parents:
75998
diff
changeset
|
123 |
session (or chapter), e.g. for presentation purposes. |
48579 | 124 |
|
61575 | 125 |
\<^descr> \isakeyword{options}~\<open>[x = a, y = b, z]\<close> defines separate options |
126 |
(\secref{sec:system-options}) that are used when processing this session, |
|
127 |
but \<^emph>\<open>without\<close> propagation to child sessions. Note that \<open>z\<close> abbreviates \<open>z = |
|
128 |
true\<close> for Boolean options. |
|
129 |
||
65504 | 130 |
\<^descr> \isakeyword{sessions}~\<open>names\<close> specifies sessions that are \<^emph>\<open>imported\<close> into |
131 |
the current name space of theories. This allows to refer to a theory \<open>A\<close> |
|
132 |
from session \<open>B\<close> by the qualified name \<open>B.A\<close> --- although it is loaded again |
|
133 |
into the current ML process, which is in contrast to a theory that is |
|
134 |
already present in the \<^emph>\<open>parent\<close> session. |
|
135 |
||
65505 | 136 |
Theories that are imported from other sessions are excluded from the current |
137 |
session document. |
|
138 |
||
70678
36c8c32346cb
clarified syntax: 'directories' and 'theories' belong together;
wenzelm
parents:
70677
diff
changeset
|
139 |
\<^descr> \isakeyword{directories}~\<open>dirs\<close> specifies additional directories for |
36c8c32346cb
clarified syntax: 'directories' and 'theories' belong together;
wenzelm
parents:
70677
diff
changeset
|
140 |
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
|
141 |
\<^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
|
142 |
directory (cf.\ \isakeyword{session} \dots \isakeyword{in}~\<open>dir\<close>). These |
70681 | 143 |
directories need to be exclusively assigned to a unique session, without |
144 |
implicit sharing of file-system locations. |
|
70678
36c8c32346cb
clarified syntax: 'directories' and 'theories' belong together;
wenzelm
parents:
70677
diff
changeset
|
145 |
|
61575 | 146 |
\<^descr> \isakeyword{theories}~\<open>options names\<close> specifies a block of theories that |
147 |
are processed within an environment that is augmented by the given options, |
|
148 |
in addition to the global session options given before. Any number of blocks |
|
149 |
of \isakeyword{theories} may be given. Options are only active for each |
|
48604 | 150 |
\isakeyword{theories} block separately. |
48579 | 151 |
|
65374 | 152 |
A theory name that is followed by \<open>(\<close>\isakeyword{global}\<open>)\<close> is treated |
66993 | 153 |
literally in other session specifications or theory imports --- the normal |
154 |
situation is to qualify theory names by the session name; this ensures |
|
155 |
globally unique names in big session graphs. Global theories are usually the |
|
156 |
entry points to major logic sessions: \<open>Pure\<close>, \<open>Main\<close>, \<open>Complex_Main\<close>, |
|
157 |
\<open>HOLCF\<close>, \<open>IFOL\<close>, \<open>FOL\<close>, \<open>ZF\<close>, \<open>ZFC\<close> etc. Regular Isabelle applications |
|
158 |
should not claim any global theory names. |
|
65374 | 159 |
|
72600
2fa4f25d9d07
official support for document theories from other sessions;
wenzelm
parents:
72574
diff
changeset
|
160 |
\<^descr> \isakeyword{document_theories}~\<open>names\<close> specifies theories from other |
2fa4f25d9d07
official support for document theories from other sessions;
wenzelm
parents:
72574
diff
changeset
|
161 |
sessions that should be included in the generated document source directory. |
2fa4f25d9d07
official support for document theories from other sessions;
wenzelm
parents:
72574
diff
changeset
|
162 |
These theories need to be explicit imports in the current session, or |
72769 | 163 |
implicit imports from the underlying hierarchy of parent sessions. The |
72600
2fa4f25d9d07
official support for document theories from other sessions;
wenzelm
parents:
72574
diff
changeset
|
164 |
generated \<^verbatim>\<open>session.tex\<close> file is not affected: the session's {\LaTeX} setup |
2fa4f25d9d07
official support for document theories from other sessions;
wenzelm
parents:
72574
diff
changeset
|
165 |
needs to \<^verbatim>\<open>\input{\<close>\<open>\<dots>\<close>\<^verbatim>\<open>}\<close> generated \<^verbatim>\<open>.tex\<close> files separately. |
2fa4f25d9d07
official support for document theories from other sessions;
wenzelm
parents:
72574
diff
changeset
|
166 |
|
61575 | 167 |
\<^descr> \isakeyword{document_files}~\<open>(\<close>\isakeyword{in}~\<open>base_dir) files\<close> lists |
168 |
source files for document preparation, typically \<^verbatim>\<open>.tex\<close> and \<^verbatim>\<open>.sty\<close> for |
|
169 |
{\LaTeX}. Only these explicitly given files are copied from the base |
|
170 |
directory to the document output directory, before formal document |
|
171 |
processing is started (see also \secref{sec:tool-document}). The local path |
|
172 |
structure of the \<open>files\<close> is preserved, which allows to reconstruct the |
|
68292 | 173 |
original directory hierarchy of \<open>base_dir\<close>. The default \<open>base_dir\<close> is |
174 |
\<^verbatim>\<open>document\<close> within the session root directory. |
|
56533
cd8b6d849b6a
explicit 'document_files' in session ROOT specifications;
wenzelm
parents:
55112
diff
changeset
|
175 |
|
69671 | 176 |
\<^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
|
177 |
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
|
178 |
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
|
179 |
\<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
|
180 |
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
|
181 |
export} (\secref{sec:tool-export}). The number given in brackets (default: |
75161
95612f330c93
misc tuning based on comments by Heiko Eißfeldt;
wenzelm
parents:
74873
diff
changeset
|
182 |
0) specifies the prefix of elements that should be removed from each name: |
95612f330c93
misc tuning based on comments by Heiko Eißfeldt;
wenzelm
parents:
74873
diff
changeset
|
183 |
it allows to reduce the resulting directory hierarchy at the danger of |
95612f330c93
misc tuning based on comments by Heiko Eißfeldt;
wenzelm
parents:
74873
diff
changeset
|
184 |
overwriting files due to loss of uniqueness. |
58618 | 185 |
\<close> |
48579 | 186 |
|
51055 | 187 |
|
58618 | 188 |
subsubsection \<open>Examples\<close> |
48580 | 189 |
|
61575 | 190 |
text \<open> |
63680 | 191 |
See \<^file>\<open>~~/src/HOL/ROOT\<close> for a diversity of practically relevant situations, |
192 |
although it uses relatively complex quasi-hierarchic naming conventions like |
|
193 |
\<^verbatim>\<open>HOL-SPARK\<close>, \<^verbatim>\<open>HOL-SPARK-Examples\<close>. An alternative is to use unqualified |
|
194 |
names that are relatively long and descriptive, as in the Archive of Formal |
|
67605 | 195 |
Proofs (\<^url>\<open>https://isa-afp.org\<close>), for example. |
61575 | 196 |
\<close> |
48578 | 197 |
|
198 |
||
58618 | 199 |
section \<open>System build options \label{sec:system-options}\<close> |
48578 | 200 |
|
61575 | 201 |
text \<open> |
63680 | 202 |
See \<^file>\<open>~~/etc/options\<close> for the main defaults provided by the Isabelle |
61575 | 203 |
distribution. Isabelle/jEdit @{cite "isabelle-jedit"} includes a simple |
204 |
editing mode \<^verbatim>\<open>isabelle-options\<close> for this file-format. |
|
48693
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48684
diff
changeset
|
205 |
|
61575 | 206 |
The following options are particularly relevant to build Isabelle sessions, |
207 |
in particular with document preparation (\chref{ch:present}). |
|
51055 | 208 |
|
61575 | 209 |
\<^item> @{system_option_def "browser_info"} controls output of HTML browser |
210 |
info, see also \secref{sec:info}. |
|
51055 | 211 |
|
72574
d892f6d66402
build documents in Isabelle/Scala, based on generated tex files as session exports;
wenzelm
parents:
72515
diff
changeset
|
212 |
\<^item> @{system_option_def "document"} controls document output for a |
73826
72900f34dbb3
allow system option short form NAME for NAME=true for type string, not just bool;
wenzelm
parents:
73777
diff
changeset
|
213 |
particular session or theory; \<^verbatim>\<open>document=pdf\<close> or \<^verbatim>\<open>document=true\<close> means |
72900f34dbb3
allow system option short form NAME for NAME=true for type string, not just bool;
wenzelm
parents:
73777
diff
changeset
|
214 |
enabled, \<^verbatim>\<open>document=""\<close> or \<^verbatim>\<open>document=false\<close> means disabled (especially |
72900f34dbb3
allow system option short form NAME for NAME=true for type string, not just bool;
wenzelm
parents:
73777
diff
changeset
|
215 |
for particular theories). |
51055 | 216 |
|
61575 | 217 |
\<^item> @{system_option_def "document_output"} specifies an alternative |
218 |
directory for generated output of the document preparation system; the |
|
219 |
default is within the @{setting "ISABELLE_BROWSER_INFO"} hierarchy as |
|
220 |
explained in \secref{sec:info}. See also @{tool mkroot}, which generates a |
|
221 |
default configuration with output readily available to the author of the |
|
222 |
document. |
|
51055 | 223 |
|
74873 | 224 |
\<^item> @{system_option_def "document_echo"} informs about document file names |
225 |
during session presentation. |
|
226 |
||
61575 | 227 |
\<^item> @{system_option_def "document_variants"} specifies document variants as |
75161
95612f330c93
misc tuning based on comments by Heiko Eißfeldt;
wenzelm
parents:
74873
diff
changeset
|
228 |
a colon-separated list of \<open>name=tags\<close> entries. The default name is |
72574
d892f6d66402
build documents in Isabelle/Scala, based on generated tex files as session exports;
wenzelm
parents:
72515
diff
changeset
|
229 |
\<^verbatim>\<open>document\<close>, without additional tags. |
51055 | 230 |
|
72574
d892f6d66402
build documents in Isabelle/Scala, based on generated tex files as session exports;
wenzelm
parents:
72515
diff
changeset
|
231 |
Tags are specified as a comma separated list of modifier/name pairs and |
d892f6d66402
build documents in Isabelle/Scala, based on generated tex files as session exports;
wenzelm
parents:
72515
diff
changeset
|
232 |
tell {\LaTeX} how to interpret certain Isabelle command regions: |
d892f6d66402
build documents in Isabelle/Scala, based on generated tex files as session exports;
wenzelm
parents:
72515
diff
changeset
|
233 |
``\<^verbatim>\<open>+\<close>\<open>foo\<close>'' (or just ``\<open>foo\<close>'') means to keep, ``\<^verbatim>\<open>-\<close>\<open>foo\<close>'' to drop, |
d892f6d66402
build documents in Isabelle/Scala, based on generated tex files as session exports;
wenzelm
parents:
72515
diff
changeset
|
234 |
and ``\<^verbatim>\<open>/\<close>\<open>foo\<close>'' to fold text tagged as \<open>foo\<close>. The builtin default is |
d892f6d66402
build documents in Isabelle/Scala, based on generated tex files as session exports;
wenzelm
parents:
72515
diff
changeset
|
235 |
equivalent to the tag specification |
d892f6d66402
build documents in Isabelle/Scala, based on generated tex files as session exports;
wenzelm
parents:
72515
diff
changeset
|
236 |
``\<^verbatim>\<open>+document,+theory,+proof,+ML,+visible,-invisible,+important,+unimportant\<close>''; |
d892f6d66402
build documents in Isabelle/Scala, based on generated tex files as session exports;
wenzelm
parents:
72515
diff
changeset
|
237 |
see also the {\LaTeX} macros \<^verbatim>\<open>\isakeeptag\<close>, \<^verbatim>\<open>\isadroptag\<close>, and |
d892f6d66402
build documents in Isabelle/Scala, based on generated tex files as session exports;
wenzelm
parents:
72515
diff
changeset
|
238 |
\<^verbatim>\<open>\isafoldtag\<close>, in \<^file>\<open>~~/lib/texinputs/isabelle.sty\<close>. |
d892f6d66402
build documents in Isabelle/Scala, based on generated tex files as session exports;
wenzelm
parents:
72515
diff
changeset
|
239 |
|
d892f6d66402
build documents in Isabelle/Scala, based on generated tex files as session exports;
wenzelm
parents:
72515
diff
changeset
|
240 |
In contrast, \<^verbatim>\<open>document_variants=document:outline=/proof,/ML\<close> indicates |
61575 | 241 |
two documents: the one called \<^verbatim>\<open>document\<close> with default tags, and the other |
242 |
called \<^verbatim>\<open>outline\<close> where proofs and ML sections are folded. |
|
51055 | 243 |
|
61575 | 244 |
Document variant names are just a matter of conventions. It is also |
245 |
possible to use different document variant names (without tags) for |
|
246 |
different document root entries, see also \secref{sec:tool-document}. |
|
51055 | 247 |
|
68513 | 248 |
\<^item> @{system_option_def "document_tags"} specifies alternative command tags |
249 |
as a comma-separated list of items: either ``\<open>command\<close>\<^verbatim>\<open>%\<close>\<open>tag\<close>'' for a |
|
250 |
specific command, or ``\<^verbatim>\<open>%\<close>\<open>tag\<close>'' as default for all other commands. This |
|
251 |
is occasionally useful to control the global visibility of commands via |
|
252 |
session options (e.g.\ in \<^verbatim>\<open>ROOT\<close>). |
|
67140 | 253 |
|
74873 | 254 |
\<^item> @{system_option_def "document_comment_latex"} enables regular {\LaTeX} |
255 |
\<^verbatim>\<open>comment.sty\<close>, instead of the historic version for plain {\TeX} |
|
256 |
(default). The latter is much faster, but in conflict with {\LaTeX} |
|
257 |
classes like Dagstuhl |
|
258 |
LIPIcs\<^footnote>\<open>\<^url>\<open>https://github.com/dagstuhl-publishing/styles\<close>\<close>. |
|
259 |
||
73743 | 260 |
\<^item> @{system_option_def "document_bibliography"} explicitly enables the use |
261 |
of \<^verbatim>\<open>bibtex\<close>; the default is to check the presence of \<^verbatim>\<open>root.bib\<close>, but it |
|
262 |
could have a different name. |
|
263 |
||
74873 | 264 |
\<^item> @{system_option_def "document_heading_prefix"} specifies a prefix for |
265 |
the {\LaTeX} macro names generated from Isar commands like \<^theory_text>\<open>chapter\<close>, |
|
266 |
\<^theory_text>\<open>section\<close> etc. The default is \<^verbatim>\<open>isamarkup\<close>, e.g. \<^theory_text>\<open>section\<close> becomes |
|
267 |
\<^verbatim>\<open>\isamarkupsection\<close>. |
|
268 |
||
61575 | 269 |
\<^item> @{system_option_def "threads"} determines the number of worker threads |
270 |
for parallel checking of theories and proofs. The default \<open>0\<close> means that a |
|
271 |
sensible maximum value is determined by the underlying hardware. For |
|
75161
95612f330c93
misc tuning based on comments by Heiko Eißfeldt;
wenzelm
parents:
74873
diff
changeset
|
272 |
machines with many cores or with hyperthreading, this sometimes requires |
61575 | 273 |
manual adjustment (on the command-line or within personal settings or |
274 |
preferences, not within a session \<^verbatim>\<open>ROOT\<close>). |
|
51055 | 275 |
|
61575 | 276 |
\<^item> @{system_option_def "condition"} specifies a comma-separated list of |
277 |
process environment variables (or Isabelle settings) that are required for |
|
278 |
the subsequent theories to be processed. Conditions are considered |
|
279 |
``true'' if the corresponding environment value is defined and non-empty. |
|
51055 | 280 |
|
61602 | 281 |
\<^item> @{system_option_def "timeout"} and @{system_option_def "timeout_scale"} |
282 |
specify a real wall-clock timeout for the session as a whole: the two |
|
283 |
values are multiplied and taken as the number of seconds. Typically, |
|
284 |
@{system_option "timeout"} is given for individual sessions, and |
|
285 |
@{system_option "timeout_scale"} as global adjustment to overall hardware |
|
286 |
performance. |
|
287 |
||
288 |
The timer is controlled outside the ML process by the JVM that runs |
|
289 |
Isabelle/Scala. Thus it is relatively reliable in canceling processes that |
|
290 |
get out of control, even if there is a deadlock without CPU time usage. |
|
51055 | 291 |
|
64308 | 292 |
\<^item> @{system_option_def "profiling"} specifies a mode for global ML |
293 |
profiling. Possible values are the empty string (disabled), \<^verbatim>\<open>time\<close> for |
|
69593 | 294 |
\<^ML>\<open>profile_time\<close> and \<^verbatim>\<open>allocations\<close> for \<^ML>\<open>profile_allocations\<close>. |
64308 | 295 |
Results appear near the bottom of the session log file. |
296 |
||
73777
52e43a93d51f
clarified system_log: make this work independently of the particular "isabelle build" command-line (e.g. "isabelle mirabelle");
wenzelm
parents:
73774
diff
changeset
|
297 |
\<^item> @{system_option_def system_log} specifies an optional log file for |
52e43a93d51f
clarified system_log: make this work independently of the particular "isabelle build" command-line (e.g. "isabelle mirabelle");
wenzelm
parents:
73774
diff
changeset
|
298 |
low-level messages produced by \<^ML>\<open>Output.system_message\<close> in |
74827
c1b5d6e6ff74
clarified system option standard values: avoid oddities like "isabelle build -o document_output" producing directories named "true";
wenzelm
parents:
74733
diff
changeset
|
299 |
Isabelle/ML; the standard value ``\<^verbatim>\<open>-\<close>'' refers to console progress of the |
c1b5d6e6ff74
clarified system option standard values: avoid oddities like "isabelle build -o document_output" producing directories named "true";
wenzelm
parents:
74733
diff
changeset
|
300 |
build job. |
73777
52e43a93d51f
clarified system_log: make this work independently of the particular "isabelle build" command-line (e.g. "isabelle mirabelle");
wenzelm
parents:
73774
diff
changeset
|
301 |
|
69854
cc0b3e177b49
system option "system_heaps" supersedes various command-line options for "system build mode";
wenzelm
parents:
69811
diff
changeset
|
302 |
\<^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
|
303 |
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
|
304 |
\<^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
|
305 |
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
|
306 |
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
|
307 |
\<^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
|
308 |
|
61575 | 309 |
The @{tool_def options} tool prints Isabelle system options. Its |
48693
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48684
diff
changeset
|
310 |
command-line usage is: |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
311 |
@{verbatim [display] |
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
312 |
\<open>Usage: isabelle options [OPTIONS] [MORE_OPTIONS ...] |
48693
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48684
diff
changeset
|
313 |
|
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48684
diff
changeset
|
314 |
Options are: |
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48684
diff
changeset
|
315 |
-b include $ISABELLE_BUILD_OPTIONS |
52735 | 316 |
-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
|
317 |
-l list options |
48693
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48684
diff
changeset
|
318 |
-x FILE export to FILE in YXML format |
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48684
diff
changeset
|
319 |
|
50531
f841ac0cb757
clarified "isabelle options" command line, to make it more close to "isabelle components";
wenzelm
parents:
50406
diff
changeset
|
320 |
Report Isabelle system options, augmented by MORE_OPTIONS given as |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
321 |
arguments NAME=VAL or NAME.\<close>} |
48693
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48684
diff
changeset
|
322 |
|
61575 | 323 |
The command line arguments provide additional system options of the form |
324 |
\<open>name\<close>\<^verbatim>\<open>=\<close>\<open>value\<close> or \<open>name\<close> for Boolean options. |
|
325 |
||
326 |
Option \<^verbatim>\<open>-b\<close> augments the implicit environment of system options by the ones |
|
327 |
of @{setting ISABELLE_BUILD_OPTIONS}, cf.\ \secref{sec:tool-build}. |
|
48693
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48684
diff
changeset
|
328 |
|
61575 | 329 |
Option \<^verbatim>\<open>-g\<close> prints the value of the given option. Option \<^verbatim>\<open>-l\<close> lists all |
330 |
options with their declaration and current value. |
|
48693
ceeea46bdeba
"isabelle options" prints Isabelle system options;
wenzelm
parents:
48684
diff
changeset
|
331 |
|
61575 | 332 |
Option \<^verbatim>\<open>-x\<close> specifies a file to export the result in YXML format, instead |
333 |
of printing it in human-readable form. |
|
58618 | 334 |
\<close> |
48578 | 335 |
|
336 |
||
58618 | 337 |
section \<open>Invoking the build process \label{sec:tool-build}\<close> |
48578 | 338 |
|
61575 | 339 |
text \<open> |
340 |
The @{tool_def build} tool invokes the build process for Isabelle sessions. |
|
341 |
It manages dependencies between sessions, related sources of theories and |
|
342 |
auxiliary files, and target heap images. Accordingly, it runs instances of |
|
343 |
the prover process with optional document preparation. Its command-line |
|
344 |
usage is:\<^footnote>\<open>Isabelle/Scala provides the same functionality via |
|
71896
ce06d6456cc8
clarified signature --- fit within limit of 22 arguments;
wenzelm
parents:
71893
diff
changeset
|
345 |
\<^scala_method>\<open>isabelle.Build.build\<close>.\<close> |
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 build [OPTIONS] [SESSIONS ...] |
48578 | 348 |
|
349 |
Options are: |
|
66737
2edc0c42c883
option -B for "isabelle build" and "isabelle imports";
wenzelm
parents:
66671
diff
changeset
|
350 |
-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
|
351 |
-D DIR include session directory and select its sessions |
64265 | 352 |
-N cyclic shuffling of NUMA CPU nodes (performance tuning) |
72648 | 353 |
-P DIR enable HTML/PDF presentation in directory (":" for default) |
71807 | 354 |
-R refer to requirements of selected sessions |
66745 | 355 |
-S soft build: only observe changes of sources, not heap images |
60106 | 356 |
-X NAME exclude sessions from group NAME and all descendants |
48578 | 357 |
-a select all sessions |
358 |
-b build heap images |
|
48595 | 359 |
-c clean build |
48737
f3bbb9ca57d6
added build option -D: include session directory and select its sessions;
wenzelm
parents:
48693
diff
changeset
|
360 |
-d DIR include session directory |
69811
18f61ce86425
clarified 'export_files' in session ROOT: require explicit "isabelle build -e";
wenzelm
parents:
69755
diff
changeset
|
361 |
-e export files from session specification into file-system |
66841 | 362 |
-f fresh build |
48578 | 363 |
-g NAME select session group NAME |
364 |
-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
|
365 |
-k KEYWORD check theory sources for conflicts with proposed keywords |
48903 | 366 |
-l list session source files |
48578 | 367 |
-n no build -- test dependencies only |
52056 | 368 |
-o OPTION override Isabelle system OPTION (via NAME=VAL or NAME) |
48578 | 369 |
-v verbose |
60106 | 370 |
-x NAME exclude session NAME and all descendants |
48578 | 371 |
|
62596 | 372 |
Build and manage Isabelle sessions, depending on implicit settings: |
373 |
||
71982 | 374 |
ISABELLE_TOOL_JAVA_OPTIONS="..." |
48578 | 375 |
ISABELLE_BUILD_OPTIONS="..." |
376 |
||
377 |
ML_PLATFORM="..." |
|
378 |
ML_HOME="..." |
|
379 |
ML_SYSTEM="..." |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
380 |
ML_OPTIONS="..."\<close>} |
48578 | 381 |
|
61406 | 382 |
\<^medskip> |
61575 | 383 |
Isabelle sessions are defined via session ROOT files as described in |
384 |
(\secref{sec:session-root}). The totality of sessions is determined by |
|
385 |
collecting such specifications from all Isabelle component directories |
|
386 |
(\secref{sec:components}), augmented by more directories given via options |
|
387 |
\<^verbatim>\<open>-d\<close>~\<open>DIR\<close> on the command line. Each such directory may contain a session |
|
61503 | 388 |
\<^verbatim>\<open>ROOT\<close> file with several session specifications. |
48578 | 389 |
|
61575 | 390 |
Any session root directory may refer recursively to further directories of |
391 |
the same kind, by listing them in a catalog file \<^verbatim>\<open>ROOTS\<close> line-by-line. This |
|
392 |
helps to organize large collections of session specifications, or to make |
|
66576 | 393 |
\<^verbatim>\<open>-d\<close> command line options persistent (e.g.\ in |
61503 | 394 |
\<^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
|
395 |
|
61406 | 396 |
\<^medskip> |
61575 | 397 |
The subset of sessions to be managed is determined via individual \<open>SESSIONS\<close> |
398 |
given as command-line arguments, or session groups that are given via one or |
|
399 |
more options \<^verbatim>\<open>-g\<close>~\<open>NAME\<close>. Option \<^verbatim>\<open>-a\<close> selects all sessions. The build tool |
|
400 |
takes session dependencies into account: the set of selected sessions is |
|
401 |
completed by including all ancestors. |
|
48578 | 402 |
|
61406 | 403 |
\<^medskip> |
68734
c14a2cc9b5ef
isabelle build options -c -x -B refer to imports_graph;
wenzelm
parents:
68523
diff
changeset
|
404 |
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
|
405 |
descendants wrt.\ the session parent or import graph). |
66737
2edc0c42c883
option -B for "isabelle build" and "isabelle imports";
wenzelm
parents:
66671
diff
changeset
|
406 |
|
2edc0c42c883
option -B for "isabelle build" and "isabelle imports";
wenzelm
parents:
66671
diff
changeset
|
407 |
\<^medskip> |
68734
c14a2cc9b5ef
isabelle build options -c -x -B refer to imports_graph;
wenzelm
parents:
68523
diff
changeset
|
408 |
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
|
409 |
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
|
410 |
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
|
411 |
membership. |
59892
2a616319c171
added isabelle build option -x, to exclude sessions;
wenzelm
parents:
59891
diff
changeset
|
412 |
|
61406 | 413 |
\<^medskip> |
61575 | 414 |
Option \<^verbatim>\<open>-R\<close> reverses the selection in the sense that it refers to its |
415 |
requirements: all ancestor sessions excluding the original selection. This |
|
416 |
allows to prepare the stage for some build process with different options, |
|
417 |
before running the main build itself (without option \<^verbatim>\<open>-R\<close>). |
|
49131 | 418 |
|
61406 | 419 |
\<^medskip> |
61575 | 420 |
Option \<^verbatim>\<open>-D\<close> is similar to \<^verbatim>\<open>-d\<close>, but selects all sessions that are defined |
421 |
in the given directories. |
|
48737
f3bbb9ca57d6
added build option -D: include session directory and select its sessions;
wenzelm
parents:
48693
diff
changeset
|
422 |
|
61406 | 423 |
\<^medskip> |
66745 | 424 |
Option \<^verbatim>\<open>-S\<close> indicates a ``soft build'': the selection is restricted to |
425 |
those sessions that have changed sources (according to actually imported |
|
426 |
theories). The status of heap images is ignored. |
|
427 |
||
428 |
\<^medskip> |
|
61406 | 429 |
The build process depends on additional options |
61575 | 430 |
(\secref{sec:system-options}) that are passed to the prover eventually. The |
431 |
settings variable @{setting_ref ISABELLE_BUILD_OPTIONS} allows to provide |
|
73826
72900f34dbb3
allow system option short form NAME for NAME=true for type string, not just bool;
wenzelm
parents:
73777
diff
changeset
|
432 |
additional defaults, e.g.\ \<^verbatim>\<open>ISABELLE_BUILD_OPTIONS="document=pdf |
72900f34dbb3
allow system option short form NAME for NAME=true for type string, not just bool;
wenzelm
parents:
73777
diff
changeset
|
433 |
threads=4"\<close>. Moreover, the environment of system build options may be |
72900f34dbb3
allow system option short form NAME for NAME=true for type string, not just bool;
wenzelm
parents:
73777
diff
changeset
|
434 |
augmented on the command line via \<^verbatim>\<open>-o\<close>~\<open>name\<close>\<^verbatim>\<open>=\<close>\<open>value\<close> or \<^verbatim>\<open>-o\<close>~\<open>name\<close>, |
72900f34dbb3
allow system option short form NAME for NAME=true for type string, not just bool;
wenzelm
parents:
73777
diff
changeset
|
435 |
which abbreviates \<^verbatim>\<open>-o\<close>~\<open>name\<close>\<^verbatim>\<open>=true\<close> for Boolean or string options. |
72900f34dbb3
allow system option short form NAME for NAME=true for type string, not just bool;
wenzelm
parents:
73777
diff
changeset
|
436 |
Multiple occurrences of \<^verbatim>\<open>-o\<close> on the command-line are applied in the given |
72900f34dbb3
allow system option short form NAME for NAME=true for type string, not just bool;
wenzelm
parents:
73777
diff
changeset
|
437 |
order. |
48578 | 438 |
|
61406 | 439 |
\<^medskip> |
72648 | 440 |
Option \<^verbatim>\<open>-P\<close> enables PDF/HTML presentation in the given directory, where |
441 |
``\<^verbatim>\<open>-P:\<close>'' refers to the default @{setting_ref ISABELLE_BROWSER_INFO} (or |
|
73012
238ddf525da4
clarified HTML presentation, e.g. avoid bulky jobs like HOL or HOL-Analysis in applications;
wenzelm
parents:
72878
diff
changeset
|
442 |
@{setting_ref ISABELLE_BROWSER_INFO_SYSTEM}). This applies only to |
75161
95612f330c93
misc tuning based on comments by Heiko Eißfeldt;
wenzelm
parents:
74873
diff
changeset
|
443 |
explicitly selected sessions; note that option \<^verbatim>\<open>-R\<close> allows to select all |
73012
238ddf525da4
clarified HTML presentation, e.g. avoid bulky jobs like HOL or HOL-Analysis in applications;
wenzelm
parents:
72878
diff
changeset
|
444 |
requirements separately. |
72648 | 445 |
|
446 |
\<^medskip> |
|
61575 | 447 |
Option \<^verbatim>\<open>-b\<close> ensures that heap images are produced for all selected |
448 |
sessions. By default, images are only saved for inner nodes of the hierarchy |
|
449 |
of sessions, as required for other sessions to continue later on. |
|
48578 | 450 |
|
61406 | 451 |
\<^medskip> |
68734
c14a2cc9b5ef
isabelle build options -c -x -B refer to imports_graph;
wenzelm
parents:
68523
diff
changeset
|
452 |
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
|
453 |
parent or import graph) before performing the specified build operation. |
48595 | 454 |
|
61406 | 455 |
\<^medskip> |
69811
18f61ce86425
clarified 'export_files' in session ROOT: require explicit "isabelle build -e";
wenzelm
parents:
69755
diff
changeset
|
456 |
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
|
457 |
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
|
458 |
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
|
459 |
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
|
460 |
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
|
461 |
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
|
462 |
file-system yet. |
18f61ce86425
clarified 'export_files' in session ROOT: require explicit "isabelle build -e";
wenzelm
parents:
69755
diff
changeset
|
463 |
|
18f61ce86425
clarified 'export_files' in session ROOT: require explicit "isabelle build -e";
wenzelm
parents:
69755
diff
changeset
|
464 |
\<^medskip> |
66841 | 465 |
Option \<^verbatim>\<open>-f\<close> forces a fresh build of all selected sessions and their |
466 |
requirements. |
|
467 |
||
468 |
\<^medskip> |
|
61575 | 469 |
Option \<^verbatim>\<open>-n\<close> omits the actual build process after the preparatory stage |
470 |
(including optional cleanup). Note that the return code always indicates the |
|
471 |
status of the set of selected sessions. |
|
48595 | 472 |
|
61406 | 473 |
\<^medskip> |
61575 | 474 |
Option \<^verbatim>\<open>-j\<close> specifies the maximum number of parallel build jobs (prover |
475 |
processes). Each prover process is subject to a separate limit of parallel |
|
476 |
worker threads, cf.\ system option @{system_option_ref threads}. |
|
48578 | 477 |
|
61406 | 478 |
\<^medskip> |
64265 | 479 |
Option \<^verbatim>\<open>-N\<close> enables cyclic shuffling of NUMA CPU nodes. This may help |
480 |
performance tuning on Linux servers with separate CPU/memory modules. |
|
481 |
||
482 |
\<^medskip> |
|
75161
95612f330c93
misc tuning based on comments by Heiko Eißfeldt;
wenzelm
parents:
74873
diff
changeset
|
483 |
Option \<^verbatim>\<open>-v\<close> increases the general level of verbosity. |
59891
9ce697050455
added isabelle build option -k, for fast off-line checking of theory sources;
wenzelm
parents:
59446
diff
changeset
|
484 |
|
61406 | 485 |
\<^medskip> |
75161
95612f330c93
misc tuning based on comments by Heiko Eißfeldt;
wenzelm
parents:
74873
diff
changeset
|
486 |
Option \<^verbatim>\<open>-l\<close> lists the source files that contribute to a session. |
95612f330c93
misc tuning based on comments by Heiko Eißfeldt;
wenzelm
parents:
74873
diff
changeset
|
487 |
|
95612f330c93
misc tuning based on comments by Heiko Eißfeldt;
wenzelm
parents:
74873
diff
changeset
|
488 |
\<^medskip> |
95612f330c93
misc tuning based on comments by Heiko Eißfeldt;
wenzelm
parents:
74873
diff
changeset
|
489 |
Option \<^verbatim>\<open>-k\<close> specifies a newly proposed keyword for outer syntax. It is |
95612f330c93
misc tuning based on comments by Heiko Eißfeldt;
wenzelm
parents:
74873
diff
changeset
|
490 |
possible to use option \<^verbatim>\<open>-k\<close> repeatedly to check multiple keywords. The |
95612f330c93
misc tuning based on comments by Heiko Eißfeldt;
wenzelm
parents:
74873
diff
changeset
|
491 |
theory sources are checked for conflicts wrt.\ this hypothetical change of |
95612f330c93
misc tuning based on comments by Heiko Eißfeldt;
wenzelm
parents:
74873
diff
changeset
|
492 |
syntax, e.g.\ to reveal occurrences of identifiers that need to be quoted. |
61575 | 493 |
\<close> |
59891
9ce697050455
added isabelle build option -k, for fast off-line checking of theory sources;
wenzelm
parents:
59446
diff
changeset
|
494 |
|
48578 | 495 |
|
58618 | 496 |
subsubsection \<open>Examples\<close> |
48578 | 497 |
|
58618 | 498 |
text \<open> |
48578 | 499 |
Build a specific logic image: |
75558 | 500 |
@{verbatim [display] \<open> isabelle build -b HOLCF\<close>} |
48578 | 501 |
|
61406 | 502 |
\<^smallskip> |
503 |
Build the main group of logic images: |
|
75558 | 504 |
@{verbatim [display] \<open> isabelle build -b -g main\<close>} |
48578 | 505 |
|
61406 | 506 |
\<^smallskip> |
66748 | 507 |
Build all descendants (and requirements) of \<^verbatim>\<open>FOL\<close> and \<^verbatim>\<open>ZF\<close>: |
75558 | 508 |
@{verbatim [display] \<open> isabelle build -B FOL -B ZF\<close>} |
66748 | 509 |
|
510 |
\<^smallskip> |
|
511 |
Build all sessions where sources have changed (ignoring heaps): |
|
75558 | 512 |
@{verbatim [display] \<open> isabelle build -a -S\<close>} |
66748 | 513 |
|
514 |
\<^smallskip> |
|
61575 | 515 |
Provide a general overview of the status of all Isabelle sessions, without |
516 |
building anything: |
|
75558 | 517 |
@{verbatim [display] \<open> isabelle build -a -n -v\<close>} |
48578 | 518 |
|
61406 | 519 |
\<^smallskip> |
61575 | 520 |
Build all sessions with HTML browser info and PDF document preparation: |
75558 | 521 |
@{verbatim [display] \<open> isabelle build -a -o browser_info -o document\<close>} |
48578 | 522 |
|
61406 | 523 |
\<^smallskip> |
61575 | 524 |
Build all sessions with a maximum of 8 parallel prover processes and 4 |
525 |
worker threads each (on a machine with many cores): |
|
75558 | 526 |
@{verbatim [display] \<open> isabelle build -a -j8 -o threads=4\<close>} |
48595 | 527 |
|
61406 | 528 |
\<^smallskip> |
61575 | 529 |
Build some session images with cleanup of their descendants, while retaining |
530 |
their ancestry: |
|
75558 | 531 |
@{verbatim [display] \<open> isabelle build -b -c HOL-Library HOL-Algebra\<close>} |
48595 | 532 |
|
61406 | 533 |
\<^smallskip> |
534 |
Clean all sessions without building anything: |
|
75558 | 535 |
@{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
|
536 |
|
61406 | 537 |
\<^smallskip> |
61575 | 538 |
Build all sessions from some other directory hierarchy, according to the |
539 |
settings variable \<^verbatim>\<open>AFP\<close> that happens to be defined inside the Isabelle |
|
540 |
environment: |
|
75558 | 541 |
@{verbatim [display] \<open> isabelle build -D '$AFP'\<close>} |
49131 | 542 |
|
61406 | 543 |
\<^smallskip> |
61575 | 544 |
Inform about the status of all sessions required for AFP, without building |
545 |
anything yet: |
|
75558 | 546 |
@{verbatim [display] \<open> isabelle build -D '$AFP' -R -v -n\<close>} |
58618 | 547 |
\<close> |
48578 | 548 |
|
66671 | 549 |
|
72876 | 550 |
section \<open>Print messages from build database \label{sec:tool-log}\<close> |
551 |
||
552 |
text \<open> |
|
553 |
The @{tool_def "log"} tool prints prover messages from the build |
|
554 |
database of the given session. Its command-line usage is: |
|
555 |
||
556 |
@{verbatim [display] |
|
76089 | 557 |
\<open>Usage: isabelle log [OPTIONS] [SESSIONS ...] |
72876 | 558 |
|
559 |
Options are: |
|
76089 | 560 |
-H REGEX filter messages by matching against head |
561 |
-M REGEX filter messages by matching against body |
|
72876 | 562 |
-T NAME restrict to given theories (multiple options possible) |
563 |
-U output Unicode symbols |
|
564 |
-m MARGIN margin for pretty printing (default: 76.0) |
|
565 |
-o OPTION override Isabelle system OPTION (via NAME=VAL or NAME) |
|
73837
f72335f6a9ed
clarified documentation: tracing messages are not shown here;
wenzelm
parents:
73826
diff
changeset
|
566 |
-v print all messages, including information etc. |
72876 | 567 |
|
76089 | 568 |
Print messages from the build database of the given sessions, without any |
569 |
checks against current sources nor session structure: results from old |
|
570 |
sessions or failed builds can be printed as well. |
|
72876 | 571 |
|
76089 | 572 |
Multiple options -H and -M are conjunctive: all given patterns need to |
573 |
match. Patterns match any substring, but ^ or $ may be used to match the |
|
574 |
start or end explicitly.\<close>} |
|
575 |
||
576 |
The specified session databases are taken as is, with formal checking |
|
577 |
against current sources: There is \<^emph>\<open>no\<close> implicit build process involved, so |
|
578 |
it is possible to retrieve error messages from a failed session as well. The |
|
579 |
order of messages follows the source positions of source files; thus the |
|
580 |
result is mostly deterministic, independent of the somewhat erratic |
|
581 |
evaluation of parallel processing. |
|
72876 | 582 |
|
583 |
\<^medskip> Option \<^verbatim>\<open>-o\<close> allows to change system options, as in @{tool build} |
|
584 |
(\secref{sec:tool-build}). This may affect the storage space for the build |
|
585 |
database, notably via @{system_option system_heaps}, or @{system_option |
|
586 |
build_database_server} and its relatives. |
|
587 |
||
588 |
\<^medskip> Option \<^verbatim>\<open>-T\<close> restricts output to given theories: multiple entries are |
|
589 |
possible by repeating this option on the command-line. The default is to |
|
75161
95612f330c93
misc tuning based on comments by Heiko Eißfeldt;
wenzelm
parents:
74873
diff
changeset
|
590 |
refer to \<^emph>\<open>all\<close> theories used in the original session build process. |
72876 | 591 |
|
592 |
\<^medskip> Options \<^verbatim>\<open>-m\<close> and \<^verbatim>\<open>-U\<close> modify pretty printing and output of Isabelle |
|
593 |
symbols. The default is for an old-fashioned ASCII terminal at 80 characters |
|
594 |
per line (76 + 4 characters to prefix warnings or errors). |
|
72878 | 595 |
|
73837
f72335f6a9ed
clarified documentation: tracing messages are not shown here;
wenzelm
parents:
73826
diff
changeset
|
596 |
\<^medskip> Option \<^verbatim>\<open>-v\<close> prints all messages from the session database that are |
f72335f6a9ed
clarified documentation: tracing messages are not shown here;
wenzelm
parents:
73826
diff
changeset
|
597 |
normally inlined into the source text, including information messages etc. |
76089 | 598 |
|
599 |
\<^medskip> Options \<^verbatim>\<open>-H\<close> and \<^verbatim>\<open>-M\<close> filter messages according to their header or body |
|
600 |
content, respectively. The header follows a very basic format that makes it |
|
601 |
easy to match message kinds (e.g. \<^verbatim>\<open>Warning\<close> or \<^verbatim>\<open>Error\<close>) and file names |
|
602 |
(e.g. \<^verbatim>\<open>src/HOL/Nat.thy\<close>). The body is usually pretty-printed, but for |
|
603 |
matching it is treated like one long line: blocks are ignored and breaks are |
|
604 |
turned into plain spaces (according to their formal width). |
|
605 |
||
606 |
The syntax for patters follows regular expressions of the Java |
|
607 |
platform.\<^footnote>\<open>\<^url>\<open>https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/regex/Pattern.html\<close>\<close> |
|
72876 | 608 |
\<close> |
609 |
||
610 |
subsubsection \<open>Examples\<close> |
|
611 |
||
612 |
text \<open> |
|
613 |
Print messages from theory \<^verbatim>\<open>HOL.Nat\<close> of session \<^verbatim>\<open>HOL\<close>, using Unicode |
|
614 |
rendering of Isabelle symbols and a margin of 100 characters: |
|
75558 | 615 |
@{verbatim [display] \<open> isabelle log -T HOL.Nat -U -m 100 HOL\<close>} |
76089 | 616 |
|
617 |
Print warnings about ambiguous input (inner syntax) of session |
|
618 |
\<^verbatim>\<open>HOL-Library\<close>, which is built beforehand: |
|
619 |
@{verbatim [display] \<open> isabelle build HOL-Library |
|
620 |
isabelle log -H "Warning" -M "Ambiguous input" HOL-Library\<close>} |
|
621 |
||
622 |
Print all errors from all sessions, e.g. from a partial build of |
|
623 |
Isabelle/AFP: |
|
624 |
@{verbatim [display] \<open> isabelle log -H "Error" $(isabelle sessions -a -d AFP/thys)\<close>} |
|
72876 | 625 |
\<close> |
626 |
||
627 |
||
68152
619de043389f
guard result exports via export_pattern -- avoid bombing client via huge blobs;
wenzelm
parents:
68116
diff
changeset
|
628 |
section \<open>Retrieve theory exports \label{sec:tool-export}\<close> |
68116 | 629 |
|
630 |
text \<open> |
|
631 |
The @{tool_def "export"} tool retrieves theory exports from the session |
|
632 |
database. Its command-line usage is: @{verbatim [display] |
|
633 |
\<open>Usage: isabelle export [OPTIONS] SESSION |
|
634 |
||
635 |
Options are: |
|
68314
2acbf8129d8b
clarified option -O: avoid conflict with build/dump option -D;
wenzelm
parents:
68292
diff
changeset
|
636 |
-O DIR output directory for exported files (default: "export") |
68116 | 637 |
-d DIR include session directory |
638 |
-l list exports |
|
639 |
-n no build of session |
|
640 |
-o OPTION override Isabelle system OPTION (via NAME=VAL or NAME) |
|
69671 | 641 |
-p NUM prune path of exported files by NUM elements |
75161
95612f330c93
misc tuning based on comments by Heiko Eißfeldt;
wenzelm
parents:
74873
diff
changeset
|
642 |
-x PATTERN extract files matching pattern (e.g. "*:**" for all) |
68116 | 643 |
|
644 |
List or export theory exports for SESSION: named blobs produced by |
|
68290 | 645 |
isabelle build. Option -l or -x is required; option -x may be repeated. |
68116 | 646 |
|
647 |
The PATTERN language resembles glob patterns in the shell, with ? and * |
|
648 |
(both excluding ":" and "/"), ** (excluding ":"), and [abc] or [^abc], |
|
649 |
and variants {pattern1,pattern2,pattern3}.\<close>} |
|
650 |
||
651 |
\<^medskip> |
|
652 |
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
|
653 |
(\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
|
654 |
\<^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
|
655 |
outdated session database is used! |
68116 | 656 |
|
657 |
\<^medskip> |
|
658 |
Option \<^verbatim>\<open>-l\<close> lists all stored exports, with compound names |
|
659 |
\<open>theory\<close>\<^verbatim>\<open>:\<close>\<open>name\<close>. |
|
660 |
||
661 |
\<^medskip> |
|
662 |
Option \<^verbatim>\<open>-x\<close> extracts stored exports whose compound name matches the given |
|
663 |
pattern. Note that wild cards ``\<^verbatim>\<open>?\<close>'' and ``\<^verbatim>\<open>*\<close>'' do not match the |
|
664 |
separators ``\<^verbatim>\<open>:\<close>'' and ``\<^verbatim>\<open>/\<close>''; the wild card \<^verbatim>\<open>**\<close> matches over directory |
|
665 |
name hierarchies separated by ``\<^verbatim>\<open>/\<close>''. Thus the pattern ``\<^verbatim>\<open>*:**\<close>'' matches |
|
68290 | 666 |
\<^emph>\<open>all\<close> theory exports. Multiple options \<^verbatim>\<open>-x\<close> refer to the union of all |
667 |
specified patterns. |
|
68116 | 668 |
|
68314
2acbf8129d8b
clarified option -O: avoid conflict with build/dump option -D;
wenzelm
parents:
68292
diff
changeset
|
669 |
Option \<^verbatim>\<open>-O\<close> specifies an alternative output directory for option \<^verbatim>\<open>-x\<close>: the |
68116 | 670 |
default is \<^verbatim>\<open>export\<close> within the current directory. Each theory creates its |
671 |
own sub-directory hierarchy, using the session-qualified theory name. |
|
69671 | 672 |
|
673 |
Option \<^verbatim>\<open>-p\<close> specifies the number of elements that should be pruned from |
|
674 |
each name: it allows to reduce the resulting directory hierarchy at the |
|
675 |
danger of overwriting files due to loss of uniqueness. |
|
68116 | 676 |
\<close> |
677 |
||
68348 | 678 |
|
679 |
section \<open>Dump PIDE session database \label{sec:tool-dump}\<close> |
|
680 |
||
681 |
text \<open> |
|
682 |
The @{tool_def "dump"} tool dumps information from the cumulative PIDE |
|
683 |
session database (which is processed on the spot). Its command-line usage |
|
684 |
is: @{verbatim [display] |
|
685 |
\<open>Usage: isabelle dump [OPTIONS] [SESSIONS ...] |
|
686 |
||
687 |
Options are: |
|
688 |
-A NAMES dump named aspects (default: ...) |
|
689 |
-B NAME include session NAME and all descendants |
|
690 |
-D DIR include session directory and select its sessions |
|
691 |
-O DIR output directory for dumped files (default: "dump") |
|
71807 | 692 |
-R refer to requirements of selected sessions |
68348 | 693 |
-X NAME exclude sessions from group NAME and all descendants |
694 |
-a select all sessions |
|
70862 | 695 |
-b NAME base logic image (default "Pure") |
68348 | 696 |
-d DIR include session directory |
697 |
-g NAME select session group NAME |
|
698 |
-o OPTION override Isabelle system OPTION (via NAME=VAL or NAME) |
|
699 |
-v verbose |
|
700 |
-x NAME exclude session NAME and all descendants |
|
701 |
||
702 |
Dump cumulative PIDE session database, with the following aspects: |
|
703 |
...\<close>} |
|
704 |
||
705 |
\<^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 |
|
706 |
remaining command-line arguments specify sessions as in @{tool build} |
|
707 |
(\secref{sec:tool-build}): the cumulative PIDE database of all their loaded |
|
708 |
theories is dumped to the output directory of option \<^verbatim>\<open>-O\<close> (default: \<^verbatim>\<open>dump\<close> |
|
709 |
in the current directory). |
|
710 |
||
70859
6e6254bbce1f
split into standard partitions, for improved scalability;
wenzelm
parents:
70858
diff
changeset
|
711 |
\<^medskip> Option \<^verbatim>\<open>-b\<close> specifies an optional base logic image, for improved |
70862 | 712 |
scalability of the PIDE session. Its theories are only processed if it is |
713 |
included in the overall session selection. |
|
70859
6e6254bbce1f
split into standard partitions, for improved scalability;
wenzelm
parents:
70858
diff
changeset
|
714 |
|
68348 | 715 |
\<^medskip> Option \<^verbatim>\<open>-o\<close> overrides Isabelle system options as for @{tool build} |
716 |
(\secref{sec:tool-build}). |
|
717 |
||
718 |
\<^medskip> Option \<^verbatim>\<open>-v\<close> increases the general level of verbosity. |
|
719 |
||
720 |
\<^medskip> Option \<^verbatim>\<open>-A\<close> specifies named aspects of the dump, as a comma-separated |
|
721 |
list. The default is to dump all known aspects, as given in the command-line |
|
71893 | 722 |
usage of the tool. The underlying Isabelle/Scala operation |
723 |
\<^scala_method>\<open>isabelle.Dump.dump\<close> takes aspects as user-defined |
|
724 |
operations on the final PIDE state and document version. This allows to |
|
725 |
imitate Prover IDE rendering under program control. |
|
68348 | 726 |
\<close> |
727 |
||
728 |
||
729 |
subsubsection \<open>Examples\<close> |
|
730 |
||
731 |
text \<open> |
|
732 |
Dump all Isabelle/ZF sessions (which are rather small): |
|
75558 | 733 |
@{verbatim [display] \<open> isabelle dump -v -B ZF\<close>} |
68348 | 734 |
|
735 |
\<^smallskip> |
|
70862 | 736 |
Dump the quite substantial \<^verbatim>\<open>HOL-Analysis\<close> session, with full bootstrap |
737 |
from Isabelle/Pure: |
|
75558 | 738 |
@{verbatim [display] \<open> isabelle dump -v HOL-Analysis\<close>} |
68348 | 739 |
|
740 |
\<^smallskip> |
|
70862 | 741 |
Dump all sessions connected to HOL-Analysis, using main Isabelle/HOL as |
742 |
basis: |
|
75558 | 743 |
@{verbatim [display] \<open> isabelle dump -v -b HOL -B HOL-Analysis\<close>} |
68348 | 744 |
|
745 |
This results in uniform PIDE markup for everything, except for the |
|
746 |
Isabelle/Pure bootstrap process itself. Producing that on the spot requires |
|
747 |
several GB of heap space, both for the Isabelle/Scala and Isabelle/ML |
|
748 |
process (in 64bit mode). Here are some relevant settings (\secref{sec:boot}) |
|
749 |
for such ambitious applications: |
|
750 |
@{verbatim [display] |
|
75558 | 751 |
\<open> ISABELLE_TOOL_JAVA_OPTIONS="-Xms4g -Xmx32g -Xss16m" |
752 |
ML_OPTIONS="--minheap 4G --maxheap 32G" |
|
68348 | 753 |
\<close>} |
69599 | 754 |
\<close> |
68348 | 755 |
|
69599 | 756 |
|
757 |
section \<open>Update theory sources based on PIDE markup \label{sec:tool-update}\<close> |
|
758 |
||
759 |
text \<open> |
|
760 |
The @{tool_def "update"} tool updates theory sources based on markup that is |
|
761 |
produced from a running PIDE session (similar to @{tool dump} |
|
762 |
\secref{sec:tool-dump}). Its command-line usage is: @{verbatim [display] |
|
763 |
\<open>Usage: isabelle update [OPTIONS] [SESSIONS ...] |
|
764 |
||
765 |
Options are: |
|
766 |
-B NAME include session NAME and all descendants |
|
767 |
-D DIR include session directory and select its sessions |
|
71807 | 768 |
-R refer to requirements of selected sessions |
69599 | 769 |
-X NAME exclude sessions from group NAME and all descendants |
770 |
-a select all sessions |
|
70863
d1299774543d
clarified "isabelle update" options -- more like "isabelle dump";
wenzelm
parents:
70862
diff
changeset
|
771 |
-b NAME base logic image (default "Pure") |
69599 | 772 |
-d DIR include session directory |
773 |
-g NAME select session group NAME |
|
774 |
-o OPTION override Isabelle system OPTION (via NAME=VAL or NAME) |
|
75161
95612f330c93
misc tuning based on comments by Heiko Eißfeldt;
wenzelm
parents:
74873
diff
changeset
|
775 |
-u OPT override "update" option: shortcut for "-o update_OPT" |
69599 | 776 |
-v verbose |
777 |
-x NAME exclude session NAME and all descendants |
|
778 |
||
779 |
Update theory sources based on PIDE markup.\<close>} |
|
780 |
||
781 |
\<^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 |
|
782 |
remaining command-line arguments specify sessions as in @{tool build} |
|
783 |
(\secref{sec:tool-build}) or @{tool dump} (\secref{sec:tool-dump}). |
|
784 |
||
70863
d1299774543d
clarified "isabelle update" options -- more like "isabelle dump";
wenzelm
parents:
70862
diff
changeset
|
785 |
\<^medskip> Option \<^verbatim>\<open>-b\<close> specifies an optional base logic image, for improved |
d1299774543d
clarified "isabelle update" options -- more like "isabelle dump";
wenzelm
parents:
70862
diff
changeset
|
786 |
scalability of the PIDE session. Its theories are only processed if it is |
d1299774543d
clarified "isabelle update" options -- more like "isabelle dump";
wenzelm
parents:
70862
diff
changeset
|
787 |
included in the overall session selection. |
69599 | 788 |
|
789 |
\<^medskip> Option \<^verbatim>\<open>-v\<close> increases the general level of verbosity. |
|
790 |
||
791 |
\<^medskip> Option \<^verbatim>\<open>-o\<close> overrides Isabelle system options as for @{tool build} |
|
792 |
(\secref{sec:tool-build}). Option \<^verbatim>\<open>-u\<close> refers to specific \<^verbatim>\<open>update\<close> |
|
793 |
options, by relying on naming convention: ``\<^verbatim>\<open>-u\<close>~\<open>OPT\<close>'' is a shortcut for |
|
794 |
``\<^verbatim>\<open>-o\<close>~\<^verbatim>\<open>update_\<close>\<open>OPT\<close>''. |
|
795 |
||
75161
95612f330c93
misc tuning based on comments by Heiko Eißfeldt;
wenzelm
parents:
74873
diff
changeset
|
796 |
\<^medskip> The following \<^verbatim>\<open>update\<close> options are supported: |
69599 | 797 |
|
798 |
\<^item> @{system_option update_inner_syntax_cartouches} to update inner syntax |
|
799 |
(types, terms, etc.)~to use cartouches, instead of double-quoted strings |
|
800 |
or atomic identifiers. For example, ``\<^theory_text>\<open>lemma \<doublequote>x = |
|
69610 | 801 |
x\<doublequote>\<close>'' is replaced by ``\<^theory_text>\<open>lemma \<open>x = x\<close>\<close>'', and ``\<^theory_text>\<open>assume |
802 |
A\<close>'' is replaced by ``\<^theory_text>\<open>assume \<open>A\<close>\<close>''. |
|
69599 | 803 |
|
804 |
\<^item> @{system_option update_mixfix_cartouches} to update mixfix templates to |
|
805 |
use cartouches instead of double-quoted strings. For example, ``\<^theory_text>\<open>(infixl |
|
806 |
\<doublequote>+\<doublequote> 65)\<close>'' is replaced by ``\<^theory_text>\<open>(infixl \<open>+\<close> |
|
807 |
65)\<close>''. |
|
808 |
||
809 |
\<^item> @{system_option update_control_cartouches} to update antiquotations to |
|
810 |
use the compact form with control symbol and cartouche argument. For |
|
811 |
example, ``\<open>@{term \<doublequote>x + y\<doublequote>}\<close>'' is replaced by |
|
812 |
``\<open>\<^term>\<open>x + y\<close>\<close>'' (the control symbol is literally \<^verbatim>\<open>\<^term>\<close>.) |
|
813 |
||
69603 | 814 |
\<^item> @{system_option update_path_cartouches} to update file-system paths to |
815 |
use cartouches: this depends on language markup provided by semantic |
|
816 |
processing of parsed input. |
|
817 |
||
69599 | 818 |
It is also possible to produce custom updates in Isabelle/ML, by reporting |
819 |
\<^ML>\<open>Markup.update\<close> with the precise source position and a replacement |
|
820 |
text. This operation should be made conditional on specific system options, |
|
821 |
similar to the ones above. Searching the above option names in ML sources of |
|
822 |
\<^dir>\<open>$ISABELLE_HOME/src/Pure\<close> provides some examples. |
|
823 |
||
69602 | 824 |
Updates can be in conflict by producing nested or overlapping edits: this |
825 |
may require to run @{tool update} multiple times. |
|
69599 | 826 |
\<close> |
827 |
||
828 |
||
829 |
subsubsection \<open>Examples\<close> |
|
830 |
||
831 |
text \<open> |
|
832 |
Update some cartouche notation in all theory sources required for session |
|
70863
d1299774543d
clarified "isabelle update" options -- more like "isabelle dump";
wenzelm
parents:
70862
diff
changeset
|
833 |
\<^verbatim>\<open>HOL-Analysis\<close> (and ancestors): |
69599 | 834 |
|
75558 | 835 |
@{verbatim [display] \<open> isabelle update -u mixfix_cartouches HOL-Analysis\<close>} |
69599 | 836 |
|
837 |
\<^smallskip> Update the same for all application sessions based on \<^verbatim>\<open>HOL-Analysis\<close> --- |
|
75161
95612f330c93
misc tuning based on comments by Heiko Eißfeldt;
wenzelm
parents:
74873
diff
changeset
|
838 |
using its image as starting point (for reduced resource requirements): |
69599 | 839 |
|
75558 | 840 |
@{verbatim [display] \<open> isabelle update -u mixfix_cartouches -b HOL-Analysis -B HOL-Analysis\<close>} |
69599 | 841 |
|
842 |
\<^smallskip> Update sessions that build on \<^verbatim>\<open>HOL-Proofs\<close>, which need to be run |
|
843 |
separately with special options as follows: |
|
844 |
||
75558 | 845 |
@{verbatim [display] \<open> isabelle update -u mixfix_cartouches -l HOL-Proofs -B HOL-Proofs |
69601 | 846 |
-o record_proofs=2\<close>} |
69599 | 847 |
|
848 |
\<^smallskip> See also the end of \secref{sec:tool-dump} for hints on increasing |
|
849 |
Isabelle/ML heap sizes for very big PIDE processes that include many |
|
850 |
sessions, notably from the Archive of Formal Proofs. |
|
68348 | 851 |
\<close> |
852 |
||
71808 | 853 |
|
854 |
section \<open>Explore sessions structure\<close> |
|
855 |
||
856 |
text \<open> |
|
857 |
The @{tool_def "sessions"} tool explores the sessions structure. Its |
|
858 |
command-line usage is: |
|
859 |
@{verbatim [display] |
|
860 |
\<open>Usage: isabelle sessions [OPTIONS] [SESSIONS ...] |
|
861 |
||
862 |
Options are: |
|
863 |
-B NAME include session NAME and all descendants |
|
864 |
-D DIR include session directory and select its sessions |
|
865 |
-R refer to requirements of selected sessions |
|
866 |
-X NAME exclude sessions from group NAME and all descendants |
|
867 |
-a select all sessions |
|
76107 | 868 |
-b follow session build dependencies (default: source imports) |
71808 | 869 |
-d DIR include session directory |
870 |
-g NAME select session group NAME |
|
871 |
-x NAME exclude session NAME and all descendants |
|
872 |
||
873 |
Explore the structure of Isabelle sessions and print result names in |
|
874 |
topological order (on stdout).\<close>} |
|
875 |
||
876 |
Arguments and options for session selection resemble @{tool build} |
|
877 |
(\secref{sec:tool-build}). |
|
878 |
\<close> |
|
879 |
||
880 |
||
881 |
subsubsection \<open>Examples\<close> |
|
882 |
||
883 |
text \<open> |
|
884 |
All sessions of the Isabelle distribution: |
|
75558 | 885 |
@{verbatim [display] \<open> isabelle sessions -a\<close>} |
71808 | 886 |
|
887 |
\<^medskip> |
|
76107 | 888 |
Sessions that are imported by \<^verbatim>\<open>ZF\<close>: |
889 |
@{verbatim [display] \<open> isabelle sessions ZF\<close>} |
|
890 |
||
891 |
\<^medskip> |
|
892 |
Sessions that are required to build \<^verbatim>\<open>ZF\<close>: |
|
893 |
@{verbatim [display] \<open> isabelle sessions -b ZF\<close>} |
|
894 |
||
895 |
\<^medskip> |
|
896 |
Sessions that are based on \<^verbatim>\<open>ZF\<close> (and imported by it): |
|
75558 | 897 |
@{verbatim [display] \<open> isabelle sessions -B ZF\<close>} |
71808 | 898 |
|
899 |
\<^medskip> |
|
900 |
All sessions of Isabelle/AFP (based in directory \<^path>\<open>AFP\<close>): |
|
75558 | 901 |
@{verbatim [display] \<open> isabelle sessions -D AFP/thys\<close>} |
71808 | 902 |
|
903 |
\<^medskip> |
|
904 |
Sessions required by Isabelle/AFP (based in directory \<^path>\<open>AFP\<close>): |
|
75558 | 905 |
@{verbatim [display] \<open> isabelle sessions -R -D AFP/thys\<close>} |
71808 | 906 |
\<close> |
907 |
||
75556 | 908 |
|
909 |
section \<open>Synchronize source repositories and session images for Isabelle and AFP\<close> |
|
910 |
||
911 |
text \<open> |
|
75557 | 912 |
The @{tool_def sync} tool synchronizes a local Isabelle and AFP source |
913 |
repository, possibly with prebuilt \<^verbatim>\<open>.jar\<close> files and session images. Its |
|
914 |
command-line usage is: @{verbatim [display] |
|
75556 | 915 |
\<open>Usage: isabelle sync [OPTIONS] TARGET |
916 |
||
917 |
Options are: |
|
918 |
-A ROOT include AFP with given root directory (":" for $AFP_BASE) |
|
919 |
-H purge heaps directory on target |
|
920 |
-I NAME include session heap image and build database |
|
921 |
(based on accidental local state) |
|
922 |
-J preserve *.jar files |
|
923 |
-S robust (but less portable) treatment of spaces in |
|
924 |
file and directory names on the target |
|
925 |
-T thorough treatment of file content and directory times |
|
926 |
-a REV explicit AFP revision (default: state of working directory) |
|
927 |
-n no changes: dry-run |
|
928 |
-r REV explicit revision (default: state of working directory) |
|
929 |
-p PORT explicit SSH port (default: 22) |
|
930 |
-v verbose |
|
931 |
||
932 |
Synchronize Isabelle + AFP repositories, based on "isabelle hg_sync".\<close>} |
|
933 |
||
75557 | 934 |
The approach is to apply @{tool hg_sync} (see \secref{sec:tool-hg-sync}) on |
935 |
the underlying Isabelle repository, and an optional AFP repository. |
|
936 |
Consequently, the Isabelle installation needs to be a Mercurial repository |
|
75556 | 937 |
clone: a regular download of the Isabelle distribution is not sufficient! |
938 |
||
939 |
On the target side, AFP is placed into @{setting ISABELLE_HOME} as immediate |
|
940 |
sub-directory with the literal name \<^verbatim>\<open>AFP\<close>; thus it can be easily included |
|
941 |
elsewhere, e.g. @{tool build}~\<^verbatim>\<open>-d\<close>~\<^verbatim>\<open>'~~/AFP'\<close> on the remote side. |
|
942 |
||
75559
5340239ff468
clarified options of "isabelle hg_sync" vs. "isabelle sync";
wenzelm
parents:
75558
diff
changeset
|
943 |
\<^medskip> Options \<^verbatim>\<open>-S\<close>, \<^verbatim>\<open>-T\<close>, \<^verbatim>\<open>-n\<close>, \<^verbatim>\<open>-p\<close>, \<^verbatim>\<open>-v\<close> are the same as the underlying |
75556 | 944 |
@{tool hg_sync}. |
945 |
||
946 |
\<^medskip> Options \<^verbatim>\<open>-r\<close> and \<^verbatim>\<open>-a\<close> are the same as option \<^verbatim>\<open>-r\<close> for @{tool hg_sync}, |
|
947 |
but for the Isabelle and AFP repositories, respectively. The AFP version is |
|
948 |
only used if a corresponding repository is given via option \<^verbatim>\<open>-A\<close>, either |
|
949 |
with explicit root directory, or as \<^verbatim>\<open>-A:\<close> to refer to \<^verbatim>\<open>$AFP_BASE\<close> (this |
|
75557 | 950 |
assumes AFP as component of the local Isabelle installation). If no AFP |
951 |
repository is given, an existing \<^verbatim>\<open>AFP\<close> directory on the target remains |
|
952 |
unchanged. |
|
75556 | 953 |
|
75557 | 954 |
\<^medskip> Option \<^verbatim>\<open>-J\<close> uploads existing \<^verbatim>\<open>.jar\<close> files from the working directory, |
955 |
which are usually Isabelle/Scala/Java modules under control of @{tool |
|
956 |
scala_build} via \<^verbatim>\<open>etc/build.props\<close> (see also \secref{sec:scala-build}). |
|
957 |
Thus the dependency management is accurate: bad uploads will be rebuilt |
|
958 |
eventually (or ignored). This might fail for very old Isabelle versions, |
|
959 |
when going into the past via option \<^verbatim>\<open>-r\<close>: here it is better to omit option |
|
960 |
\<^verbatim>\<open>-J\<close> and thus purge \<^verbatim>\<open>.jar\<close> files on the target (because they do not belong |
|
961 |
to the repository). |
|
75556 | 962 |
|
963 |
\<^medskip> Option \<^verbatim>\<open>-I\<close> uploads a collection of session images. The set of \<^verbatim>\<open>-I\<close> |
|
964 |
options specifies the end-points in the session build graph, including all |
|
965 |
required ancestors. The result collection is uploaded using the underlying |
|
75557 | 966 |
\<^verbatim>\<open>rsync\<close> policies, so unchanged images are not sent again. Session images |
967 |
are assembled within the target \<^verbatim>\<open>heaps\<close> directory: this scheme fits |
|
968 |
together with @{tool build}~\<^verbatim>\<open>-o system_heaps\<close>. Images are taken as-is from |
|
969 |
the local Isabelle installation, regardless of option \<^verbatim>\<open>-r\<close>. Upload of bad |
|
970 |
images could waste time and space, but running e.g. @{tool build} on the |
|
971 |
target will check dependencies accurately and rebuild outdated images on |
|
972 |
demand. |
|
75556 | 973 |
|
974 |
\<^medskip> Option \<^verbatim>\<open>-H\<close> tells the underlying \<^verbatim>\<open>rsync\<close> process to purge the \<^verbatim>\<open>heaps\<close> |
|
75557 | 975 |
directory on the target, before uploading new images via option \<^verbatim>\<open>-I\<close>. The |
75556 | 976 |
default is to work monotonically: old material that is not overwritten |
75557 | 977 |
remains unchanged. Over time, this may lead to unused garbage, due to |
978 |
changes in session names or the Poly/ML version. Option \<^verbatim>\<open>-H\<close> helps to avoid |
|
979 |
wasting file-system space. |
|
75556 | 980 |
\<close> |
981 |
||
982 |
subsubsection \<open>Examples\<close> |
|
983 |
||
984 |
text \<open> |
|
75557 | 985 |
For quick testing of Isabelle + AFP on a remote machine, upload changed |
986 |
sources, jars, and local sessions images for \<^verbatim>\<open>HOL\<close>: |
|
987 |
||
75556 | 988 |
@{verbatim [display] \<open> isabelle sync -A: -I HOL -J testmachine:test/isabelle_afp\<close>} |
989 |
Assuming that the local \<^verbatim>\<open>HOL\<close> hierarchy has been up-to-date, and the local |
|
990 |
and remote ML platforms coincide, a remote @{tool build} will proceed |
|
991 |
without building \<^verbatim>\<open>HOL\<close> again. |
|
992 |
||
75557 | 993 |
\<^medskip> Here is a variation for extra-clean testing of Isabelle + AFP: no option |
994 |
\<^verbatim>\<open>-J\<close>, but option \<^verbatim>\<open>-T\<close> to disable the default ``quick check'' of \<^verbatim>\<open>rsync\<close> |
|
995 |
(which only inspects file sizes and date stamps); existing heaps are |
|
996 |
deleted: |
|
75558 | 997 |
@{verbatim [display] \<open> isabelle sync -A: -T -H testmachine:test/isabelle_afp\<close>} |
75556 | 998 |
\<close> |
999 |
||
48578 | 1000 |
end |