src/Doc/System/Sessions.thy
author wenzelm
Mon, 14 Oct 2019 19:14:03 +0200
changeset 70861 cb07f21c9916
parent 70859 6e6254bbce1f
child 70862 a4ccd277e9c4
permissions -rw-r--r--
simplified options: always split;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
61656
cfabbc083977 more uniform jEdit properties;
wenzelm
parents: 61602
diff changeset
     1
(*:maxLineLen=78:*)
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
     2
48578
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
     3
theory Sessions
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
     4
imports Base
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
     5
begin
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
     6
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
     7
chapter \<open>Isabelle sessions and build management \label{ch:session}\<close>
48584
8026c852cc10 some introduction on sessions;
wenzelm
parents: 48582
diff changeset
     8
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
     9
text \<open>
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    10
  An Isabelle \<^emph>\<open>session\<close> consists of a collection of related theories that may
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    11
  be associated with formal documents (\chref{ch:present}). There is also a
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    12
  notion of \<^emph>\<open>persistent heap\<close> image to capture the state of a session,
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    13
  similar to object-code in compiled programming languages. Thus the concept
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    14
  of session resembles that of a ``project'' in common IDE environments, but
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    15
  the specific name emphasizes the connection to interactive theorem proving:
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    16
  the session wraps-up the results of user-interaction with the prover in a
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    17
  persistent form.
48584
8026c852cc10 some introduction on sessions;
wenzelm
parents: 48582
diff changeset
    18
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    19
  Application sessions are built on a given parent session, which may be built
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    20
  recursively on other parents. Following this path in the hierarchy
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    21
  eventually leads to some major object-logic session like \<open>HOL\<close>, which itself
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    22
  is based on \<open>Pure\<close> as the common root of all sessions.
48584
8026c852cc10 some introduction on sessions;
wenzelm
parents: 48582
diff changeset
    23
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    24
  Processing sessions may take considerable time. Isabelle build management
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    25
  helps to organize this efficiently. This includes support for parallel build
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    26
  jobs, in addition to the multithreaded theory and proof checking that is
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    27
  already provided by the prover process itself.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    28
\<close>
48604
f651323139f0 misc tuning;
wenzelm
parents: 48602
diff changeset
    29
48578
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
    30
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
    31
section \<open>Session ROOT specifications \label{sec:session-root}\<close>
48578
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
    32
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    33
text \<open>
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    34
  Session specifications reside in files called \<^verbatim>\<open>ROOT\<close> within certain
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    35
  directories, such as the home locations of registered Isabelle components or
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    36
  additional project directories given by the user.
48579
0b95a13ed90a more on "Session ROOT specifications";
wenzelm
parents: 48578
diff changeset
    37
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    38
  The ROOT file format follows the lexical conventions of the \<^emph>\<open>outer syntax\<close>
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    39
  of Isabelle/Isar, see also @{cite "isabelle-isar-ref"}. This defines common
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    40
  forms like identifiers, names, quoted strings, verbatim text, nested
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    41
  comments etc. The grammar for @{syntax session_chapter} and @{syntax
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    42
  session_entry} is given as syntax diagram below; each ROOT file may contain
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    43
  multiple specifications like this. Chapters help to organize browser info
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    44
  (\secref{sec:info}), but have no formal meaning. The default chapter is
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    45
  ``\<open>Unsorted\<close>''.
48579
0b95a13ed90a more on "Session ROOT specifications";
wenzelm
parents: 48578
diff changeset
    46
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    47
  Isabelle/jEdit @{cite "isabelle-jedit"} includes a simple editing mode
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    48
  \<^verbatim>\<open>isabelle-root\<close> for session ROOT files, which is enabled by default for any
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    49
  file of that name.
48579
0b95a13ed90a more on "Session ROOT specifications";
wenzelm
parents: 48578
diff changeset
    50
69593
3dda49e08b9d isabelle update -u control_cartouches;
wenzelm
parents: 68808
diff changeset
    51
  \<^rail>\<open>
51417
d266f9329368 sessions may be organized via 'chapter' in ROOT;
wenzelm
parents: 51055
diff changeset
    52
    @{syntax_def session_chapter}: @'chapter' @{syntax name}
d266f9329368 sessions may be organized via 'chapter' in ROOT;
wenzelm
parents: 51055
diff changeset
    53
    ;
d266f9329368 sessions may be organized via 'chapter' in ROOT;
wenzelm
parents: 51055
diff changeset
    54
66971
43b2aac6053c tuned diagram;
wenzelm
parents: 66970
diff changeset
    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
0b95a13ed90a more on "Session ROOT specifications";
wenzelm
parents: 48578
diff changeset
    59
    ;
0b95a13ed90a more on "Session ROOT specifications";
wenzelm
parents: 48578
diff changeset
    60
    groups: '(' (@{syntax name} +) ')'
0b95a13ed90a more on "Session ROOT specifications";
wenzelm
parents: 48578
diff changeset
    61
    ;
68808
5467858e9419 more uniform cartouche syntax;
wenzelm
parents: 68734
diff changeset
    62
    dir: @'in' @{syntax embedded}
48579
0b95a13ed90a more on "Session ROOT specifications";
wenzelm
parents: 48578
diff changeset
    63
    ;
0b95a13ed90a more on "Session ROOT specifications";
wenzelm
parents: 48578
diff changeset
    64
    description: @'description' @{syntax text}
0b95a13ed90a more on "Session ROOT specifications";
wenzelm
parents: 48578
diff changeset
    65
    ;
0b95a13ed90a more on "Session ROOT specifications";
wenzelm
parents: 48578
diff changeset
    66
    options: @'options' opts
0b95a13ed90a more on "Session ROOT specifications";
wenzelm
parents: 48578
diff changeset
    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
0b95a13ed90a more on "Session ROOT specifications";
wenzelm
parents: 48578
diff changeset
    71
    ;
66916
aca50a1572c5 more documentation;
wenzelm
parents: 66851
diff changeset
    72
    sessions: @'sessions' (@{syntax system_name}+)
65374
a5b38d8d3c1e tuned syntax;
wenzelm
parents: 64308
diff changeset
    73
    ;
70681
a6c0f2d106c8 disallow overlapping session directories;
wenzelm
parents: 70678
diff changeset
    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
0b95a13ed90a more on "Session ROOT specifications";
wenzelm
parents: 48578
diff changeset
    77
    ;
66916
aca50a1572c5 more documentation;
wenzelm
parents: 66851
diff changeset
    78
    theory_entry: @{syntax system_name} ('(' @'global' ')')?
65504
b80477da30eb some documentation;
wenzelm
parents: 65374
diff changeset
    79
    ;
68808
5467858e9419 more uniform cartouche syntax;
wenzelm
parents: 68734
diff changeset
    80
    document_files: @'document_files' ('(' dir ')')? (@{syntax embedded}+)
