src/Doc/System/Environment.thy
author wenzelm
Sat, 14 Jun 2025 17:10:18 +0200
changeset 82709 1008b8e7c78d
parent 81740 9f0cee195ee9
child 82720 956ecf2c07a0
permissions -rw-r--r--
discontinued ML_IDENTIFIER settings variable;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
66732
e566fb4d43d4 more and updated documentation;
wenzelm
parents: 64509
diff changeset
     1
(*:maxLineLen=78:*)
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
     2
62640
e36cbe677c17 clarified name;
wenzelm
parents: 62639
diff changeset
     3
theory Environment
43564
9864182c6bad document antiquotations are managed as theory data, with proper name space and entity markup;
wenzelm
parents: 41955
diff changeset
     4
imports Base
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
     5
begin
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
     6
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
     7
chapter \<open>The Isabelle system environment\<close>
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
     8
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
     9
text \<open>
62588
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
    10
  This manual describes Isabelle together with related tools as seen from a
76987
4c275405faae isabelle update -u cite;
wenzelm
parents: 76105
diff changeset
    11
  system oriented view. See also the \<^emph>\<open>Isabelle/Isar Reference Manual\<close> \<^cite>\<open>"isabelle-isar-ref"\<close> for the actual Isabelle input language and related
4c275405faae isabelle update -u cite;
wenzelm
parents: 76105
diff changeset
    12
  concepts, and \<^emph>\<open>The Isabelle/Isar Implementation Manual\<close> \<^cite>\<open>"isabelle-implementation"\<close> for the main concepts of the underlying
62588
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
    13
  implementation in Isabelle/ML.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
    14
\<close>
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
    15
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
    16
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
    17
section \<open>Isabelle settings \label{sec:settings}\<close>
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
    18
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
    19
text \<open>
62588
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
    20
  Isabelle executables may depend on the \<^emph>\<open>Isabelle settings\<close> within the
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
    21
  process environment. This is a statically scoped collection of environment
62013
92a2372a226b discontinued documentation of old browser;
wenzelm
parents: 61656
diff changeset
    22
  variables, such as @{setting ISABELLE_HOME}, @{setting ML_SYSTEM}, @{setting
92a2372a226b discontinued documentation of old browser;
wenzelm
parents: 61656
diff changeset
    23
  ML_HOME}. These variables are \<^emph>\<open>not\<close> intended to be set directly from the
75161
95612f330c93 misc tuning based on comments by Heiko Eißfeldt;
wenzelm
parents: 74427
diff changeset
    24
  shell, but are provided by Isabelle \<^emph>\<open>components\<close> within their \<^emph>\<open>settings
95612f330c93 misc tuning based on comments by Heiko Eißfeldt;
wenzelm
parents: 74427
diff changeset
    25
  files\<close>, as explained below.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
    26
\<close>
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
    27
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
    28
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
    29
subsection \<open>Bootstrapping the environment \label{sec:boot}\<close>
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
    30
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    31
text \<open>
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    32
  Isabelle executables need to be run within a proper settings environment.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    33
  This is bootstrapped as described below, on the first invocation of one of
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    34
  the outer wrapper scripts (such as @{executable_ref isabelle}). This happens
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    35
  only once for each process tree, i.e.\ the environment is passed to
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    36
  subprocesses according to regular Unix conventions.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    37
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    38
    \<^enum> The special variable @{setting_def ISABELLE_HOME} is determined
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    39
    automatically from the location of the binary that has been run.
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
    40
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    41
    You should not try to set @{setting ISABELLE_HOME} manually. Also note
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    42
    that the Isabelle executables either have to be run from their original
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    43
    location in the distribution directory, or via the executable objects
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    44
    created by the @{tool install} tool. Symbolic links are admissible, but a
63680
6e1e8b5abbfa more symbols;
wenzelm
parents: 63669
diff changeset
    45
    plain copy of the \<^dir>\<open>$ISABELLE_HOME/bin\<close> files will not work!
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    46
63680
6e1e8b5abbfa more symbols;
wenzelm
parents: 63669
diff changeset
    47
    \<^enum> The file \<^file>\<open>$ISABELLE_HOME/etc/settings\<close> is run as a @{executable_ref
6e1e8b5abbfa more symbols;
wenzelm
parents: 63669
diff changeset
    48
    bash} shell script with the auto-export option for variables enabled.
28238
398bf960d3d4 misc tuning and modernization;
wenzelm
parents: 28223
diff changeset
    49
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    50
    This file holds a rather long list of shell variable assignments, thus
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    51
    providing the site-wide default settings. The Isabelle distribution
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    52
    already contains a global settings file with sensible defaults for most
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    53
    variables. When installing the system, only a few of these may have to be
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    54
    adapted (probably @{setting ML_SYSTEM} etc.).
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    55
69593
3dda49e08b9d isabelle update -u control_cartouches;
wenzelm
parents: 68541
diff changeset
    56
    \<^enum> The file \<^path>\<open>$ISABELLE_HOME_USER/etc/settings\<close> (if it
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    57
    exists) is run in the same way as the site default settings. Note that the
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    58
    variable @{setting ISABELLE_HOME_USER} has already been set before ---
81740
9f0cee195ee9 update release name;
wenzelm
parents: 80178
diff changeset
    59
    usually to something like \<^verbatim>\<open>$USER_HOME/.isabelle/Isabelle2025\<close>.
61458
987533262fc2 Markdown support in document text;
wenzelm
parents: 61439
diff changeset
    60
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    61
    Thus individual users may override the site-wide defaults. Typically, a
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    62
    user settings file contains only a few lines, with some assignments that
63680
6e1e8b5abbfa more symbols;
wenzelm
parents: 63669
diff changeset
    63
    are actually changed. Never copy the central
6e1e8b5abbfa more symbols;
wenzelm
parents: 63669
diff changeset
    64
    \<^file>\<open>$ISABELLE_HOME/etc/settings\<close> file!
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
    65
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    66
  Since settings files are regular GNU @{executable_def bash} scripts, one may
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    67
  use complex shell commands, such as \<^verbatim>\<open>if\<close> or \<^verbatim>\<open>case\<close> statements to set
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    68
  variables depending on the system architecture or other environment
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    69
  variables. Such advanced features should be added only with great care,
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    70
  though. In particular, external environment references should be kept at a
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
    71
  minimum.
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
    72
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 59904
diff changeset
    73
  \<^medskip>
68514
wenzelm
parents: 68477
diff changeset
    74
  A few variables are somewhat special, e.g.\ @{setting_def ISABELLE_TOOL} is
68219
c0341c0080e2 clarified store directories;
wenzelm
parents: 68003
diff changeset
    75
  set automatically to the absolute path name of the @{executable isabelle}
c0341c0080e2 clarified store directories;
wenzelm
parents: 68003
diff changeset
    76
  executables.
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
    77
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 59904
diff changeset
    78
  \<^medskip>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    79
  Note that the settings environment may be inspected with the @{tool getenv}
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    80
  tool. This might help to figure out the effect of complex settings scripts.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    81
\<close>
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
    82
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
    83
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
    84
subsection \<open>Common variables\<close>
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
    85
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
    86