68292
7ca0c23179e6 support 'export_files' in session ROOT;
wenzelm
parents: 68290
diff changeset
    81
    ;
69671
2486792eaf61 support pruning of export names;
wenzelm
parents: 69610
diff changeset
    82
    export_files: @'export_files' ('(' dir ')')? ('[' nat ']')? \<newline>
2486792eaf61 support pruning of export names;
wenzelm
parents: 69610
diff changeset
    83
      (@{syntax embedded}+)
69593
3dda49e08b9d isabelle update -u control_cartouches;
wenzelm
parents: 68808
diff changeset
    84
  \<close>
48579
0b95a13ed90a more on "Session ROOT specifications";
wenzelm
parents: 48578
diff changeset
    85
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    86
  \<^descr> \isakeyword{session}~\<open>A = B + body\<close> defines a new session \<open>A\<close> based on
66759
918f15c9367a discontinued obsolete 'files' in session ROOT;
wenzelm
parents: 66748
diff changeset
    87
  parent session \<open>B\<close>, with its content given in \<open>body\<close> (imported sessions and
918f15c9367a discontinued obsolete 'files' in session ROOT;
wenzelm
parents: 66748
diff changeset
    88
  theories). Note that a parent (like \<open>HOL\<close>) is mandatory in practical
918f15c9367a discontinued obsolete 'files' in session ROOT;
wenzelm
parents: 66748
diff changeset
    89
  applications: only Isabelle/Pure can bootstrap itself from nothing.
48579
0b95a13ed90a more on "Session ROOT specifications";
wenzelm
parents: 48578
diff changeset
    90
65504
b80477da30eb some documentation;
wenzelm
parents: 65374
diff changeset
    91
  All such session specifications together describe a hierarchy (graph) of
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    92
  sessions, with globally unique names. The new session name \<open>A\<close> should be
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    93
  sufficiently long and descriptive to stand on its own in a potentially large
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    94
  library.
48579
0b95a13ed90a more on "Session ROOT specifications";
wenzelm
parents: 48578
diff changeset
    95
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    96
  \<^descr> \isakeyword{session}~\<open>A (groups)\<close> indicates a collection of groups where
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    97
  the new session is a member. Group names are uninterpreted and merely follow
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    98
  certain conventions. For example, the Isabelle distribution tags some
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    99
  important sessions by the group name called ``\<open>main\<close>''. Other projects may
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   100
  invent their own conventions, but this requires some care to avoid clashes
48604
f651323139f0 misc tuning;
wenzelm
parents: 48602
diff changeset
   101
  within this unchecked name space.
48579
0b95a13ed90a more on "Session ROOT specifications";
wenzelm
parents: 48578
diff changeset
   102
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   103
  \<^descr> \isakeyword{session}~\<open>A\<close>~\isakeyword{in}~\<open>dir\<close> specifies an explicit
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   104
  directory for this session; by default this is the current directory of the
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   105
  \<^verbatim>\<open>ROOT\<close> file.
48579
0b95a13ed90a more on "Session ROOT specifications";
wenzelm
parents: 48578
diff changeset
   106
66759
918f15c9367a discontinued obsolete 'files' in session ROOT;
wenzelm
parents: 66748
diff changeset
   107
  All theory files are located relatively to the session directory. The prover
918f15c9367a discontinued obsolete 'files' in session ROOT;
wenzelm
parents: 66748
diff changeset
   108
  process is run within the same as its current working directory.
48579
0b95a13ed90a more on "Session ROOT specifications";
wenzelm
parents: 48578
diff changeset
   109
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   110
  \<^descr> \isakeyword{description}~\<open>text\<close> is a free-form annotation for this
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   111
  session.
48579
0b95a13ed90a more on "Session ROOT specifications";
wenzelm
parents: 48578
diff changeset
   112
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   113
  \<^descr> \isakeyword{options}~\<open>[x = a, y = b, z]\<close> defines separate options
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   114
  (\secref{sec:system-options}) that are used when processing this session,
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   115
  but \<^emph>\<open>without\<close> propagation to child sessions. Note that \<open>z\<close> abbreviates \<open>z =
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   116
  true\<close> for Boolean options.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   117
65504
b80477da30eb some documentation;
wenzelm
parents: 65374
diff changeset
   118
  \<^descr> \isakeyword{sessions}~\<open>names\<close> specifies sessions that are \<^emph>\<open>imported\<close> into
b80477da30eb some documentation;
wenzelm
parents: 65374
diff changeset
   119
  the current name space of theories. This allows to refer to a theory \<open>A\<close>
b80477da30eb some documentation;
wenzelm
parents: 65374
diff changeset
   120
  from session \<open>B\<close> by the qualified name \<open>B.A\<close> --- although it is loaded again
b80477da30eb some documentation;
wenzelm
parents: 65374
diff changeset
   121
  into the current ML process, which is in contrast to a theory that is
b80477da30eb some documentation;
wenzelm
parents: 65374
diff changeset
   122
  already present in the \<^emph>\<open>parent\<close> session.
b80477da30eb some documentation;
wenzelm
parents: 65374
diff changeset
   123
65505
741fad555d82 exclude theories from other sessions;
wenzelm
parents: 65504
diff changeset
   124
  Theories that are imported from other sessions are excluded from the current
741fad555d82 exclude theories from other sessions;
wenzelm
parents: 65504
diff changeset
   125
  session document.
741fad555d82 exclude theories from other sessions;
wenzelm
parents: 65504
diff changeset
   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
a6c0f2d106c8 disallow overlapping session directories;
wenzelm
parents: 70678
diff changeset
   131
  directories need to be exclusively assigned to a unique session, without
a6c0f2d106c8 disallow overlapping session directories;
wenzelm
parents: 70678
diff changeset
   132
  implicit sharing of file-system locations.
70678
36c8c32346cb clarified syntax: 'directories' and 'theories' belong together;
wenzelm
parents: 70677
diff changeset
   133
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   134
  \<^descr> \isakeyword{theories}~\<open>options names\<close> specifies a block of theories that
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   135
  are processed within an environment that is augmented by the given options,
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   136
  in addition to the global session options given before. Any number of blocks
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   137
  of \isakeyword{theories} may be given. Options are only active for each
48604
f651323139f0 misc tuning;
wenzelm
parents: 48602
diff changeset
   138
  \isakeyword{theories} block separately.
48579
0b95a13ed90a more on "Session ROOT specifications";
wenzelm
parents: 48578
diff changeset
   139
65374
a5b38d8d3c1e tuned syntax;
wenzelm
parents: 64308
diff changeset
   140
  A theory name that is followed by \<open>(\<close>\isakeyword{global}\<open>)\<close> is treated
66993
2c2a346cfe70 clarified situation of global theory names;
wenzelm
parents: 66971
diff changeset
   141
  literally in other session specifications or theory imports --- the normal
2c2a346cfe70 clarified situation of global theory names;
wenzelm
parents: 66971
diff changeset
   142
  situation is to qualify theory names by the session name; this ensures
2c2a346cfe70 clarified situation of global theory names;
wenzelm
parents: 66971
diff changeset
   143
  globally unique names in big session graphs. Global theories are usually the
2c2a346cfe70 clarified situation of global theory names;
wenzelm
parents: 66971
diff changeset
   144
  entry points to major logic sessions: \<open>Pure\<close>, \<open>Main\<close>, \<open>Complex_Main\<close>,
2c2a346cfe70 clarified situation of global theory names;
wenzelm
parents: 66971
diff changeset
   145
  \<open>HOLCF\<close>, \<open>IFOL\<close>, \<open>FOL\<close>, \<open>ZF\<close>, \<open>ZFC\<close> etc. Regular Isabelle applications
2c2a346cfe70 clarified situation of global theory names;
wenzelm
parents: 66971
diff changeset
   146
  should not claim any global theory names.
65374
a5b38d8d3c1e tuned syntax;
wenzelm
parents: 64308
diff changeset
   147
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   148
  \<^descr> \isakeyword{document_files}~\<open>(\<close>\isakeyword{in}~\<open>base_dir) files\<close> lists
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   149
  source files for document preparation, typically \<^verbatim>\<open>.tex\<close> and \<^verbatim>\<open>.sty\<close> for
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   150
  {\LaTeX}. Only these explicitly given files are copied from the base
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   151
  directory to the document output directory, before formal document
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   152
  processing is started (see also \secref{sec:tool-document}). The local path
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   153
  structure of the \<open>files\<close> is preserved, which allows to reconstruct the
68292
7ca0c23179e6 support 'export_files' in session ROOT;
wenzelm
parents: 68290
diff changeset
   154
  original directory hierarchy of \<open>base_dir\<close>. The default \<open>base_dir\<close> is
7ca0c23179e6 support 'export_files' in session ROOT;
wenzelm
parents: 68290
diff changeset
   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
2486792eaf61 support pruning of export names;
wenzelm
parents: 69610
diff changeset
   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
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   166
\<close>
48579
0b95a13ed90a more on "Session ROOT specifications";
wenzelm
parents: 48578
diff changeset
   167
51055
5c4be88f8747 some explanations of important build options;
wenzelm
parents: 50546
diff changeset
   168
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   169
subsubsection \<open>Examples\<close>
48580
9df76dd45900 some description of main build options;
wenzelm
parents: 48579
diff changeset
   170
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   171
text \<open>
63680
6e1e8b5abbfa more symbols;
wenzelm
parents: 63669
diff changeset
   172
  See \<^file>\<open>~~/src/HOL/ROOT\<close> for a diversity of practically relevant situations,
6e1e8b5abbfa more symbols;
wenzelm
parents: 63669
diff changeset
   173
  although it uses relatively complex quasi-hierarchic naming conventions like
6e1e8b5abbfa more symbols;
wenzelm
parents: 63669
diff changeset
   174
  \<^verbatim>\<open>HOL-SPARK\<close>, \<^verbatim>\<open>HOL-SPARK-Examples\<close>. An alternative is to use unqualified
6e1e8b5abbfa more symbols;
wenzelm
parents: 63669
diff changeset
   175
  names that are relatively long and descriptive, as in the Archive of Formal