text \<open>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    87
  This is a reference of common Isabelle settings variables. Note that the
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    88
  list is somewhat open-ended. Third-party utilities or interfaces may add
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    89
  their own selection. Variables that are special in some sense are marked
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    90
  with \<open>\<^sup>*\<close>.
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
    91
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    92
  \<^descr>[@{setting_def USER_HOME}\<open>\<^sup>*\<close>] Is the cross-platform user home directory.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    93
  On Unix systems this is usually the same as @{setting HOME}, but on Windows
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    94
  it is the regular home directory of the user, not the one of within the
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    95
  Cygwin root file-system.\<^footnote>\<open>Cygwin itself offers another choice whether its
69593
3dda49e08b9d isabelle update -u control_cartouches;
wenzelm
parents: 68541
diff changeset
    96
  HOME should point to the \<^path>\<open>/home\<close> directory tree or the Windows user
63669
256fc20716f2 clarified antiquotations;
wenzelm
parents: 62847
diff changeset
    97
  home.\<close>
47661
012a887997f3 USER_HOME settings variable points to cross-platform user home directory;
wenzelm
parents: 45028
diff changeset
    98
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    99
  \<^descr>[@{setting_def ISABELLE_HOME}\<open>\<^sup>*\<close>] is the location of the top-level
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   100
  Isabelle distribution directory. This is automatically determined from the
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   101
  Isabelle executable that has been invoked. Do not attempt to set @{setting
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   102
  ISABELLE_HOME} yourself from the shell!
50182
30177ec0be36 added ISABELLE_PLATFORM_FAMILY;
wenzelm
parents: 49173
diff changeset
   103
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   104
  \<^descr>[@{setting_def ISABELLE_HOME_USER}] is the user-specific counterpart of
69593
3dda49e08b9d isabelle update -u control_cartouches;
wenzelm
parents: 68541
diff changeset
   105
  @{setting ISABELLE_HOME}. The default value is relative to \<^path>\<open>$USER_HOME/.isabelle\<close>, under rare circumstances this may be changed in the
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   106
  global setting file. Typically, the @{setting ISABELLE_HOME_USER} directory
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   107
  mimics @{setting ISABELLE_HOME} to some extend. In particular, site-wide
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   108
  defaults may be overridden by a private \<^verbatim>\<open>$ISABELLE_HOME_USER/etc/settings\<close>.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   109
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   110
  \<^descr>[@{setting_def ISABELLE_PLATFORM_FAMILY}\<open>\<^sup>*\<close>] is automatically set to the
73671
7404f2e1d092 clarified platforms;
wenzelm
parents: 73150
diff changeset
   111
  general platform family (\<^verbatim>\<open>linux\<close>, \<^verbatim>\<open>macos\<close>, \<^verbatim>\<open>windows\<close>). Note that
50182
30177ec0be36 added ISABELLE_PLATFORM_FAMILY;
wenzelm
parents: 49173
diff changeset
   112
  platform-dependent tools usually need to refer to the more specific
68003
9b89d831dc80 prefer explicit 32/64 bit platform settings;
wenzelm
parents: 67904
diff changeset
   113
  identification according to @{setting ISABELLE_PLATFORM64}, @{setting
73671
7404f2e1d092 clarified platforms;
wenzelm
parents: 73150
diff changeset
   114
  ISABELLE_WINDOWS_PLATFORM64}, @{setting ISABELLE_APPLE_PLATFORM64}.
66732
e566fb4d43d4 more and updated documentation;
wenzelm
parents: 64509
diff changeset
   115
73671
7404f2e1d092 clarified platforms;
wenzelm
parents: 73150
diff changeset
   116
  \<^descr>[@{setting_def ISABELLE_PLATFORM64}\<open>\<^sup>*\<close>] indicates the standard Posix
7404f2e1d092 clarified platforms;
wenzelm
parents: 73150
diff changeset
   117
  platform (\<^verbatim>\<open>x86_64\<close>, \<^verbatim>\<open>arm64\<close>), together with a symbolic name for the
7404f2e1d092 clarified platforms;
wenzelm
parents: 73150
diff changeset
   118
  operating system (\<^verbatim>\<open>linux\<close>, \<^verbatim>\<open>darwin\<close>, \<^verbatim>\<open>cygwin\<close>).
36196
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents: 33952
diff changeset
   119
68003
9b89d831dc80 prefer explicit 32/64 bit platform settings;
wenzelm
parents: 67904
diff changeset
   120
  \<^descr>[@{setting_def ISABELLE_WINDOWS_PLATFORM64}\<open>\<^sup>*\<close>, @{setting_def
73671
7404f2e1d092 clarified platforms;
wenzelm
parents: 73150
diff changeset
   121
  ISABELLE_WINDOWS_PLATFORM32}\<open>\<^sup>*\<close>] indicate the native Windows platform: both
7404f2e1d092 clarified platforms;
wenzelm
parents: 73150
diff changeset
   122
  64\,bit and 32\,bit executables are supported here.
47823
4fad76e6f4ba some manual updates;
wenzelm
parents: 47661
diff changeset
   123
66732
e566fb4d43d4 more and updated documentation;
wenzelm
parents: 64509
diff changeset
   124
  In GNU bash scripts, a preference for native Windows platform variants may
68003
9b89d831dc80 prefer explicit 32/64 bit platform settings;
wenzelm
parents: 67904
diff changeset
   125
  be specified like this (first 64 bit, second 32 bit):
66732
e566fb4d43d4 more and updated documentation;
wenzelm
parents: 64509
diff changeset
   126
68003
9b89d831dc80 prefer explicit 32/64 bit platform settings;
wenzelm
parents: 67904
diff changeset
   127
  @{verbatim [display] \<open>"${ISABELLE_WINDOWS_PLATFORM64:-${ISABELLE_WINDOWS_PLATFORM32:-
73671
7404f2e1d092 clarified platforms;
wenzelm
parents: 73150
diff changeset
   128
  $ISABELLE_PLATFORM64}}"\<close>}
7404f2e1d092 clarified platforms;
wenzelm
parents: 73150
diff changeset
   129
7404f2e1d092 clarified platforms;
wenzelm
parents: 73150
diff changeset
   130
  \<^descr>[@{setting_def ISABELLE_APPLE_PLATFORM64}\<open>\<^sup>*\<close>] indicates the native Apple
7404f2e1d092 clarified platforms;
wenzelm
parents: 73150
diff changeset
   131
  Silicon platform (\<^verbatim>\<open>arm64-darwin\<close> if available), instead of Intel emulation
7404f2e1d092 clarified platforms;
wenzelm
parents: 73150
diff changeset
   132
  via Rosetta (\<^verbatim>\<open>ISABELLE_PLATFORM64=x86_64-darwin\<close>).
36196
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents: 33952
diff changeset
   133
62588
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   134
  \<^descr>[@{setting ISABELLE_TOOL}\<open>\<^sup>*\<close>] is automatically set to the full path name
66787
64b47495676d obsolete;
wenzelm
parents: 66785
diff changeset
   135
  of the @{executable isabelle} executable.
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   136
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   137
  \<^descr>[@{setting_def ISABELLE_IDENTIFIER}\<open>\<^sup>*\<close>] refers to the name of this
81740
9f0cee195ee9 update release name;
wenzelm
parents: 80178
diff changeset
   138
  Isabelle distribution, e.g.\ ``\<^verbatim>\<open>Isabelle2025\<close>''.
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   139
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   140
  \<^descr>[@{setting_def ML_SYSTEM}, @{setting_def ML_HOME}, @{setting_def
82709
1008b8e7c78d discontinued ML_IDENTIFIER settings variable;
wenzelm
parents: 81740
diff changeset
   141
  ML_OPTIONS}, @{setting_def ML_PLATFORM}] specify the underlying ML system of
1008b8e7c78d discontinued ML_IDENTIFIER settings variable;
wenzelm
parents: 81740
diff changeset
   142
  Isabelle.
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   143
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   144
  The actual compiler binary will be run from the directory @{setting
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   145
  ML_HOME}, with @{setting ML_OPTIONS} as first arguments on the command line.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   146
  The optional @{setting ML_PLATFORM} may specify the binary format of ML heap
82709
1008b8e7c78d discontinued ML_IDENTIFIER settings variable;
wenzelm
parents: 81740
diff changeset
   147
  images, which is useful for cross-platform installations.
47823
4fad76e6f4ba some manual updates;
wenzelm
parents: 47661
diff changeset
   148
66733
9180953b976b more and updated documentation;
wenzelm
parents: 66732
diff changeset
   149
  \<^descr>[@{setting_def ISABELLE_JDK_HOME}] points to a full JDK (Java Development
9180953b976b more and updated documentation;
wenzelm
parents: 66732
diff changeset
   150
  Kit) installation with \<^verbatim>\<open>javac\<close> and \<^verbatim>\<open>jar\<close> executables. Note that
9180953b976b more and updated documentation;
wenzelm
parents: 66732
diff changeset
   151
  conventional \<^verbatim>\<open>JAVA_HOME\<close> points to the JRE (Java Runtime Environment), not
9180953b976b more and updated documentation;
wenzelm
parents: 66732
diff changeset
   152
  the JDK.
9180953b976b more and updated documentation;
wenzelm
parents: 66732
diff changeset
   153
9180953b976b more and updated documentation;
wenzelm
parents: 66732
diff changeset
   154
  \<^descr>[@{setting_def ISABELLE_JAVA_PLATFORM}] identifies the hardware and
9180953b976b more and updated documentation;
wenzelm
parents: 66732
diff changeset
   155
  operating system platform for the Java installation of Isabelle. That is
66906
03a96b8c7c06 updated to jdk-8u152, which is for x86_64 only;
wenzelm
parents: 66789
diff changeset
   156
  always the (native) 64 bit variant: \<^verbatim>\<open>x86_64-linux\<close>, \<^verbatim>\<open>x86_64-darwin\<close>,
66733
9180953b976b more and updated documentation;
wenzelm
parents: 66732
diff changeset
   157
  \<^verbatim>\<open>x86_64-windows\<close>.
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   158
68523
ccacc84e0251 clarified settings -- avoid hard-wired directories;
wenzelm
parents: 68514
diff changeset
   159
  \<^descr>[@{setting_def ISABELLE_BROWSER_INFO}] is the directory where HTML and PDF
ccacc84e0251 clarified settings -- avoid hard-wired directories;
wenzelm
parents: 68514
diff changeset
   160
  browser information is stored (see also \secref{sec:info}); its default is
69593
3dda49e08b9d isabelle update -u control_cartouches;
wenzelm
parents: 68541
diff changeset
   161
  \<^path>\<open>$ISABELLE_HOME_USER/browser_info\<close>. For ``system build mode'' (see
68523
ccacc84e0251 clarified settings -- avoid hard-wired directories;
wenzelm
parents: 68514
diff changeset
   162
  \secref{sec:tool-build}), @{setting_def ISABELLE_BROWSER_INFO_SYSTEM} is
69593
3dda49e08b9d isabelle update -u control_cartouches;
wenzelm
parents: 68541
diff changeset
   163
  used instead; its default is \<^path>\<open>$ISABELLE_HOME/browser_info\<close>.
68523
ccacc84e0251 clarified settings -- avoid hard-wired directories;
wenzelm
parents: 68514
diff changeset
   164
ccacc84e0251 clarified settings -- avoid hard-wired directories;
wenzelm
parents: 68514
diff changeset
   165
  \<^descr>[@{setting_def ISABELLE_HEAPS}] is the directory where session heap images,
77554
4465d9dff448 clarified terminology of "session build database", while "build database" is the one underlying Build_Process;
wenzelm
parents: 76987
diff changeset
   166
  log files, and session build databases are stored; its default is
69854
cc0b3e177b49 system option "system_heaps" supersedes various command-line options for "system build mode";
wenzelm
parents: 69593
diff changeset
   167
  \<^path>\<open>$ISABELLE_HOME_USER/heaps\<close>. If @{system_option system_heaps} is
cc0b3e177b49 system option "system_heaps" supersedes various command-line options for "system build mode";
wenzelm
parents: 69593
diff changeset
   168
  \<^verbatim>\<open>true\<close>, @{setting_def ISABELLE_HEAPS_SYSTEM} is used instead; its default
cc0b3e177b49 system option "system_heaps" supersedes various command-line options for "system build mode";
wenzelm
parents: 69593
diff changeset
   169
  is \<^path>\<open>$ISABELLE_HOME/heaps\<close>. See also \secref{sec:tool-build}.
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   170
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   171
  \<^descr>[@{setting_def ISABELLE_LOGIC}] specifies the default logic to load if none
80161
fd5ed5e63a29 tuned spelling;
wenzelm
parents: 80157
diff changeset
   172
  is given explicitly by the user. The default value is \<^verbatim>\<open>HOL\<close>.
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   173
62562
905a5db3932d back to external line editor, due to problems of JLine with multithreading of in vs. out;
wenzelm
parents: 62559
diff changeset
   174
  \<^descr>[@{setting_def ISABELLE_LINE_EDITOR}] specifies the line editor for the
905a5db3932d back to external line editor, due to problems of JLine with multithreading of in vs. out;
wenzelm
parents: 62559
diff changeset
   175
  @{tool_ref console} interface.
905a5db3932d back to external line editor, due to problems of JLine with multithreading of in vs. out;
wenzelm
parents: 62559
diff changeset
   176
73741
941915a3b811 discontinued obsolete "isabelle latex";
wenzelm
parents: 73671
diff changeset
   177
  \<^descr>[@{setting_def ISABELLE_PDFLATEX}, @{setting_def ISABELLE_LUALATEX},
941915a3b811 discontinued obsolete "isabelle latex";
wenzelm
parents: 73671
diff changeset
   178
  @{setting_def ISABELLE_BIBTEX}, @{setting_def ISABELLE_MAKEINDEX}] refer to
941915a3b811 discontinued obsolete "isabelle latex";
wenzelm
parents: 73671
diff changeset
   179
  {\LaTeX}-related tools for Isabelle document preparation (see also
941915a3b811 discontinued obsolete "isabelle latex";
wenzelm
parents: 73671
diff changeset
   180
  \secref{sec:tool-document}).
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   181
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   182
  \<^descr>[@{setting_def ISABELLE_TOOLS}] is a colon separated list of directories
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   183
  that are scanned by @{executable isabelle} for external utility programs
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   184
  (see also \secref{sec:isabelle-tool}).