67605
3dd0dfe04fcb corrected some URLs
Lars Hupel <lars.hupel@mytum.de>
parents: 67140
diff changeset
   176
  Proofs (\<^url>\<open>https://isa-afp.org\<close>), for example.
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   177
\<close>
48578
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   178
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   179
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   180
section \<open>System build options \label{sec:system-options}\<close>
48578
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   181
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   182
text \<open>
63680
6e1e8b5abbfa more symbols;
wenzelm
parents: 63669
diff changeset
   183
  See \<^file>\<open>~~/etc/options\<close> for the main defaults provided by the Isabelle
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   184
  distribution. Isabelle/jEdit @{cite "isabelle-jedit"} includes a simple
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   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
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   187
  The following options are particularly relevant to build Isabelle sessions,
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   188
  in particular with document preparation (\chref{ch:present}).
51055
5c4be88f8747 some explanations of important build options;
wenzelm
parents: 50546
diff changeset
   189
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   190
    \<^item> @{system_option_def "browser_info"} controls output of HTML browser
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   191
    info, see also \secref{sec:info}.
51055
5c4be88f8747 some explanations of important build options;
wenzelm
parents: 50546
diff changeset
   192
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   193
    \<^item> @{system_option_def "document"} specifies the document output format,
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   194
    see @{tool document} option \<^verbatim>\<open>-o\<close> in \secref{sec:tool-document}. In
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   195
    practice, the most relevant values are \<^verbatim>\<open>document=false\<close> or
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   196
    \<^verbatim>\<open>document=pdf\<close>.
51055
5c4be88f8747 some explanations of important build options;
wenzelm
parents: 50546
diff changeset
   197
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   198
    \<^item> @{system_option_def "document_output"} specifies an alternative
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   199
    directory for generated output of the document preparation system; the
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   200
    default is within the @{setting "ISABELLE_BROWSER_INFO"} hierarchy as
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   201
    explained in \secref{sec:info}. See also @{tool mkroot}, which generates a
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   202
    default configuration with output readily available to the author of the
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   203
    document.
51055
5c4be88f8747 some explanations of important build options;
wenzelm
parents: 50546
diff changeset
   204
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   205
    \<^item> @{system_option_def "document_variants"} specifies document variants as
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   206
    a colon-separated list of \<open>name=tags\<close> entries, corresponding to @{tool
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   207
    document} options \<^verbatim>\<open>-n\<close> and \<^verbatim>\<open>-t\<close>.
51055
5c4be88f8747 some explanations of important build options;
wenzelm
parents: 50546
diff changeset
   208
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   209
    For example, \<^verbatim>\<open>document_variants=document:outline=/proof,/ML\<close> indicates
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   210
    two documents: the one called \<^verbatim>\<open>document\<close> with default tags, and the other
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   211
    called \<^verbatim>\<open>outline\<close> where proofs and ML sections are folded.
51055
5c4be88f8747 some explanations of important build options;
wenzelm
parents: 50546
diff changeset
   212
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   213
    Document variant names are just a matter of conventions. It is also
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   214
    possible to use different document variant names (without tags) for
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   215
    different document root entries, see also \secref{sec:tool-document}.
51055
5c4be88f8747 some explanations of important build options;
wenzelm
parents: 50546
diff changeset
   216
68513
88b0e63d58a5 updated documentation;
wenzelm
parents: 68348
diff changeset
   217
    \<^item> @{system_option_def "document_tags"} specifies alternative command tags
88b0e63d58a5 updated documentation;
wenzelm
parents: 68348
diff changeset
   218
    as a comma-separated list of items: either ``\<open>command\<close>\<^verbatim>\<open>%\<close>\<open>tag\<close>'' for a
88b0e63d58a5 updated documentation;
wenzelm
parents: 68348
diff changeset
   219
    specific command, or ``\<^verbatim>\<open>%\<close>\<open>tag\<close>'' as default for all other commands. This
88b0e63d58a5 updated documentation;
wenzelm
parents: 68348
diff changeset
   220
    is occasionally useful to control the global visibility of commands via
88b0e63d58a5 updated documentation;
wenzelm
parents: 68348
diff changeset
   221
    session options (e.g.\ in \<^verbatim>\<open>ROOT\<close>).
67140
386a31d6d17a more documentation;
wenzelm
parents: 66993
diff changeset
   222
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   223
    \<^item> @{system_option_def "threads"} determines the number of worker threads
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   224
    for parallel checking of theories and proofs. The default \<open>0\<close> means that a
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   225
    sensible maximum value is determined by the underlying hardware. For
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   226
    machines with many cores or with hyperthreading, this is often requires
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   227
    manual adjustment (on the command-line or within personal settings or
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   228
    preferences, not within a session \<^verbatim>\<open>ROOT\<close>).
51055
5c4be88f8747 some explanations of important build options;
wenzelm
parents: 50546
diff changeset
   229
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   230
    \<^item> @{system_option_def "condition"} specifies a comma-separated list of
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   231
    process environment variables (or Isabelle settings) that are required for
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   232
    the subsequent theories to be processed. Conditions are considered
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   233
    ``true'' if the corresponding environment value is defined and non-empty.
51055
5c4be88f8747 some explanations of important build options;
wenzelm
parents: 50546
diff changeset
   234
61602
a2f0f659a3c2 added option timeout_scale;
wenzelm
parents: 61575
diff changeset
   235
    \<^item> @{system_option_def "timeout"} and @{system_option_def "timeout_scale"}
a2f0f659a3c2 added option timeout_scale;
wenzelm
parents: 61575
diff changeset
   236
    specify a real wall-clock timeout for the session as a whole: the two
a2f0f659a3c2 added option timeout_scale;
wenzelm
parents: 61575
diff changeset
   237
    values are multiplied and taken as the number of seconds. Typically,
a2f0f659a3c2 added option timeout_scale;
wenzelm
parents: 61575
diff changeset
   238
    @{system_option "timeout"} is given for individual sessions, and
a2f0f659a3c2 added option timeout_scale;
wenzelm
parents: 61575
diff changeset
   239
    @{system_option "timeout_scale"} as global adjustment to overall hardware
a2f0f659a3c2 added option timeout_scale;
wenzelm
parents: 61575
diff changeset
   240
    performance.
a2f0f659a3c2 added option timeout_scale;
wenzelm
parents: 61575
diff changeset
   241
a2f0f659a3c2 added option timeout_scale;
wenzelm
parents: 61575
diff changeset
   242
    The timer is controlled outside the ML process by the JVM that runs
a2f0f659a3c2 added option timeout_scale;
wenzelm
parents: 61575
diff changeset
   243
    Isabelle/Scala. Thus it is relatively reliable in canceling processes that
a2f0f659a3c2 added option timeout_scale;
wenzelm
parents: 61575
diff changeset
   244
    get out of control, even if there is a deadlock without CPU time usage.
51055
5c4be88f8747 some explanations of important build options;
wenzelm
parents: 50546
diff changeset
   245
64308
b00508facb4f added system option "profiling";
wenzelm
parents: 64265
diff changeset
   246
    \<^item> @{system_option_def "profiling"} specifies a mode for global ML
b00508facb4f added system option "profiling";
wenzelm
parents: 64265
diff changeset
   247
    profiling. Possible values are the empty string (disabled), \<^verbatim>\<open>time\<close> for
69593
3dda49e08b9d isabelle update -u control_cartouches;
wenzelm
parents: 68808
diff changeset
   248
    \<^ML>\<open>profile_time\<close> and \<^verbatim>\<open>allocations\<close> for \<^ML>\<open>profile_allocations\<close>.
64308
b00508facb4f added system option "profiling";
wenzelm
parents: 64265
diff changeset
   249
    Results appear near the bottom of the session log file.
b00508facb4f added system option "profiling";
wenzelm
parents: 64265
diff changeset
   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
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   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
842b5e7dcac8 support isabelle options -g;
wenzelm
parents: 52056
diff changeset
   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
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   272
  The command line arguments provide additional system options of the form
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   273
  \<open>name\<close>\<^verbatim>\<open>=\<close>\<open>value\<close> or \<open>name\<close> for Boolean options.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   274
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   275
  Option \<^verbatim>\<open>-b\<close> augments the implicit environment of system options by the ones
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   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
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   278
  Option \<^verbatim>\<open>-g\<close> prints the value of the given option. Option \<^verbatim>\<open>-l\<close> lists all
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   279
  options with their declaration and current value.
48693
ceeea46bdeba "isabelle options" prints Isabelle system options;
wenzelm
parents: 48684
diff changeset
   280
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   281
  Option \<^verbatim>\<open>-x\<close> specifies a file to export the result in YXML format, instead
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   282
  of printing it in human-readable form.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   283
\<close>
48578
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   284
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   285
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   286
section \<open>Invoking the build process \label{sec:tool-build}\<close>
48578
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   287
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   288
text \<open>
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   289
  The @{tool_def build} tool invokes the build process for Isabelle sessions.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   290
  It manages dependencies between sessions, related sources of theories and
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   291
  auxiliary files, and target heap images. Accordingly, it runs instances of
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   292
  the prover process with optional document preparation. Its command-line
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   293
  usage is:\<^footnote>\<open>Isabelle/Scala provides the same functionality via
61572
ddb3ac3fef45 more antiquotations;
wenzelm
parents: 61568
diff changeset
   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
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   297
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   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
8eb6365f5916 isabelle build -N;
wenzelm
parents: 63827
diff changeset
   301
    -N           cyclic shuffling of NUMA CPU nodes (performance tuning)
49131
aa1e2ba3c697 added build option -R;
wenzelm
parents: 48985
diff changeset
   302
    -R           operate on requirements of selected sessions
66745
e7ac579b883c option -S for "isabelle build";
wenzelm
parents: 66737
diff changeset
   303
    -S           soft build: only observe changes of sources, not heap images
60106
e0d1d9203275 allow to exclude session groups;
wenzelm
parents: 59892
diff changeset
   304
    -X NAME      exclude sessions from group NAME and all descendants
48578
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   305
    -a           select all sessions
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   306
    -b           build heap images
48595
231e6fa96dbb added build option -c;
wenzelm
parents: 48594
diff changeset
   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
5c32a072ca8b added isablle build option -f;
wenzelm
parents: 66759
diff changeset
   310
    -f           fresh build
48578
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   311
    -g NAME      select session group NAME
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   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
1621b3f26095 added build option -l (list files);
wenzelm
parents: 48814
diff changeset
   314
    -l           list session source files
48578
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   315
    -n           no build -- test dependencies only
52056
fc458f304f93 added isabelle-process option -o;
wenzelm
parents: 51417
diff changeset
   316
    -o OPTION    override Isabelle system OPTION (via NAME=VAL or NAME)
48578
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   317
    -v           verbose
60106
e0d1d9203275 allow to exclude session groups;
wenzelm
parents: 59892
diff changeset
   318
    -x NAME      exclude session NAME and all descendants
48578
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   319
62596
cf79f8866bc3 tuned messages;
wenzelm
parents: 62289
diff changeset
   320
  Build and manage Isabelle sessions, depending on implicit settings:
cf79f8866bc3 tuned messages;
wenzelm
parents: 62289
diff changeset
   321
48578
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   322
  ISABELLE_BUILD_OPTIONS="..."
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   323
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   324
  ML_PLATFORM="..."
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   325
  ML_HOME="..."
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   326
  ML_SYSTEM="..."
61407
7ba7b8103565 @{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents: 61406
diff changeset
   327
  ML_OPTIONS="..."\<close>}
48578
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   328
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 60106
diff changeset
   329
  \<^medskip>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   330
  Isabelle sessions are defined via session ROOT files as described in
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   331
  (\secref{sec:session-root}). The totality of sessions is determined by
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   332
  collecting such specifications from all Isabelle component directories
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   333
  (\secref{sec:components}), augmented by more directories given via options
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   334
  \<^verbatim>\<open>-d\<close>~\<open>DIR\<close> on the command line. Each such directory may contain a session
61503
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
   335
  \<^verbatim>\<open>ROOT\<close> file with several session specifications.
48578
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   336
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   337
  Any session root directory may refer recursively to further directories of
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   338
  the same kind, by listing them in a catalog file \<^verbatim>\<open>ROOTS\<close> line-by-line. This
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   339
  helps to organize large collections of session specifications, or to make
66576
wenzelm
parents: 65505
diff changeset
   340
  \<^verbatim>\<open>-d\<close> command line options persistent (e.g.\ in
61503
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
   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
eb2463fc4d7b more symbols;
wenzelm
parents: 60106
diff changeset
   343
  \<^medskip>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   344
  The subset of sessions to be managed is determined via individual \<open>SESSIONS\<close>
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   345
  given as command-line arguments, or session groups that are given via one or
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   346
  more options \<^verbatim>\<open>-g\<close>~\<open>NAME\<close>. Option \<^verbatim>\<open>-a\<close> selects all sessions. The build tool
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   347
  takes session dependencies into account: the set of selected sessions is
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   348
  completed by including all ancestors.
48578
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   349
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 60106
diff changeset
   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
eb2463fc4d7b more symbols;
wenzelm
parents: 60106
diff changeset
   360
  \<^medskip>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   361
  Option \<^verbatim>\<open>-R\<close> reverses the selection in the sense that it refers to its
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   362
  requirements: all ancestor sessions excluding the original selection. This
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   363
  allows to prepare the stage for some build process with different options,
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   364
  before running the main build itself (without option \<^verbatim>\<open>-R\<close>).
49131
aa1e2ba3c697 added build option -R;
wenzelm
parents: 48985
diff changeset
   365
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 60106
diff changeset
   366
  \<^medskip>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   367
  Option \<^verbatim>\<open>-D\<close> is similar to \<^verbatim>\<open>-d\<close>, but selects all sessions that are defined
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   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
eb2463fc4d7b more symbols;
wenzelm
parents: 60106
diff changeset
   370
  \<^medskip>
66745
e7ac579b883c option -S for "isabelle build";
wenzelm
parents: 66737
diff changeset
   371
  Option \<^verbatim>\<open>-S\<close> indicates a ``soft build'': the selection is restricted to
e7ac579b883c option -S for "isabelle build";
wenzelm
parents: 66737
diff changeset
   372
  those sessions that have changed sources (according to actually imported
e7ac579b883c option -S for "isabelle build";
wenzelm
parents: 66737
diff changeset
   373
  theories). The status of heap images is ignored.
e7ac579b883c option -S for "isabelle build";
wenzelm
parents: 66737
diff changeset
   374
e7ac579b883c option -S for "isabelle build";
wenzelm
parents: 66737
diff changeset
   375
  \<^medskip>
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 60106
diff changeset
   376
  The build process depends on additional options
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   377
  (\secref{sec:system-options}) that are passed to the prover eventually. The
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   378
  settings variable @{setting_ref ISABELLE_BUILD_OPTIONS} allows to provide
61602
a2f0f659a3c2 added option timeout_scale;
wenzelm
parents: 61575
diff changeset
   379
  additional defaults, e.g.\ \<^verbatim>\<open>ISABELLE_BUILD_OPTIONS="document=pdf threads=4"\<close>.
a2f0f659a3c2 added option timeout_scale;
wenzelm
parents: 61575
diff changeset
   380
  Moreover, the environment of system build options may be augmented on the
a2f0f659a3c2 added option timeout_scale;
wenzelm
parents: 61575
diff changeset
   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
a2f0f659a3c2 added option timeout_scale;
wenzelm
parents: 61575
diff changeset
   382
  \<^verbatim>\<open>-o\<close>~\<open>name\<close>\<^verbatim>\<open>=true\<close> for Boolean options. Multiple occurrences of \<^verbatim>\<open>-o\<close> on
a2f0f659a3c2 added option timeout_scale;
wenzelm
parents: 61575
diff changeset
   383
  the command-line are applied in the given order.
48578
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   384
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 60106
diff changeset
   385
  \<^medskip>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   386
  Option \<^verbatim>\<open>-b\<close> ensures that heap images are produced for all selected
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   387
  sessions. By default, images are only saved for inner nodes of the hierarchy
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   388
  of sessions, as required for other sessions to continue later on.
48578
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   389
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 60106
diff changeset
   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
231e6fa96dbb added build option -c;
wenzelm
parents: 48594
diff changeset
   393
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 60106
diff changeset
   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
5c32a072ca8b added isablle build option -f;
wenzelm
parents: 66759
diff changeset
   404
  Option \<^verbatim>\<open>-f\<close> forces a fresh build of all selected sessions and their
5c32a072ca8b added isablle build option -f;
wenzelm
parents: 66759
diff changeset
   405
  requirements.
5c32a072ca8b added isablle build option -f;
wenzelm
parents: 66759
diff changeset
   406
5c32a072ca8b added isablle build option -f;
wenzelm
parents: 66759
diff changeset
   407
  \<^medskip>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   408
  Option \<^verbatim>\<open>-n\<close> omits the actual build process after the preparatory stage
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   409
  (including optional cleanup). Note that the return code always indicates the
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   410
  status of the set of selected sessions.
48595
231e6fa96dbb added build option -c;
wenzelm
parents: 48594
diff changeset
   411
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 60106
diff changeset
   412
  \<^medskip>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   413
  Option \<^verbatim>\<open>-j\<close> specifies the maximum number of parallel build jobs (prover
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   414
  processes). Each prover process is subject to a separate limit of parallel
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   415
  worker threads, cf.\ system option @{system_option_ref threads}.
48578
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   416
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 60106
diff changeset
   417
  \<^medskip>
64265
8eb6365f5916 isabelle build -N;
wenzelm
parents: 63827
diff changeset
   418
  Option \<^verbatim>\<open>-N\<close> enables cyclic shuffling of NUMA CPU nodes. This may help
8eb6365f5916 isabelle build -N;
wenzelm
parents: 63827
diff changeset
   419
  performance tuning on Linux servers with separate CPU/memory modules.
8eb6365f5916 isabelle build -N;
wenzelm
parents: 63827
diff changeset
   420
8eb6365f5916 isabelle build -N;
wenzelm
parents: 63827
diff changeset
   421
  \<^medskip>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   422
  Option \<^verbatim>\<open>-v\<close> increases the general level of verbosity. Option \<^verbatim>\<open>-l\<close> lists
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   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
eb2463fc4d7b more symbols;
wenzelm
parents: 60106
diff changeset
   425
  \<^medskip>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   426
  Option \<^verbatim>\<open>-k\<close> specifies a newly proposed keyword for outer syntax (multiple
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   427
  uses allowed). The theory sources are checked for conflicts wrt.\ this
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   428
  hypothetical change of syntax, e.g.\ to reveal occurrences of identifiers
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   429
  that need to be quoted.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   430
\<close>
59891
9ce697050455 added isabelle build option -k, for fast off-line checking of theory sources;
wenzelm
parents: 59446
diff changeset
   431
48578
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   432
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   433
subsubsection \<open>Examples\<close>
48578
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   434
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   435
text \<open>
48578
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   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
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   438
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 60106
diff changeset
   439
  \<^smallskip>
eb2463fc4d7b more symbols;
wenzelm
parents: 60106
diff changeset
   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
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   442
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 60106
diff changeset
   443
  \<^smallskip>
66748
3efac90a11a7 more documentation;
wenzelm
parents: 66745
diff changeset
   444
  Build all descendants (and requirements) of \<^verbatim>\<open>FOL\<close> and \<^verbatim>\<open>ZF\<close>:
3efac90a11a7 more documentation;
wenzelm
parents: 66745
diff changeset
   445
  @{verbatim [display] \<open>isabelle build -B FOL -B ZF\<close>}
3efac90a11a7 more documentation;
wenzelm
parents: 66745
diff changeset
   446
3efac90a11a7 more documentation;
wenzelm
parents: 66745
diff changeset
   447
  \<^smallskip>
3efac90a11a7 more documentation;
wenzelm
parents: 66745
diff changeset
   448
  Build all sessions where sources have changed (ignoring heaps):
3efac90a11a7 more documentation;
wenzelm
parents: 66745
diff changeset
   449
  @{verbatim [display] \<open>isabelle build -a -S\<close>}
3efac90a11a7 more documentation;
wenzelm
parents: 66745
diff changeset
   450
3efac90a11a7 more documentation;
wenzelm
parents: 66745
diff changeset
   451
  \<^smallskip>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   452
  Provide a general overview of the status of all Isabelle sessions, without
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   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
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   455
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 60106
diff changeset
   456
  \<^smallskip>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   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
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   459
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 60106
diff changeset
   460
  \<^smallskip>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   461
  Build all sessions with a maximum of 8 parallel prover processes and 4
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   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
231e6fa96dbb added build option -c;
wenzelm
parents: 48594
diff changeset
   464
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 60106
diff changeset
   465
  \<^smallskip>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   466
  Build some session images with cleanup of their descendants, while retaining
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   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
231e6fa96dbb added build option -c;
wenzelm
parents: 48594
diff changeset
   469
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 60106
diff changeset
   470
  \<^smallskip>
eb2463fc4d7b more symbols;
wenzelm
parents: 60106
diff changeset
   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
eb2463fc4d7b more symbols;
wenzelm
parents: 60106
diff changeset
   474
  \<^smallskip>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   475
  Build all sessions from some other directory hierarchy, according to the
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   476
  settings variable \<^verbatim>\<open>AFP\<close> that happens to be defined inside the Isabelle
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   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
aa1e2ba3c697 added build option -R;
wenzelm
parents: 48985
diff changeset
   479
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 60106
diff changeset
   480
  \<^smallskip>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   481
  Inform about the status of all sessions required for AFP, without building
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   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
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   484
\<close>
48578
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   485
66671
41b64e53b6a1 more documentation;
wenzelm
parents: 66576
diff changeset
   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
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   488
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   489
text \<open>
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   490
  The @{tool_def "export"} tool retrieves theory exports from the session
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   491
  database. Its command-line usage is: @{verbatim [display]
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   492
\<open>Usage: isabelle export [OPTIONS] SESSION
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   493
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   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
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   496
    -d DIR       include session directory
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   497
    -l           list exports
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   498
    -n           no build of session
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   499
    -o OPTION    override Isabelle system OPTION (via NAME=VAL or NAME)
69671
2486792eaf61 support pruning of export names;
wenzelm
parents: 69610
diff changeset
   500
    -p NUM       prune path of exported files by NUM elements
68514
wenzelm
parents: 68513
diff changeset
   501
    -x PATTERN   extract files matching pattern (e.g.\ "*:**" for all)
68116
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   502
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   503
  List or export theory exports for SESSION: named blobs produced by
68290
f1f5ccc85b25 support multiple patterns;
wenzelm
parents: 68219
diff changeset
   504
  isabelle build. Option -l or -x is required; option -x may be repeated.
68116
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   505
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   506
  The PATTERN language resembles glob patterns in the shell, with ? and *
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   507
  (both excluding ":" and "/"), ** (excluding ":"), and [abc] or [^abc],
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   508
  and variants {pattern1,pattern2,pattern3}.\<close>}
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   509
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   510
  \<^medskip>
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   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
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   515
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   516
  \<^medskip>
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   517
  Option \<^verbatim>\<open>-l\<close> lists all stored exports, with compound names
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   518
  \<open>theory\<close>\<^verbatim>\<open>:\<close>\<open>name\<close>.
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   519
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   520
  \<^medskip>
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   521
  Option \<^verbatim>\<open>-x\<close> extracts stored exports whose compound name matches the given
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   522
  pattern. Note that wild cards ``\<^verbatim>\<open>?\<close>'' and ``\<^verbatim>\<open>*\<close>'' do not match the
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   523
  separators ``\<^verbatim>\<open>:\<close>'' and ``\<^verbatim>\<open>/\<close>''; the wild card \<^verbatim>\<open>**\<close> matches over directory
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   524
  name hierarchies separated by ``\<^verbatim>\<open>/\<close>''. Thus the pattern ``\<^verbatim>\<open>*:**\<close>'' matches
68290
f1f5ccc85b25 support multiple patterns;
wenzelm
parents: 68219
diff changeset
   525
  \<^emph>\<open>all\<close> theory exports. Multiple options \<^verbatim>\<open>-x\<close> refer to the union of all
f1f5ccc85b25 support multiple patterns;
wenzelm
parents: 68219
diff changeset
   526
  specified patterns.
68116
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   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
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   529
  default is \<^verbatim>\<open>export\<close> within the current directory. Each theory creates its
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   530
  own sub-directory hierarchy, using the session-qualified theory name.
69671
2486792eaf61 support pruning of export names;
wenzelm
parents: 69610
diff changeset
   531
2486792eaf61 support pruning of export names;
wenzelm
parents: 69610
diff changeset
   532
  Option \<^verbatim>\<open>-p\<close> specifies the number of elements that should be pruned from
2486792eaf61 support pruning of export names;
wenzelm
parents: 69610
diff changeset
   533
  each name: it allows to reduce the resulting directory hierarchy at the
2486792eaf61 support pruning of export names;
wenzelm
parents: 69610
diff changeset
   534
  danger of overwriting files due to loss of uniqueness.
68116
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   535
\<close>
ac82ee617a75 command-line tool "isabelle export";
wenzelm
parents: 67605
diff changeset
   536
68348
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   537
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   538
section \<open>Dump PIDE session database \label{sec:tool-dump}\<close>
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   539
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   540
text \<open>
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   541
  The @{tool_def "dump"} tool dumps information from the cumulative PIDE
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   542
  session database (which is processed on the spot). Its command-line usage
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   543
  is: @{verbatim [display]
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   544
\<open>Usage: isabelle dump [OPTIONS] [SESSIONS ...]
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   545
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   546
  Options are:
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   547
    -A NAMES     dump named aspects (default: ...)
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   548
    -B NAME      include session NAME and all descendants
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   549
    -D DIR       include session directory and select its sessions
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   550
    -O DIR       output directory for dumped files (default: "dump")
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   551
    -R           operate on requirements of selected sessions
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   552
    -X NAME      exclude sessions from group NAME and all descendants
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   553
    -a           select all sessions
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   554
    -d DIR       include session directory
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   555
    -g NAME      select session group NAME
70858
f76126e6a1ab clarified defaults;
wenzelm
parents: 70796
diff changeset
   556
    -l NAME      logic session name (default "Pure")
68348
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   557
    -o OPTION    override Isabelle system OPTION (via NAME=VAL or NAME)
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   558
    -v           verbose
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   559
    -x NAME      exclude session NAME and all descendants
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   560
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   561
  Dump cumulative PIDE session database, with the following aspects:
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   562
    ...\<close>}
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   563
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   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
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   565
  remaining command-line arguments specify sessions as in @{tool build}
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   566
  (\secref{sec:tool-build}): the cumulative PIDE database of all their loaded
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   567
  theories is dumped to the output directory of option \<^verbatim>\<open>-O\<close> (default: \<^verbatim>\<open>dump\<close>
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   568
  in the current directory).
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   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
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   574
  \<^medskip> Option \<^verbatim>\<open>-o\<close> overrides Isabelle system options as for @{tool build}
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   575
  (\secref{sec:tool-build}).
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   576
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   577
  \<^medskip> Option \<^verbatim>\<open>-v\<close> increases the general level of verbosity.
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   578
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   579
  \<^medskip> Option \<^verbatim>\<open>-A\<close> specifies named aspects of the dump, as a comma-separated
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   580
  list. The default is to dump all known aspects, as given in the command-line
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   581
  usage of the tool. The underlying Isabelle/Scala function
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   582
  \<^verbatim>\<open>isabelle.Dump.dump()\<close> takes aspects as user-defined operations on the
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   583
  final PIDE state and document version. This allows to imitate Prover IDE
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   584
  rendering under program control.
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   585
\<close>
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   586
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   587
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   588
subsubsection \<open>Examples\<close>
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   589
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   590
text \<open>
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   591
  Dump all Isabelle/ZF sessions (which are rather small):
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   592
  @{verbatim [display] \<open>isabelle dump -v -B ZF\<close>}
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   593
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   594
  \<^smallskip>
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   595
  Dump the quite substantial \<^verbatim>\<open>HOL-Analysis\<close> session, using main Isabelle/HOL
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   596
  as starting point:
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   597
  @{verbatim [display] \<open>isabelle dump -v -l HOL HOL-Analysis\<close>}
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   598
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   599
  \<^smallskip>
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   600
  Dump all sessions connected to HOL-Analysis, including a full bootstrap of
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   601
  Isabelle/HOL from Isabelle/Pure:
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   602
  @{verbatim [display] \<open>isabelle dump -v -l Pure -B HOL-Analysis\<close>}
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   603
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   604
  This results in uniform PIDE markup for everything, except for the
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   605
  Isabelle/Pure bootstrap process itself. Producing that on the spot requires
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   606
  several GB of heap space, both for the Isabelle/Scala and Isabelle/ML
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   607
  process (in 64bit mode). Here are some relevant settings (\secref{sec:boot})
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   608
  for such ambitious applications:
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   609
  @{verbatim [display]
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   610
\<open>ISABELLE_TOOL_JAVA_OPTIONS="-Xms4g -Xmx32g -Xss16m"
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   611
ML_OPTIONS="--minheap 4G --maxheap 32G"
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   612
\<close>}
69599
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   613
\<close>
68348
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   614
69599
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   615
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   616
section \<open>Update theory sources based on PIDE markup \label{sec:tool-update}\<close>
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   617
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   618
text \<open>
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   619
  The @{tool_def "update"} tool updates theory sources based on markup that is
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   620
  produced from a running PIDE session (similar to @{tool dump}
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   621
  \secref{sec:tool-dump}). Its command-line usage is: @{verbatim [display]
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   622
\<open>Usage: isabelle update [OPTIONS] [SESSIONS ...]
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   623
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   624
  Options are:
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   625
    -B NAME      include session NAME and all descendants
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   626
    -D DIR       include session directory and select its sessions
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   627
    -R           operate on requirements of selected sessions
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   628
    -X NAME      exclude sessions from group NAME and all descendants
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   629
    -a           select all sessions
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   630
    -d DIR       include session directory
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   631
    -g NAME      select session group NAME
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   632
    -l NAME      logic session name (default ISABELLE_LOGIC="HOL")
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   633
    -o OPTION    override Isabelle system OPTION (via NAME=VAL or NAME)
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   634
    -u OPT       overide update option: shortcut for "-o update_OPT"
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   635
    -v           verbose
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   636
    -x NAME      exclude session NAME and all descendants
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   637
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   638
  Update theory sources based on PIDE markup.\<close>}
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   639
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   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
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   641
  remaining command-line arguments specify sessions as in @{tool build}
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   642
  (\secref{sec:tool-build}) or @{tool dump} (\secref{sec:tool-dump}).
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   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
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   645
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   646
  \<^medskip> Option \<^verbatim>\<open>-v\<close> increases the general level of verbosity.
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   647
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   648
  \<^medskip> Option \<^verbatim>\<open>-o\<close> overrides Isabelle system options as for @{tool build}
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   649
  (\secref{sec:tool-build}). Option \<^verbatim>\<open>-u\<close> refers to specific \<^verbatim>\<open>update\<close>
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   650
  options, by relying on naming convention: ``\<^verbatim>\<open>-u\<close>~\<open>OPT\<close>'' is a shortcut for
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   651
  ``\<^verbatim>\<open>-o\<close>~\<^verbatim>\<open>update_\<close>\<open>OPT\<close>''.
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   652
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   653
  \<^medskip> The following update options are supported:
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   654
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   655
    \<^item> @{system_option update_inner_syntax_cartouches} to update inner syntax
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   656
    (types, terms, etc.)~to use cartouches, instead of double-quoted strings
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   657
    or atomic identifiers. For example, ``\<^theory_text>\<open>lemma \<doublequote>x =
69610
10644973cdde proper example for inner syntax, not name;
wenzelm
parents: 69603
diff changeset
   658
    x\<doublequote>\<close>'' is replaced by ``\<^theory_text>\<open>lemma \<open>x = x\<close>\<close>'', and ``\<^theory_text>\<open>assume
10644973cdde proper example for inner syntax, not name;
wenzelm
parents: 69603
diff changeset
   659
    A\<close>'' is replaced by ``\<^theory_text>\<open>assume \<open>A\<close>\<close>''.
69599
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   660
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   661
    \<^item> @{system_option update_mixfix_cartouches} to update mixfix templates to
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   662
    use cartouches instead of double-quoted strings. For example, ``\<^theory_text>\<open>(infixl
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   663
    \<doublequote>+\<doublequote> 65)\<close>'' is replaced by ``\<^theory_text>\<open>(infixl \<open>+\<close>
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   664
    65)\<close>''.
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   665
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   666
    \<^item> @{system_option update_control_cartouches} to update antiquotations to
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   667
    use the compact form with control symbol and cartouche argument. For
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   668
    example, ``\<open>@{term \<doublequote>x + y\<doublequote>}\<close>'' is replaced by
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   669
    ``\<open>\<^term>\<open>x + y\<close>\<close>'' (the control symbol is literally \<^verbatim>\<open>\<^term>\<close>.)
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   670
69603
67ae2e164c0f support for isabelle update -u path_cartouches;
wenzelm
parents: 69602
diff changeset
   671
    \<^item> @{system_option update_path_cartouches} to update file-system paths to
67ae2e164c0f support for isabelle update -u path_cartouches;
wenzelm
parents: 69602
diff changeset
   672
    use cartouches: this depends on language markup provided by semantic
67ae2e164c0f support for isabelle update -u path_cartouches;
wenzelm
parents: 69602
diff changeset
   673
    processing of parsed input.
67ae2e164c0f support for isabelle update -u path_cartouches;
wenzelm
parents: 69602
diff changeset
   674
69599
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   675
  It is also possible to produce custom updates in Isabelle/ML, by reporting
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   676
  \<^ML>\<open>Markup.update\<close> with the precise source position and a replacement
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   677
  text. This operation should be made conditional on specific system options,
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   678
  similar to the ones above. Searching the above option names in ML sources of
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   679
  \<^dir>\<open>$ISABELLE_HOME/src/Pure\<close> provides some examples.
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   680
69602
48e973251070 clarified documentation;
wenzelm
parents: 69601
diff changeset
   681
  Updates can be in conflict by producing nested or overlapping edits: this
48e973251070 clarified documentation;
wenzelm
parents: 69601
diff changeset
   682
  may require to run @{tool update} multiple times.
69599
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   683
\<close>
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   684
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   685
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   686
subsubsection \<open>Examples\<close>
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   687
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   688
text \<open>
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   689
  Update some cartouche notation in all theory sources required for session
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   690
  \<^verbatim>\<open>HOL-Analysis\<close>:
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   691
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   692
  @{verbatim [display] \<open>isabelle update -u mixfix_cartouches -l Pure HOL-Analysis\<close>}
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   693
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   694
  \<^smallskip> Update the same for all application sessions based on \<^verbatim>\<open>HOL-Analysis\<close> ---
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   695
  its image is taken as starting point and its sources are not touched:
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   696
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   697
  @{verbatim [display] \<open>isabelle update -u mixfix_cartouches -l HOL-Analysis -B HOL-Analysis\<close>}
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   698
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   699
  \<^smallskip> This two-stage approach reduces resource requirements of the running PIDE
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   700
  session: a base image like \<^verbatim>\<open>HOL-Analysis\<close> (or \<^verbatim>\<open>HOL\<close>, \<^verbatim>\<open>HOL-Library\<close>) is
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   701
  more compact than importing all required theory (and ML) source files from
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   702
  \<^verbatim>\<open>Pure\<close>.
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   703
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   704
  \<^smallskip> Update sessions that build on \<^verbatim>\<open>HOL-Proofs\<close>, which need to be run
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   705
  separately with special options as follows:
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   706
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   707
  @{verbatim [display] \<open>isabelle update -u mixfix_cartouches -l HOL-Proofs -B HOL-Proofs
69601
c51a9bd4cf09 redundant (see isabelle.Dump.make_options);
wenzelm
parents: 69599
diff changeset
   708
  -o record_proofs=2\<close>}
69599
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   709
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   710
  \<^smallskip> See also the end of \secref{sec:tool-dump} for hints on increasing
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   711
  Isabelle/ML heap sizes for very big PIDE processes that include many
caa7e406056d documentation on "isabelle update";
wenzelm
parents: 69593
diff changeset
   712
  sessions, notably from the Archive of Formal Proofs.
68348
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   713
\<close>
2ac3a5c07dfa documentation for "isabelle dump";
wenzelm
parents: 68314
diff changeset
   714
48578
21361b6189a6 some description of isabelle build;
wenzelm
parents:
diff changeset
   715
end