50197
b385d134926d eval PDF_VIEWER/DVI_VIEWER command line, which allows additional quotes for program name, for example;
wenzelm
parents: 50182
diff changeset
   185
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   186
  \<^descr>[@{setting_def ISABELLE_DOCS}] is a colon separated list of directories
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   187
  with documentation files.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   188
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   189
  \<^descr>[@{setting_def PDF_VIEWER}] specifies the program to be used for displaying
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   190
  \<^verbatim>\<open>pdf\<close> files.
54683
cf48ddc266e5 clarified "isabelle display" and 'display_drafts': re-use file and program instance, open asynchronously via desktop environment;
wenzelm
parents: 52746
diff changeset
   191
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   192
  \<^descr>[@{setting_def ISABELLE_TMP_PREFIX}\<open>\<^sup>*\<close>] is the prefix from which any
62588
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   193
  running Isabelle ML process derives an individual directory for temporary
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   194
  files.
68477
f090b313fdc8 more documentation;
wenzelm
parents: 68394
diff changeset
   195
f090b313fdc8 more documentation;
wenzelm
parents: 68394
diff changeset
   196
  \<^descr>[@{setting_def ISABELLE_TOOL_JAVA_OPTIONS}] is passed to the \<^verbatim>\<open>java\<close>
68514
wenzelm
parents: 68477
diff changeset
   197
  executable when running Isabelle tools (e.g.\ @{tool build}). This is
68477
f090b313fdc8 more documentation;
wenzelm
parents: 68394
diff changeset
   198
  occasionally helpful to provide more heap space, via additional options like
f090b313fdc8 more documentation;
wenzelm
parents: 68394
diff changeset
   199
  \<^verbatim>\<open>-Xms1g -Xmx4g\<close>.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   200
\<close>
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   201
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   202
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   203
subsection \<open>Additional components \label{sec:components}\<close>
32323
8185d3bfcbf1 tuned "Bootstrapping the environment";
wenzelm
parents: 32088
diff changeset
   204
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   205
text \<open>
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   206
  Any directory may be registered as an explicit \<^emph>\<open>Isabelle component\<close>. The
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   207
  general layout conventions are that of the main Isabelle distribution
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   208
  itself, and the following two files (both optional) have a special meaning:
32323
8185d3bfcbf1 tuned "Bootstrapping the environment";
wenzelm
parents: 32088
diff changeset
   209
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   210
    \<^item> \<^verbatim>\<open>etc/settings\<close> holds additional settings that are initialized when
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   211
    bootstrapping the overall Isabelle environment, cf.\ \secref{sec:boot}. As
64509
80aaa4ff7fed documentation for Isabelle/Scala tools;
wenzelm
parents: 63995
diff changeset
   212
    usual, the content is interpreted as a GNU bash script. It may refer to
80aaa4ff7fed documentation for Isabelle/Scala tools;
wenzelm
parents: 63995
diff changeset
   213
    the component's enclosing directory via the \<^verbatim>\<open>COMPONENT\<close> shell variable.
32323
8185d3bfcbf1 tuned "Bootstrapping the environment";
wenzelm
parents: 32088
diff changeset
   214
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   215
    For example, the following setting allows to refer to files within the
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   216
    component later on, without having to hardwire absolute paths:
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   217
    @{verbatim [display] \<open>MY_COMPONENT_HOME="$COMPONENT"\<close>}
32323
8185d3bfcbf1 tuned "Bootstrapping the environment";
wenzelm
parents: 32088
diff changeset
   218
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   219
    Components can also add to existing Isabelle settings such as
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   220
    @{setting_def ISABELLE_TOOLS}, in order to provide component-specific
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   221
    tools that can be invoked by end-users. For example:
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   222
    @{verbatim [display] \<open>ISABELLE_TOOLS="$ISABELLE_TOOLS:$COMPONENT/lib/Tools"\<close>}
32323
8185d3bfcbf1 tuned "Bootstrapping the environment";
wenzelm
parents: 32088
diff changeset
   223
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   224
    \<^item> \<^verbatim>\<open>etc/components\<close> holds a list of further sub-components of the same
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   225
    structure. The directory specifications given here can be either absolute
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   226
    (with leading \<^verbatim>\<open>/\<close>) or relative to the component's main directory.
32323
8185d3bfcbf1 tuned "Bootstrapping the environment";
wenzelm
parents: 32088
diff changeset
   227
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   228
  The root of component initialization is @{setting ISABELLE_HOME} itself.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   229
  After initializing all of its sub-components recursively, @{setting
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   230
  ISABELLE_HOME_USER} is included in the same manner (if that directory
71904
70442ddbfb15 tuned whitespace;
wenzelm
parents: 71903
diff changeset
   231
  exists). This allows to install private components via
70442ddbfb15 tuned whitespace;
wenzelm
parents: 71903
diff changeset
   232
  \<^path>\<open>$ISABELLE_HOME_USER/etc/components\<close>, although it is often more
70442ddbfb15 tuned whitespace;
wenzelm
parents: 71903
diff changeset
   233
  convenient to do that programmatically via the
70442ddbfb15 tuned whitespace;
wenzelm
parents: 71903
diff changeset
   234
  \<^bash_function>\<open>init_component\<close> shell function in the \<^verbatim>\<open>etc/settings\<close>
70442ddbfb15 tuned whitespace;
wenzelm
parents: 71903
diff changeset
   235
  script of \<^verbatim>\<open>$ISABELLE_HOME_USER\<close> (or any other component directory). For
70442ddbfb15 tuned whitespace;
wenzelm
parents: 71903
diff changeset
   236
  example:
66947
wenzelm
parents: 66906
diff changeset
   237
  @{verbatim [display] \<open>init_component "$HOME/screwdriver-2.0"\<close>}
48838
623ba165d059 direct support for component forests via init_components;
wenzelm
parents: 48813
diff changeset
   238
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   239
  This is tolerant wrt.\ missing component directories, but might produce a
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   240
  warning.
48838
623ba165d059 direct support for component forests via init_components;
wenzelm
parents: 48813
diff changeset
   241
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 59904
diff changeset
   242
  \<^medskip>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   243
  More complex situations may be addressed by initializing components listed
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   244
  in a given catalog file, relatively to some base directory:
61407
7ba7b8103565 @{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents: 61406
diff changeset
   245
  @{verbatim [display] \<open>init_components "$HOME/my_component_store" "some_catalog_file"\<close>}
48838
623ba165d059 direct support for component forests via init_components;
wenzelm
parents: 48813
diff changeset
   246
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   247
  The component directories listed in the catalog file are treated as relative
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   248
  to the given base directory.
48844
6408fb6f7d81 some explanations on isabelle components;
wenzelm
parents: 48838
diff changeset
   249
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   250
  See also \secref{sec:tool-components} for some tool-support for resolving
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   251
  components that are formally initialized but not installed yet.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   252
\<close>
32323
8185d3bfcbf1 tuned "Bootstrapping the environment";
wenzelm
parents: 32088
diff changeset
   253
8185d3bfcbf1 tuned "Bootstrapping the environment";
wenzelm
parents: 32088
diff changeset
   254
62588
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   255
section \<open>The Isabelle tool wrapper \label{sec:isabelle-tool}\<close>
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   256
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   257
text \<open>
62588
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   258
  The main \<^emph>\<open>Isabelle tool wrapper\<close> provides a generic startup environment for
64509
80aaa4ff7fed documentation for Isabelle/Scala tools;
wenzelm
parents: 63995
diff changeset
   259
  Isabelle-related utilities, user interfaces, add-on applications etc. Such
80aaa4ff7fed documentation for Isabelle/Scala tools;
wenzelm
parents: 63995
diff changeset
   260
  tools automatically benefit from the settings mechanism
80aaa4ff7fed documentation for Isabelle/Scala tools;
wenzelm
parents: 63995
diff changeset
   261
  (\secref{sec:settings}). Moreover, this is the standard way to invoke
80aaa4ff7fed documentation for Isabelle/Scala tools;
wenzelm
parents: 63995
diff changeset
   262
  Isabelle/Scala functionality as a separate operating-system process.
80aaa4ff7fed documentation for Isabelle/Scala tools;
wenzelm
parents: 63995
diff changeset
   263
  Isabelle command-line tools are run uniformly via a common wrapper ---
80aaa4ff7fed documentation for Isabelle/Scala tools;
wenzelm
parents: 63995
diff changeset
   264
  @{executable_ref isabelle}:
61407
7ba7b8103565 @{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents: 61406
diff changeset
   265
  @{verbatim [display]
62588
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   266
\<open>Usage: isabelle TOOL [ARGS ...]
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   267
62829
4141c2a8458b clarified Isabelle tool wrapper: bash, Scala, no perl, no ML;
wenzelm
parents: 62677
diff changeset
   268
  Start Isabelle TOOL with ARGS; pass "-?" for tool-specific help.
62588
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   269
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   270
Available tools:
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   271
  ...\<close>}
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   272
64509
80aaa4ff7fed documentation for Isabelle/Scala tools;
wenzelm
parents: 63995
diff changeset
   273
  Tools may be implemented in Isabelle/Scala or as stand-alone executables
80aaa4ff7fed documentation for Isabelle/Scala tools;
wenzelm
parents: 63995
diff changeset
   274
  (usually as GNU bash scripts). In the invocation of ``@{executable
80aaa4ff7fed documentation for Isabelle/Scala tools;
wenzelm
parents: 63995
diff changeset
   275
  isabelle}~\<open>tool\<close>'', the named \<open>tool\<close> is resolved as follows (and in the
80aaa4ff7fed documentation for Isabelle/Scala tools;
wenzelm
parents: 63995
diff changeset
   276
  given order).
80aaa4ff7fed documentation for Isabelle/Scala tools;
wenzelm
parents: 63995
diff changeset
   277
80aaa4ff7fed documentation for Isabelle/Scala tools;
wenzelm
parents: 63995
diff changeset
   278
    \<^enum> An external tool found on the directories listed in the @{setting
80aaa4ff7fed documentation for Isabelle/Scala tools;
wenzelm
parents: 63995
diff changeset
   279
    ISABELLE_TOOLS} settings variable (colon-separated list in standard POSIX
75642
bb048086468a discontinued Isabelle tools implemented as .scala scripts;
wenzelm
parents: 75291
diff changeset
   280
    notation). It is invoked as stand-alone program with the command-line
bb048086468a discontinued Isabelle tools implemented as .scala scripts;
wenzelm
parents: 75291
diff changeset
   281
    arguments provided as \<^verbatim>\<open>argv\<close> array.
64509
80aaa4ff7fed documentation for Isabelle/Scala tools;
wenzelm
parents: 63995
diff changeset
   282
75642
bb048086468a discontinued Isabelle tools implemented as .scala scripts;
wenzelm
parents: 75291
diff changeset
   283
    \<^enum> An internal tool that is declared via class
bb048086468a discontinued Isabelle tools implemented as .scala scripts;
wenzelm
parents: 75291
diff changeset
   284
    \<^scala_type>\<open>isabelle.Isabelle_Scala_Tools\<close> and registered via
bb048086468a discontinued Isabelle tools implemented as .scala scripts;
wenzelm
parents: 75291
diff changeset
   285
    \<^verbatim>\<open>services\<close> in \<^path>\<open>etc/build.props\<close>. See \secref{sec:scala-build} for
bb048086468a discontinued Isabelle tools implemented as .scala scripts;
wenzelm
parents: 75291
diff changeset
   286
    more details.
64509
80aaa4ff7fed documentation for Isabelle/Scala tools;
wenzelm
parents: 63995
diff changeset
   287
72252
3b17e7688dc6 updated documentation;
wenzelm
parents: 71904
diff changeset
   288
  There are also various administrative tools that are available from a bare
64509
80aaa4ff7fed documentation for Isabelle/Scala tools;
wenzelm
parents: 63995
diff changeset
   289
  repository clone of Isabelle, but not in regular distributions.
62588
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   290
\<close>
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   291
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   292
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   293
subsubsection \<open>Examples\<close>
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   294
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   295
text \<open>
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   296
  Show the list of available documentation of the Isabelle distribution:
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   297
  @{verbatim [display] \<open>isabelle doc\<close>}
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   298
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   299
  View a certain document as follows:
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   300
  @{verbatim [display] \<open>isabelle doc system\<close>}
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   301
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   302
  Query the Isabelle settings environment:
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   303
  @{verbatim [display] \<open>isabelle getenv ISABELLE_HOME_USER\<close>}
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   304
\<close>
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   305
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   306
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   307
section \<open>The raw Isabelle ML process\<close>
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   308
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   309
subsection \<open>Batch mode \label{sec:tool-process}\<close>
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   310
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   311
text \<open>
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   312
  The @{tool_def process} tool runs the raw ML process in batch mode:
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   313
  @{verbatim [display]
62634
aa3b47b32100 less physical "logic" argument, with option -l like "isabelle console" etc.;
wenzelm
parents: 62588
diff changeset
   314
\<open>Usage: isabelle process [OPTIONS]
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   315
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   316
  Options are:
62677
0df43889f496 isabelle process -T THEORY;
wenzelm
parents: 62643
diff changeset
   317
    -T THEORY    load theory
62639
699e86051e35 isabelle process -d;
wenzelm
parents: 62634
diff changeset
   318
    -d DIR       include session directory
62506
860cd901ab43 clarified isabelle_process;
wenzelm
parents: 62475
diff changeset
   319
    -e ML_EXPR   evaluate ML expression on startup
860cd901ab43 clarified isabelle_process;
wenzelm
parents: 62475
diff changeset
   320
    -f ML_FILE   evaluate ML file on startup
62634
aa3b47b32100 less physical "logic" argument, with option -l like "isabelle console" etc.;
wenzelm
parents: 62588
diff changeset
   321
    -l NAME      logic session name (default ISABELLE_LOGIC="HOL")
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   322
    -m MODE      add print mode for output
52056
fc458f304f93 added isabelle-process option -o;
wenzelm
parents: 52054
diff changeset
   323
    -o OPTION    override Isabelle system OPTION (via NAME=VAL or NAME)
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   324
62634
aa3b47b32100 less physical "logic" argument, with option -l like "isabelle console" etc.;
wenzelm
parents: 62588
diff changeset
   325
  Run the raw Isabelle ML process in batch mode.\<close>}
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   326
62643
6f7ac44365d7 eliminated without magic name;
wenzelm
parents: 62640
diff changeset
   327
  \<^medskip>
62506
860cd901ab43 clarified isabelle_process;
wenzelm
parents: 62475
diff changeset
   328
  Options \<^verbatim>\<open>-e\<close> and \<^verbatim>\<open>-f\<close> allow to evaluate ML code, before the ML process is
860cd901ab43 clarified isabelle_process;
wenzelm
parents: 62475
diff changeset
   329
  started. The source is either given literally or taken from a file. Multiple
860cd901ab43 clarified isabelle_process;
wenzelm
parents: 62475
diff changeset
   330
  \<^verbatim>\<open>-e\<close> and \<^verbatim>\<open>-f\<close> options are evaluated in the given order. Errors lead to
75161
95612f330c93 misc tuning based on comments by Heiko Eißfeldt;
wenzelm
parents: 74427
diff changeset
   331
  a premature exit of the ML process with return code 1.
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   332
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 59904
diff changeset
   333
  \<^medskip>
62677
0df43889f496 isabelle process -T THEORY;
wenzelm
parents: 62643
diff changeset
   334
  Option \<^verbatim>\<open>-T\<close> loads a specified theory file. This is a wrapper for \<^verbatim>\<open>-e\<close> with
69593
3dda49e08b9d isabelle update -u control_cartouches;
wenzelm
parents: 68541
diff changeset
   335
  a suitable \<^ML>\<open>use_thy\<close> invocation.
62677
0df43889f496 isabelle process -T THEORY;
wenzelm
parents: 62643
diff changeset
   336
0df43889f496 isabelle process -T THEORY;
wenzelm
parents: 62643
diff changeset
   337
  \<^medskip>
62639
699e86051e35 isabelle process -d;
wenzelm
parents: 62634
diff changeset
   338
  Option \<^verbatim>\<open>-l\<close> specifies the logic session name. Option \<^verbatim>\<open>-d\<close> specifies
699e86051e35 isabelle process -d;
wenzelm
parents: 62634
diff changeset
   339
  additional directories for session roots, see also \secref{sec:tool-build}.
62634
aa3b47b32100 less physical "logic" argument, with option -l like "isabelle console" etc.;
wenzelm
parents: 62588
diff changeset
   340
aa3b47b32100 less physical "logic" argument, with option -l like "isabelle console" etc.;
wenzelm
parents: 62588
diff changeset
   341
  \<^medskip>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   342
  The \<^verbatim>\<open>-m\<close> option adds identifiers of print modes to be made active for this
62573
27f90319a499 isabelle.Build uses ML_Process directly;
wenzelm
parents: 62562
diff changeset
   343
  session. For example, \<^verbatim>\<open>-m ASCII\<close> prefers ASCII replacement syntax over
27f90319a499 isabelle.Build uses ML_Process directly;
wenzelm
parents: 62562
diff changeset
   344
  mathematical Isabelle symbols.
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   345
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 59904
diff changeset
   346
  \<^medskip>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   347
  Option \<^verbatim>\<open>-o\<close> allows to override Isabelle system options for this process,
62573
27f90319a499 isabelle.Build uses ML_Process directly;
wenzelm
parents: 62562
diff changeset
   348
  see also \secref{sec:system-options}.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   349
\<close>
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   350
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   351
68275
b5d0318757f0 more examples;
wenzelm
parents: 68219
diff changeset
   352
subsubsection \<open>Examples\<close>
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   353
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   354
text \<open>
62588
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   355
  The subsequent example retrieves the \<^verbatim>\<open>Main\<close> theory value from the theory
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   356
  loader within ML:
62634
aa3b47b32100 less physical "logic" argument, with option -l like "isabelle console" etc.;
wenzelm
parents: 62588
diff changeset
   357
  @{verbatim [display] \<open>isabelle process -e 'Thy_Info.get_theory "Main"'\<close>}
62588
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   358
64509
80aaa4ff7fed documentation for Isabelle/Scala tools;
wenzelm
parents: 63995
diff changeset
   359
  Observe the delicate quoting rules for the GNU bash shell vs.\ ML. The
62588
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   360
  Isabelle/ML and Scala libraries provide functions for that, but here we need
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   361
  to do it manually.
68275
b5d0318757f0 more examples;
wenzelm
parents: 68219
diff changeset
   362
b5d0318757f0 more examples;
wenzelm
parents: 68219
diff changeset
   363
  \<^medskip>
b5d0318757f0 more examples;
wenzelm
parents: 68219
diff changeset
   364
  This is how to invoke a function body with proper return code and printing
b5d0318757f0 more examples;
wenzelm
parents: 68219
diff changeset
   365
  of errors, and without printing of a redundant \<^verbatim>\<open>val it = (): unit\<close> result:
71632
c1bc38327bc2 clarified signature;
wenzelm
parents: 71578
diff changeset
   366
  @{verbatim [display] \<open>isabelle process -e 'Command_Line.tool (fn () => writeln "OK")'\<close>}
c1bc38327bc2 clarified signature;
wenzelm
parents: 71578
diff changeset
   367
  @{verbatim [display] \<open>isabelle process -e 'Command_Line.tool (fn () => error "Bad")'\<close>}
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   368
\<close>
28238
398bf960d3d4 misc tuning and modernization;
wenzelm
parents: 28223
diff changeset
   369
398bf960d3d4 misc tuning and modernization;
wenzelm
parents: 28223
diff changeset
   370
62588
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   371
subsection \<open>Interactive mode\<close>
28238
398bf960d3d4 misc tuning and modernization;
wenzelm
parents: 28223
diff changeset
   372
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   373
text \<open>
62588
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   374
  The @{tool_def console} tool runs the raw ML process with interactive
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   375
  console and line editor:
61407
7ba7b8103565 @{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents: 61406
diff changeset
   376
  @{verbatim [display]
62588
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   377
\<open>Usage: isabelle console [OPTIONS]
28238
398bf960d3d4 misc tuning and modernization;
wenzelm
parents: 28223
diff changeset
   378
62588
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   379
  Options are:
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   380
    -d DIR       include session directory
68541
12b4b3bc585d command-line option for include_sessions;
wenzelm
parents: 68523
diff changeset
   381
    -i NAME      include session in name-space of theories
62588
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   382
    -l NAME      logic session name (default ISABELLE_LOGIC)
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   383
    -m MODE      add print mode for output
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   384
    -n           no build of session image on startup
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   385
    -o OPTION    override Isabelle system OPTION (via NAME=VAL or NAME)
62643
6f7ac44365d7 eliminated without magic name;
wenzelm
parents: 62640
diff changeset
   386
    -r           bootstrap from raw Poly/ML
28238
398bf960d3d4 misc tuning and modernization;
wenzelm
parents: 28223
diff changeset
   387
62588
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   388
  Build a logic session image and run the raw Isabelle ML process
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   389
  in interactive mode, with line editor ISABELLE_LINE_EDITOR.\<close>}
28238
398bf960d3d4 misc tuning and modernization;
wenzelm
parents: 28223
diff changeset
   390
62643
6f7ac44365d7 eliminated without magic name;
wenzelm
parents: 62640
diff changeset
   391
  \<^medskip>
62588
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   392
  Option \<^verbatim>\<open>-l\<close> specifies the logic session name. By default, its heap image is
62643
6f7ac44365d7 eliminated without magic name;
wenzelm
parents: 62640
diff changeset
   393
  checked and built on demand, but the option \<^verbatim>\<open>-n\<close> skips that.
28238
398bf960d3d4 misc tuning and modernization;
wenzelm
parents: 28223
diff changeset
   394
68541
12b4b3bc585d command-line option for include_sessions;
wenzelm
parents: 68523
diff changeset
   395
  Option \<^verbatim>\<open>-i\<close> includes additional sessions into the name-space of theories:
12b4b3bc585d command-line option for include_sessions;
wenzelm
parents: 68523
diff changeset
   396
  multiple occurrences are possible.
12b4b3bc585d command-line option for include_sessions;
wenzelm
parents: 68523
diff changeset
   397
62643
6f7ac44365d7 eliminated without magic name;
wenzelm
parents: 62640
diff changeset
   398
  Option \<^verbatim>\<open>-r\<close> indicates a bootstrap from the raw Poly/ML system, which is
6f7ac44365d7 eliminated without magic name;
wenzelm
parents: 62640
diff changeset
   399
  relevant for Isabelle/Pure development.
6f7ac44365d7 eliminated without magic name;
wenzelm
parents: 62640
diff changeset
   400
6f7ac44365d7 eliminated without magic name;
wenzelm
parents: 62640
diff changeset
   401
  \<^medskip>
62639
699e86051e35 isabelle process -d;
wenzelm
parents: 62634
diff changeset
   402
  Options \<^verbatim>\<open>-d\<close>, \<^verbatim>\<open>-m\<close>, \<^verbatim>\<open>-o\<close> have the same meaning as for @{tool process}
699e86051e35 isabelle process -d;
wenzelm
parents: 62634
diff changeset
   403
  (\secref{sec:tool-process}).
62588
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   404
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   405
  \<^medskip>
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   406
  The Isabelle/ML process is run through the line editor that is specified via
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   407
  the settings variable @{setting ISABELLE_LINE_EDITOR} (e.g.\
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   408
  @{executable_def rlwrap} for GNU readline); the fall-back is to use plain
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   409
  standard input/output.
28238
398bf960d3d4 misc tuning and modernization;
wenzelm
parents: 28223
diff changeset
   410
62588
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   411
  The user is connected to the raw ML toplevel loop: this is neither
cd266473b81b isabelle_process is superseded by "isabelle process" tool;
wenzelm
parents: 62576
diff changeset
   412
  Isabelle/Isar nor Isabelle/ML within the usual formal context. The most
69593
3dda49e08b9d isabelle update -u control_cartouches;
wenzelm
parents: 68541
diff changeset
   413
  relevant ML commands at this stage are \<^ML>\<open>use\<close> (for ML files) and
3dda49e08b9d isabelle update -u control_cartouches;
wenzelm
parents: 68541
diff changeset
   414
  \<^ML>\<open>use_thy\<close> (for theory files).
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   415
\<close>
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   416
62451
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   417
63995
2e4d80723fb0 added isabelle_java cold-start executable;
wenzelm
parents: 63680
diff changeset
   418
section \<open>The raw Isabelle Java process \label{sec:isabelle-java}\<close>
2e4d80723fb0 added isabelle_java cold-start executable;
wenzelm
parents: 63680
diff changeset
   419
2e4d80723fb0 added isabelle_java cold-start executable;
wenzelm
parents: 63680
diff changeset
   420
text \<open>
2e4d80723fb0 added isabelle_java cold-start executable;
wenzelm
parents: 63680
diff changeset
   421
  The @{executable_ref isabelle_java} executable allows to run a Java process
2e4d80723fb0 added isabelle_java cold-start executable;
wenzelm
parents: 63680
diff changeset
   422
  within the name space of Java and Scala components that are bundled with
2e4d80723fb0 added isabelle_java cold-start executable;
wenzelm
parents: 63680
diff changeset
   423
  Isabelle, but \<^emph>\<open>without\<close> the Isabelle settings environment
2e4d80723fb0 added isabelle_java cold-start executable;
wenzelm
parents: 63680
diff changeset
   424
  (\secref{sec:settings}).
2e4d80723fb0 added isabelle_java cold-start executable;
wenzelm
parents: 63680
diff changeset
   425
2e4d80723fb0 added isabelle_java cold-start executable;
wenzelm
parents: 63680
diff changeset
   426
  After such a JVM cold-start, the Isabelle environment can be accessed via
2e4d80723fb0 added isabelle_java cold-start executable;
wenzelm
parents: 63680
diff changeset
   427
  \<^verbatim>\<open>Isabelle_System.getenv\<close> as usual, but the underlying process environment
2e4d80723fb0 added isabelle_java cold-start executable;
wenzelm
parents: 63680
diff changeset
   428
  remains clean. This is e.g.\ relevant when invoking other processes that
2e4d80723fb0 added isabelle_java cold-start executable;
wenzelm
parents: 63680
diff changeset
   429
  should remain separate from the current Isabelle installation.
2e4d80723fb0 added isabelle_java cold-start executable;
wenzelm
parents: 63680
diff changeset
   430
2e4d80723fb0 added isabelle_java cold-start executable;
wenzelm
parents: 63680
diff changeset
   431
  \<^medskip>
2e4d80723fb0 added isabelle_java cold-start executable;
wenzelm
parents: 63680
diff changeset
   432
  Note that under normal circumstances, Isabelle command-line tools are run
2e4d80723fb0 added isabelle_java cold-start executable;
wenzelm
parents: 63680
diff changeset
   433
  \<^emph>\<open>within\<close> the settings environment, as provided by the @{executable
2e4d80723fb0 added isabelle_java cold-start executable;
wenzelm
parents: 63680
diff changeset
   434
  isabelle} wrapper (\secref{sec:isabelle-tool} and \secref{sec:tool-java}).
2e4d80723fb0 added isabelle_java cold-start executable;
wenzelm
parents: 63680
diff changeset
   435
\<close>
2e4d80723fb0 added isabelle_java cold-start executable;
wenzelm
parents: 63680
diff changeset
   436
2e4d80723fb0 added isabelle_java cold-start executable;
wenzelm
parents: 63680
diff changeset
   437
2e4d80723fb0 added isabelle_java cold-start executable;
wenzelm
parents: 63680
diff changeset
   438
subsubsection \<open>Example\<close>
2e4d80723fb0 added isabelle_java cold-start executable;
wenzelm
parents: 63680
diff changeset
   439
2e4d80723fb0 added isabelle_java cold-start executable;
wenzelm
parents: 63680
diff changeset
   440
text \<open>
2e4d80723fb0 added isabelle_java cold-start executable;
wenzelm
parents: 63680
diff changeset
   441
  The subsequent example creates a raw Java process on the command-line and
2e4d80723fb0 added isabelle_java cold-start executable;
wenzelm
parents: 63680
diff changeset
   442
  invokes the main Isabelle application entry point:
75291
e4d6b9bd5071 clarified module name;
wenzelm
parents: 75161
diff changeset
   443
  @{verbatim [display] \<open>isabelle_java -Djava.awt.headless=false isabelle.jedit.JEdit_Main\<close>}
63995
2e4d80723fb0 added isabelle_java cold-start executable;
wenzelm
parents: 63680
diff changeset
   444
\<close>
2e4d80723fb0 added isabelle_java cold-start executable;
wenzelm
parents: 63680
diff changeset
   445
2e4d80723fb0 added isabelle_java cold-start executable;
wenzelm
parents: 63680
diff changeset
   446
80178
438d583ab378 more documentation on "isabelle build -H" and underlying system registry tables "host" and "cluster";
wenzelm
parents: 80168
diff changeset
   447
section \<open>System registry via TOML \label{sec:system-registry}\<close>
80168
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   448
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   449
text \<open>
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   450
  Tools implemented in Isabelle/Scala may refer to a global registry of
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   451
  hierarchically structured values, which is based on a collection of TOML
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   452
  files. TOML is conceptually similar to JSON, but aims at human-readable
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   453
  syntax.
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   454
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   455
  The recursive structure of a TOML \<^emph>\<open>value\<close> is defined as follows:
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   456
    \<^enum> atom: string, integer, float, bool, date (ISO-8601)
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   457
    \<^enum> array: sequence of \<^emph>\<open>values\<close> \<open>t\<close>, written \<^verbatim>\<open>[\<close>\<open>t\<^sub>1\<close>\<^verbatim>\<open>,\<close>\<open>\<dots>\<close>\<^verbatim>\<open>,\<close>\<open>t\<^sub>n\<close>\<^verbatim>\<open>]\<close>
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   458
    \<^enum> table: mapping from \<^emph>\<open>names\<close> \<open>a\<close> to \<^emph>\<open>values\<close> \<open>t\<close>, written
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   459
      \<^verbatim>\<open>{\<close>\<open>a\<^sub>1\<close>\<^verbatim>\<open>=\<close>\<open>t\<^sub>1\<close>\<^verbatim>\<open>,\<close>\<open>\<dots>\<close>\<^verbatim>\<open>,\<close>\<open>a\<^sub>n\<close>\<^verbatim>\<open>=\<close>\<open>t\<^sub>n\<close>\<^verbatim>\<open>}\<close>
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   460
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   461
  There are various alternative syntax forms for convenience, e.g. to
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   462
  construct a table of tables, using \<^emph>\<open>header syntax\<close> that resembles
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   463
  traditional \<^verbatim>\<open>.INI\<close>-file notation. For example:
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   464
  @{verbatim [display, indent = 2]
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   465
  \<open>[point.A]
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   466
x = 1
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   467
y = 1
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   468
description = "one point"
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   469
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   470
[point.B]
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   471
x = 2
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   472
y = -2
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   473
description = "another point"
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   474
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   475
[point.C]
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   476
x = 3
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   477
y = 7
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   478
description = "yet another point"
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   479
\<close>}
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   480
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   481
  Or alternatively like this:
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   482
  @{verbatim [display, indent = 2]
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   483
  \<open>point.A.x = 1
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   484
point.A.y = 1
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   485
point.A.description = "one point"
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   486
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   487
point.B.x = 2
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   488
point.B.y = -2
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   489
point.B.description = "another point"
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   490
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   491
point.C.x = 3
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   492
point.C.y = 7
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   493
point.C.description = "yet another point"
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   494
\<close>}
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   495
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   496
  The TOML website\<^footnote>\<open>\<^url>\<open>https://toml.io/en/v1.0.0\<close>\<close> provides many examples,
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   497
  together with the full language specification. Note that the Isabelle/Scala
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   498
  implementation of TOML uses the default ISO date/time format of
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   499
  Java.\<^footnote>\<open>\<^url>\<open>https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/time/format/DateTimeFormatter.html\<close>\<close>
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   500
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   501
  \<^medskip>
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   502
  The overall system registry is collected from \<^verbatim>\<open>registry.toml\<close> files in
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   503
  directories specified via the settings variable @{setting
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   504
  "ISABELLE_REGISTRY"}: this refers to \<^path>\<open>$ISABELLE_HOME\<close> and
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   505
  \<^path>\<open>$ISABELLE_HOME_USER\<close> by default, but further directories may be
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   506
  specified via the GNU bash function \<^bash_function>\<open>isabelle_registry\<close>
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   507
  within \<^path>\<open>etc/settings\<close> of Isabelle components.
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   508
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   509
  The result is available as Isabelle/Scala object
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   510
  \<^scala>\<open>isabelle.Registry.global\<close>. That is empty by default, unless users
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   511
  populate \<^path>\<open>$ISABELLE_HOME_USER/etc/registry.toml\<close> or provide other
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   512
  component \<^path>\<open>etc/registry.toml\<close> files.
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   513
\<close>
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   514
007e6af8a020 more documentation on "System registry via TOML";
wenzelm
parents: 80161
diff changeset
   515
67904
465f43a9f780 documentation for the Isabelle server;
wenzelm
parents: 67399
diff changeset
   516
section \<open>YXML versus XML \label{sec:yxml-vs-xml}\<close>
62451
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   517
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   518
text \<open>
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   519
  Isabelle tools often use YXML, which is a simple and efficient syntax for
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   520
  untyped XML trees. The YXML format is defined as follows.
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   521
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   522
    \<^enum> The encoding is always UTF-8.
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   523
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   524
    \<^enum> Body text is represented verbatim (no escaping, no special treatment of
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   525
    white space, no named entities, no CDATA chunks, no comments).
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   526
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   527
    \<^enum> Markup elements are represented via ASCII control characters \<open>\<^bold>X = 5\<close>
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   528
    and \<open>\<^bold>Y = 6\<close> as follows:
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   529
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   530
    \begin{tabular}{ll}
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   531
      XML & YXML \\\hline
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   532
      \<^verbatim>\<open><\<close>\<open>name attribute\<close>\<^verbatim>\<open>=\<close>\<open>value \<dots>\<close>\<^verbatim>\<open>>\<close> &
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   533
      \<open>\<^bold>X\<^bold>Yname\<^bold>Yattribute\<close>\<^verbatim>\<open>=\<close>\<open>value\<dots>\<^bold>X\<close> \\
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   534
      \<^verbatim>\<open></\<close>\<open>name\<close>\<^verbatim>\<open>>\<close> & \<open>\<^bold>X\<^bold>Y\<^bold>X\<close> \\
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   535
    \end{tabular}
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   536
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   537
    There is no special case for empty body text, i.e.\ \<^verbatim>\<open><foo/>\<close> is treated
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   538
    like \<^verbatim>\<open><foo></foo>\<close>. Also note that \<open>\<^bold>X\<close> and \<open>\<^bold>Y\<close> may never occur in
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   539
    well-formed XML documents.
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   540
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   541
  Parsing YXML is pretty straight-forward: split the text into chunks
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   542
  separated by \<open>\<^bold>X\<close>, then split each chunk into sub-chunks separated by \<open>\<^bold>Y\<close>.
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   543
  Markup chunks start with an empty sub-chunk, and a second empty sub-chunk
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   544
  indicates close of an element. Any other non-empty chunk consists of plain
63680
6e1e8b5abbfa more symbols;
wenzelm
parents: 63669
diff changeset
   545
  text. For example, see \<^file>\<open>~~/src/Pure/PIDE/yxml.ML\<close> or
6e1e8b5abbfa more symbols;
wenzelm
parents: 63669
diff changeset
   546
  \<^file>\<open>~~/src/Pure/PIDE/yxml.scala\<close>.
62451
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   547
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   548
  YXML documents may be detected quickly by checking that the first two
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   549
  characters are \<open>\<^bold>X\<^bold>Y\<close>.
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   550
\<close>
040b94ffbdde removed pointless "isabelle yxml";
wenzelm
parents: 62354
diff changeset
   551
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 67044
diff changeset
   552
end