src/Doc/System/Basics.thy
author wenzelm
Wed, 17 Feb 2016 23:06:24 +0100
changeset 62354 fdd6989cc8a0
parent 62013 92a2372a226b
child 62451 040b94ffbdde
permissions -rw-r--r--
SML/NJ is no longer supported;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
61656
cfabbc083977 more uniform jEdit properties;
wenzelm
parents: 61575
diff changeset
     1
(*:maxLineLen=78:*)
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
     2
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
     3
theory Basics
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>
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    10
  This manual describes Isabelle together with related tools and user
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    11
  interfaces as seen from a system oriented view. See also the \<^emph>\<open>Isabelle/Isar
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    12
  Reference Manual\<close> @{cite "isabelle-isar-ref"} for the actual Isabelle input
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    13
  language and related concepts, and \<^emph>\<open>The Isabelle/Isar Implementation
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
    14
  Manual\<close> @{cite "isabelle-implementation"} for the main concepts of the
47823
4fad76e6f4ba some manual updates;
wenzelm
parents: 47661
diff changeset
    15
  underlying implementation in Isabelle/ML.
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
    16
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 59904
diff changeset
    17
  \<^medskip>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    18
  The Isabelle system environment provides the following basic infrastructure
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    19
  to integrate tools smoothly.
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
    20
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    21
  \<^enum> The \<^emph>\<open>Isabelle settings\<close> mechanism provides process environment variables
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    22
  to all Isabelle executables (including tools and user interfaces).
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
    23
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    24
  \<^enum> The raw \<^emph>\<open>Isabelle process\<close> (@{executable_ref "isabelle_process"}) runs
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    25
  logic sessions either interactively or in batch mode. In particular, this
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    26
  view abstracts over the invocation of the actual ML system to be used.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    27
  Regular users rarely need to care about the low-level process.
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
    28
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    29
  \<^enum> The main \<^emph>\<open>Isabelle tool wrapper\<close> (@{executable_ref isabelle}) provides a
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    30
  generic startup environment Isabelle related utilities, user interfaces etc.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    31
  Such tools automatically benefit from the settings mechanism.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
    32
\<close>
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
    33
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
    34
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
    35
section \<open>Isabelle settings \label{sec:settings}\<close>
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
    36
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
    37
text \<open>
62013
92a2372a226b discontinued documentation of old browser;
wenzelm
parents: 61656
diff changeset
    38
  The Isabelle system heavily depends on the \<^emph>\<open>settings mechanism\<close>.
92a2372a226b discontinued documentation of old browser;
wenzelm
parents: 61656
diff changeset
    39
  Essentially, this is a statically scoped collection of environment
92a2372a226b discontinued documentation of old browser;
wenzelm
parents: 61656
diff changeset
    40
  variables, such as @{setting ISABELLE_HOME}, @{setting ML_SYSTEM}, @{setting
92a2372a226b discontinued documentation of old browser;
wenzelm
parents: 61656
diff changeset
    41
  ML_HOME}. These variables are \<^emph>\<open>not\<close> intended to be set directly from the
92a2372a226b discontinued documentation of old browser;
wenzelm
parents: 61656
diff changeset
    42
  shell, though. Isabelle employs a somewhat more sophisticated scheme of
92a2372a226b discontinued documentation of old browser;
wenzelm
parents: 61656
diff changeset
    43
  \<^emph>\<open>settings files\<close> --- one for site-wide defaults, another for additional
92a2372a226b discontinued documentation of old browser;
wenzelm
parents: 61656
diff changeset
    44
  user-specific modifications. With all configuration variables in clearly
92a2372a226b discontinued documentation of old browser;
wenzelm
parents: 61656
diff changeset
    45
  defined places, this scheme is more maintainable and user-friendly than
92a2372a226b discontinued documentation of old browser;
wenzelm
parents: 61656
diff changeset
    46
  global shell environment variables.
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
    47
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    48
  In particular, we avoid the typical situation where prospective users of a
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    49
  software package are told to put several things into their shell startup
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    50
  scripts, before being able to actually run the program. Isabelle requires
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    51
  none such administrative chores of its end-users --- the executables can be
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    52
  invoked straight away. Occasionally, users would still want to put the
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    53
  @{file "$ISABELLE_HOME/bin"} directory into their shell's search path, but
28238
398bf960d3d4 misc tuning and modernization;
wenzelm
parents: 28223
diff changeset
    54
  this is not required.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
    55
\<close>
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
    56
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
    57
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
    58
subsection \<open>Bootstrapping the environment \label{sec:boot}\<close>
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
    59
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    60
text \<open>
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    61
  Isabelle executables need to be run within a proper settings environment.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    62
  This is bootstrapped as described below, on the first invocation of one of
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    63
  the outer wrapper scripts (such as @{executable_ref isabelle}). This happens
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    64
  only once for each process tree, i.e.\ the environment is passed to
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    65
  subprocesses according to regular Unix conventions.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    66
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    67
    \<^enum> The special variable @{setting_def ISABELLE_HOME} is determined
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    68
    automatically from the location of the binary that has been run.
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
    69
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    70
    You should not try to set @{setting ISABELLE_HOME} manually. Also note
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    71
    that the Isabelle executables either have to be run from their original
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    72
    location in the distribution directory, or via the executable objects
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    73
    created by the @{tool install} tool. Symbolic links are admissible, but a
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    74
    plain copy of the @{file "$ISABELLE_HOME/bin"} files will not work!
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    75
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    76
    \<^enum> The file @{file "$ISABELLE_HOME/etc/settings"} is run as a
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    77
    @{executable_ref bash} shell script with the auto-export option for
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    78
    variables enabled.
28238
398bf960d3d4 misc tuning and modernization;
wenzelm
parents: 28223
diff changeset
    79
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    80
    This file holds a rather long list of shell variable assignments, thus
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    81
    providing the site-wide default settings. The Isabelle distribution
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    82
    already contains a global settings file with sensible defaults for most
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    83
    variables. When installing the system, only a few of these may have to be
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    84
    adapted (probably @{setting ML_SYSTEM} etc.).
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    85
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    86
    \<^enum> The file @{file_unchecked "$ISABELLE_HOME_USER/etc/settings"} (if it
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    87
    exists) is run in the same way as the site default settings. Note that the
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    88
    variable @{setting ISABELLE_HOME_USER} has already been set before ---
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    89
    usually to something like \<^verbatim>\<open>$USER_HOME/.isabelle/IsabelleXXXX\<close>.
61458
987533262fc2 Markdown support in document text;
wenzelm
parents: 61439
diff changeset
    90
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    91
    Thus individual users may override the site-wide defaults. Typically, a
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    92
    user settings file contains only a few lines, with some assignments that
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    93
    are actually changed. Never copy the central @{file
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    94
    "$ISABELLE_HOME/etc/settings"} file!
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
    95
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    96
  Since settings files are regular GNU @{executable_def bash} scripts, one may
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    97
  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
    98
  variables depending on the system architecture or other environment
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
    99
  variables. Such advanced features should be added only with great care,
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   100
  though. In particular, external environment references should be kept at a
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   101
  minimum.
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   102
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 59904
diff changeset
   103
  \<^medskip>
eb2463fc4d7b more symbols;
wenzelm
parents: 59904
diff changeset
   104
  A few variables are somewhat special:
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   105
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   106
    \<^item> @{setting_def ISABELLE_PROCESS} and @{setting_def ISABELLE_TOOL} are set
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   107
    automatically to the absolute path names of the @{executable
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   108
    "isabelle_process"} and @{executable isabelle} executables, respectively.
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   109
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   110
    \<^item> @{setting_ref ISABELLE_OUTPUT} will have the identifiers of the Isabelle
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   111
    distribution (cf.\ @{setting ISABELLE_IDENTIFIER}) and the ML system (cf.\
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   112
    @{setting ML_IDENTIFIER}) appended automatically to its value.
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   113
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 59904
diff changeset
   114
  \<^medskip>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   115
  Note that the settings environment may be inspected with the @{tool getenv}
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   116
  tool. This might help to figure out the effect of complex settings scripts.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   117
\<close>
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   118
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   119
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   120
subsection \<open>Common variables\<close>
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   121
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   122
text \<open>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   123
  This is a reference of common Isabelle settings variables. Note that the
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   124
  list is somewhat open-ended. Third-party utilities or interfaces may add
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   125
  their own selection. Variables that are special in some sense are marked
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   126
  with \<open>\<^sup>*\<close>.
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   127
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   128
  \<^descr>[@{setting_def USER_HOME}\<open>\<^sup>*\<close>] Is the cross-platform user home directory.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   129
  On Unix systems this is usually the same as @{setting HOME}, but on Windows
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   130
  it is the regular home directory of the user, not the one of within the
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   131
  Cygwin root file-system.\<^footnote>\<open>Cygwin itself offers another choice whether its
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   132
  HOME should point to the @{file_unchecked "/home"} directory tree or the
61572
ddb3ac3fef45 more antiquotations;
wenzelm
parents: 61503
diff changeset
   133
  Windows user home.\<close>
47661
012a887997f3 USER_HOME settings variable points to cross-platform user home directory;
wenzelm
parents: 45028
diff changeset
   134
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   135
  \<^descr>[@{setting_def ISABELLE_HOME}\<open>\<^sup>*\<close>] is the location of the top-level
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   136
  Isabelle distribution directory. This is automatically determined from the
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   137
  Isabelle executable that has been invoked. Do not attempt to set @{setting
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   138
  ISABELLE_HOME} yourself from the shell!
50182
30177ec0be36 added ISABELLE_PLATFORM_FAMILY;
wenzelm
parents: 49173
diff changeset
   139
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   140
  \<^descr>[@{setting_def ISABELLE_HOME_USER}] is the user-specific counterpart of
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   141
  @{setting ISABELLE_HOME}. The default value is relative to @{file_unchecked
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   142
  "$USER_HOME/.isabelle"}, under rare circumstances this may be changed in the
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   143
  global setting file. Typically, the @{setting ISABELLE_HOME_USER} directory
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   144
  mimics @{setting ISABELLE_HOME} to some extend. In particular, site-wide
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   145
  defaults may be overridden by a private \<^verbatim>\<open>$ISABELLE_HOME_USER/etc/settings\<close>.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   146
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   147
  \<^descr>[@{setting_def ISABELLE_PLATFORM_FAMILY}\<open>\<^sup>*\<close>] is automatically set to the
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   148
  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
   149
  platform-dependent tools usually need to refer to the more specific
30177ec0be36 added ISABELLE_PLATFORM_FAMILY;
wenzelm
parents: 49173
diff changeset
   150
  identification according to @{setting ISABELLE_PLATFORM}, @{setting
30177ec0be36 added ISABELLE_PLATFORM_FAMILY;
wenzelm
parents: 49173
diff changeset
   151
  ISABELLE_PLATFORM32}, @{setting ISABELLE_PLATFORM64}.
30177ec0be36 added ISABELLE_PLATFORM_FAMILY;
wenzelm
parents: 49173
diff changeset
   152
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   153
  \<^descr>[@{setting_def ISABELLE_PLATFORM}\<open>\<^sup>*\<close>] is automatically set to a symbolic
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   154
  identifier for the underlying hardware and operating system. The Isabelle
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   155
  platform identification always refers to the 32 bit variant, even this is a
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   156
  64 bit machine. Note that the ML or Java runtime may have a different idea,
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   157
  depending on which binaries are actually run.
36196
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents: 33952
diff changeset
   158
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   159
  \<^descr>[@{setting_def ISABELLE_PLATFORM64}\<open>\<^sup>*\<close>] is similar to @{setting
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   160
  ISABELLE_PLATFORM} but refers to the proper 64 bit variant on a platform
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   161
  that supports this; the value is empty for 32 bit. Note that the following
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   162
  bash expression (including the quotes) prefers the 64 bit platform, if that
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   163
  is available:
47823
4fad76e6f4ba some manual updates;
wenzelm
parents: 47661
diff changeset
   164
61407
7ba7b8103565 @{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents: 61406
diff changeset
   165
  @{verbatim [display] \<open>"${ISABELLE_PLATFORM64:-$ISABELLE_PLATFORM}"\<close>}
36196
cbb9ee265cdd added ISABELLE_PLATFORM and ISABELLE_PLATFORM64 -- NB: ML and JVM may have a different idea;
wenzelm
parents: 33952
diff changeset
   166
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   167
  \<^descr>[@{setting_def ISABELLE_PROCESS}\<open>\<^sup>*\<close>, @{setting ISABELLE_TOOL}\<open>\<^sup>*\<close>] are
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   168
  automatically set to the full path names of the @{executable
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   169
  "isabelle_process"} and @{executable isabelle} executables, respectively.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   170
  Thus other tools and scripts need not assume that the @{file
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   171
  "$ISABELLE_HOME/bin"} directory is on the current search path of the shell.
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   172
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   173
  \<^descr>[@{setting_def ISABELLE_IDENTIFIER}\<open>\<^sup>*\<close>] refers to the name of this
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   174
  Isabelle distribution, e.g.\ ``\<^verbatim>\<open>Isabelle2012\<close>''.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   175
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   176
  \<^descr>[@{setting_def ML_SYSTEM}, @{setting_def ML_HOME}, @{setting_def
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   177
  ML_OPTIONS}, @{setting_def ML_PLATFORM}, @{setting_def ML_IDENTIFIER}\<open>\<^sup>*\<close>]
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   178
  specify the underlying ML system to be used for Isabelle. There is only a
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   179
  fixed set of admissable @{setting ML_SYSTEM} names (see the @{file
28238
398bf960d3d4 misc tuning and modernization;
wenzelm
parents: 28223
diff changeset
   180
  "$ISABELLE_HOME/etc/settings"} file of the distribution).
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   181
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   182
  The actual compiler binary will be run from the directory @{setting
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   183
  ML_HOME}, with @{setting ML_OPTIONS} as first arguments on the command line.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   184
  The optional @{setting ML_PLATFORM} may specify the binary format of ML heap
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   185
  images, which is useful for cross-platform installations. The value of
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   186
  @{setting ML_IDENTIFIER} is automatically obtained by composing the values
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   187
  of @{setting ML_SYSTEM}, @{setting ML_PLATFORM} and the Isabelle version
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   188
  values.
47823
4fad76e6f4ba some manual updates;
wenzelm
parents: 47661
diff changeset
   189
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   190
  \<^descr>[@{setting_def ISABELLE_JDK_HOME}] needs to point to a full JDK (Java
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   191
  Development Kit) installation with \<^verbatim>\<open>javac\<close> and \<^verbatim>\<open>jar\<close> executables. This is
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   192
  essential for Isabelle/Scala and other JVM-based tools to work properly.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   193
  Note that conventional \<^verbatim>\<open>JAVA_HOME\<close> usually points to the JRE (Java Runtime
47823
4fad76e6f4ba some manual updates;
wenzelm
parents: 47661
diff changeset
   194
  Environment), not JDK.
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   195
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   196
  \<^descr>[@{setting_def ISABELLE_PATH}] is a list of directories (separated by
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   197
  colons) where Isabelle logic images may reside. When looking up heaps files,
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   198
  the value of @{setting ML_IDENTIFIER} is appended to each component
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   199
  internally.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   200
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   201
  \<^descr>[@{setting_def ISABELLE_OUTPUT}\<open>\<^sup>*\<close>] is a directory where output heap files
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   202
  should be stored by default. The ML system and Isabelle version identifier
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   203
  is appended here, too.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   204
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   205
  \<^descr>[@{setting_def ISABELLE_BROWSER_INFO}] is the directory where theory
62013
92a2372a226b discontinued documentation of old browser;
wenzelm
parents: 61656
diff changeset
   206
  browser information is stored as HTML and PDF (see also \secref{sec:info}).
92a2372a226b discontinued documentation of old browser;
wenzelm
parents: 61656
diff changeset
   207
  The default value is @{file_unchecked "$ISABELLE_HOME_USER/browser_info"}.
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   208
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   209
  \<^descr>[@{setting_def ISABELLE_LOGIC}] specifies the default logic to load if none
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   210
  is given explicitely by the user. The default value is \<^verbatim>\<open>HOL\<close>.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   211
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   212
  \<^descr>[@{setting_def ISABELLE_LINE_EDITOR}] specifies the line editor for the
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   213
  @{tool_ref console} interface.
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   214
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   215
  \<^descr>[@{setting_def ISABELLE_LATEX}, @{setting_def ISABELLE_PDFLATEX},
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   216
  @{setting_def ISABELLE_BIBTEX}] refer to {\LaTeX} related tools for Isabelle
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   217
  document preparation (see also \secref{sec:tool-latex}).
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   218
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   219
  \<^descr>[@{setting_def ISABELLE_TOOLS}] is a colon separated list of directories
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   220
  that are scanned by @{executable isabelle} for external utility programs
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   221
  (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
   222
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   223
  \<^descr>[@{setting_def ISABELLE_DOCS}] is a colon separated list of directories
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   224
  with documentation files.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   225
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   226
  \<^descr>[@{setting_def PDF_VIEWER}] specifies the program to be used for displaying
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   227
  \<^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
   228
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   229
  \<^descr>[@{setting_def DVI_VIEWER}] specifies the program to be used for displaying
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   230
  \<^verbatim>\<open>dvi\<close> files.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   231
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   232
  \<^descr>[@{setting_def ISABELLE_TMP_PREFIX}\<open>\<^sup>*\<close>] is the prefix from which any
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   233
  running @{executable "isabelle_process"} derives an individual directory for
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   234
  temporary files.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   235
\<close>
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   236
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   237
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   238
subsection \<open>Additional components \label{sec:components}\<close>
32323
8185d3bfcbf1 tuned "Bootstrapping the environment";
wenzelm
parents: 32088
diff changeset
   239
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   240
text \<open>
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   241
  Any directory may be registered as an explicit \<^emph>\<open>Isabelle component\<close>. The
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   242
  general layout conventions are that of the main Isabelle distribution
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   243
  itself, and the following two files (both optional) have a special meaning:
32323
8185d3bfcbf1 tuned "Bootstrapping the environment";
wenzelm
parents: 32088
diff changeset
   244
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   245
    \<^item> \<^verbatim>\<open>etc/settings\<close> holds additional settings that are initialized when
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   246
    bootstrapping the overall Isabelle environment, cf.\ \secref{sec:boot}. As
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   247
    usual, the content is interpreted as a \<^verbatim>\<open>bash\<close> script. It may refer to the
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   248
    component's enclosing directory via the \<^verbatim>\<open>COMPONENT\<close> shell variable.
32323
8185d3bfcbf1 tuned "Bootstrapping the environment";
wenzelm
parents: 32088
diff changeset
   249
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   250
    For example, the following setting allows to refer to files within the
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   251
    component later on, without having to hardwire absolute paths:
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   252
    @{verbatim [display] \<open>MY_COMPONENT_HOME="$COMPONENT"\<close>}
32323
8185d3bfcbf1 tuned "Bootstrapping the environment";
wenzelm
parents: 32088
diff changeset
   253
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   254
    Components can also add to existing Isabelle settings such as
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   255
    @{setting_def ISABELLE_TOOLS}, in order to provide component-specific
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   256
    tools that can be invoked by end-users. For example:
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   257
    @{verbatim [display] \<open>ISABELLE_TOOLS="$ISABELLE_TOOLS:$COMPONENT/lib/Tools"\<close>}
32323
8185d3bfcbf1 tuned "Bootstrapping the environment";
wenzelm
parents: 32088
diff changeset
   258
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   259
    \<^item> \<^verbatim>\<open>etc/components\<close> holds a list of further sub-components of the same
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   260
    structure. The directory specifications given here can be either absolute
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   261
    (with leading \<^verbatim>\<open>/\<close>) or relative to the component's main directory.
32323
8185d3bfcbf1 tuned "Bootstrapping the environment";
wenzelm
parents: 32088
diff changeset
   262
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   263
  The root of component initialization is @{setting ISABELLE_HOME} itself.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   264
  After initializing all of its sub-components recursively, @{setting
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   265
  ISABELLE_HOME_USER} is included in the same manner (if that directory
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   266
  exists). This allows to install private components via @{file_unchecked
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   267
  "$ISABELLE_HOME_USER/etc/components"}, although it is often more convenient
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   268
  to do that programmatically via the \<^verbatim>\<open>init_component\<close> shell function in the
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   269
  \<^verbatim>\<open>etc/settings\<close> script of \<^verbatim>\<open>$ISABELLE_HOME_USER\<close> (or any other component
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   270
  directory). For example:
61407
7ba7b8103565 @{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents: 61406
diff changeset
   271
  @{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
   272
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   273
  This is tolerant wrt.\ missing component directories, but might produce a
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   274
  warning.
48838
623ba165d059 direct support for component forests via init_components;
wenzelm
parents: 48813
diff changeset
   275
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 59904
diff changeset
   276
  \<^medskip>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   277
  More complex situations may be addressed by initializing components listed
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   278
  in a given catalog file, relatively to some base directory:
61407
7ba7b8103565 @{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents: 61406
diff changeset
   279
  @{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
   280
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   281
  The component directories listed in the catalog file are treated as relative
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   282
  to the given base directory.
48844
6408fb6f7d81 some explanations on isabelle components;
wenzelm
parents: 48838
diff changeset
   283
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   284
  See also \secref{sec:tool-components} for some tool-support for resolving
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   285
  components that are formally initialized but not installed yet.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   286
\<close>
32323
8185d3bfcbf1 tuned "Bootstrapping the environment";
wenzelm
parents: 32088
diff changeset
   287
8185d3bfcbf1 tuned "Bootstrapping the environment";
wenzelm
parents: 32088
diff changeset
   288
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   289
section \<open>The raw Isabelle process \label{sec:isabelle-process}\<close>
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   290
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   291
text \<open>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   292
  The @{executable_def "isabelle_process"} executable runs bare-bones Isabelle
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   293
  logic sessions --- either interactively or in batch mode. It provides an
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   294
  abstraction over the underlying ML system, and over the actual heap file
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   295
  locations. Its usage is:
61407
7ba7b8103565 @{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents: 61406
diff changeset
   296
  @{verbatim [display]
7ba7b8103565 @{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents: 61406
diff changeset
   297
\<open>Usage: isabelle_process [OPTIONS] [INPUT] [OUTPUT]
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   298
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   299
  Options are:
57581
74bbe9317aa4 provide explicit options file -- avoid multiple Scala/JVM invocation;
wenzelm
parents: 57439
diff changeset
   300
    -O           system options from given YXML file
59350
acba5d6fdb2f discontinued fifo channel, always use portable socket;
wenzelm
parents: 58846
diff changeset
   301
    -P SOCKET    startup process wrapper via TCP socket
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   302
    -S           secure mode -- disallow critical operations
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   303
    -e MLTEXT    pass MLTEXT to the ML session
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   304
    -m MODE      add print mode for output
52056
fc458f304f93 added isabelle-process option -o;
wenzelm
parents: 52054
diff changeset
   305
    -o OPTION    override Isabelle system OPTION (via NAME=VAL or NAME)
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   306
    -q           non-interactive session
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   307
    -r           open heap file read-only
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   308
    -w           reset write permissions on OUTPUT
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   309
61407
7ba7b8103565 @{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents: 61406
diff changeset
   310
  INPUT (default "$ISABELLE_LOGIC") and OUTPUT specify in/out heaps.
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   311
  These are either names to be searched in the Isabelle path, or
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   312
  actual file names (containing at least one /).
61407
7ba7b8103565 @{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents: 61406
diff changeset
   313
  If INPUT is "RAW_ML_SYSTEM", just start the bare bones ML system.\<close>}
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   314
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   315
  Input files without path specifications are looked up in the @{setting
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   316
  ISABELLE_PATH} setting, which may consist of multiple components separated
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   317
  by colons --- these are tried in the given order with the value of @{setting
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   318
  ML_IDENTIFIER} appended internally. In a similar way, base names are
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   319
  relative to the directory specified by @{setting ISABELLE_OUTPUT}. In any
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   320
  case, actual file locations may also be given by including at least one
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   321
  slash (\<^verbatim>\<open>/\<close>) in the name (hint: use \<^verbatim>\<open>./\<close> to refer to the current
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   322
  directory).
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   323
\<close>
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   324
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   325
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   326
subsubsection \<open>Options\<close>
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   327
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   328
text \<open>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   329
  If the input heap file does not have write permission bits set, or the \<^verbatim>\<open>-r\<close>
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   330
  option is given explicitly, then the session started will be read-only. That
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   331
  is, the ML world cannot be committed back into the image file. Otherwise, a
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   332
  writable session enables commits into either the input file, or into another
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   333
  output heap file (if that is given as the second argument on the command
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   334
  line).
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   335
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   336
  The read-write state of sessions is determined at startup only, it cannot be
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   337
  changed intermediately. Also note that heap images may require considerable
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   338
  amounts of disk space (hundreds of MB or some GB). Users are responsible for
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   339
  themselves to dispose their heap files when they are no longer needed.
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   340
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 59904
diff changeset
   341
  \<^medskip>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   342
  The \<^verbatim>\<open>-w\<close> option makes the output heap file read-only after terminating.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   343
  Thus subsequent invocations cause the logic image to be read-only
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   344
  automatically.
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
  Using the \<^verbatim>\<open>-e\<close> option, arbitrary ML code may be passed to the Isabelle
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   348
  session from the command line. Multiple \<^verbatim>\<open>-e\<close> options are evaluated in the
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   349
  given order. Strange things may happen when erroneous ML code is provided.
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   350
  Also make sure that the ML commands are terminated properly by semicolon.
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   351
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 59904
diff changeset
   352
  \<^medskip>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   353
  The \<^verbatim>\<open>-m\<close> option adds identifiers of print modes to be made active for this
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   354
  session. Typically, this is used by some user interface, e.g.\ to enable
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   355
  output of proper mathematical symbols.
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   356
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 59904
diff changeset
   357
  \<^medskip>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   358
  Isabelle normally enters an interactive top-level loop (after processing the
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   359
  \<^verbatim>\<open>-e\<close> texts). The \<^verbatim>\<open>-q\<close> option inhibits interaction, thus providing a pure
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   360
  batch mode facility.
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   361
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 59904
diff changeset
   362
  \<^medskip>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   363
  Option \<^verbatim>\<open>-o\<close> allows to override Isabelle system options for this process,
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   364
  see also \secref{sec:system-options}. Alternatively, option \<^verbatim>\<open>-O\<close> specifies
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   365
  the full environment of system options as a file in YXML format (according
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   366
  to the Isabelle/Scala function \<^verbatim>\<open>isabelle.Options.encode\<close>).
52056
fc458f304f93 added isabelle-process option -o;
wenzelm
parents: 52054
diff changeset
   367
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 59904
diff changeset
   368
  \<^medskip>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   369
  The \<^verbatim>\<open>-P\<close> option starts the Isabelle process wrapper for Isabelle/Scala,
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   370
  with a private protocol running over the specified TCP socket. Isabelle/ML
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   371
  and Isabelle/Scala provide various programming interfaces to invoke protocol
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   372
  functions over untyped strings and XML trees.
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   373
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 59904
diff changeset
   374
  \<^medskip>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   375
  The \<^verbatim>\<open>-S\<close> option makes the Isabelle process more secure by disabling some
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   376
  critical operations, notably runtime compilation and evaluation of ML source
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   377
  code.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   378
\<close>
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   379
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   380
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   381
subsubsection \<open>Examples\<close>
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   382
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   383
text \<open>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   384
  Run an interactive session of the default object-logic (as specified by the
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   385
  @{setting ISABELLE_LOGIC} setting) like this:
61407
7ba7b8103565 @{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents: 61406
diff changeset
   386
  @{verbatim [display] \<open>isabelle_process\<close>}
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   387
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   388
  Usually @{setting ISABELLE_LOGIC} refers to one of the standard logic
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   389
  images, which are read-only by default. A writable session --- based on
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   390
  \<^verbatim>\<open>HOL\<close>, but output to \<^verbatim>\<open>Test\<close> (in the directory specified by the @{setting
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   391
  ISABELLE_OUTPUT} setting) --- may be invoked as follows:
61407
7ba7b8103565 @{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents: 61406
diff changeset
   392
  @{verbatim [display] \<open>isabelle_process HOL Test\<close>}
7ba7b8103565 @{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents: 61406
diff changeset
   393
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   394
  Ending this session normally (e.g.\ by typing control-D) dumps the whole ML
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   395
  system state into \<^verbatim>\<open>Test\<close> (be prepared for more than 100\,MB):
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   396
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   397
  The \<^verbatim>\<open>Test\<close> session may be continued later (still in writable state) by:
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   398
  @{verbatim [display] \<open>isabelle_process Test\<close>}
61407
7ba7b8103565 @{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents: 61406
diff changeset
   399
61503
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
   400
  A read-only \<^verbatim>\<open>Test\<close> session may be started by:
61407
7ba7b8103565 @{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents: 61406
diff changeset
   401
  @{verbatim [display] \<open>isabelle_process -r Test\<close>}
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   402
61406
eb2463fc4d7b more symbols;
wenzelm
parents: 59904
diff changeset
   403
  \<^bigskip>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   404
  The next example demonstrates batch execution of Isabelle. We retrieve the
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   405
  \<^verbatim>\<open>Main\<close> theory value from the theory loader within ML (observe the delicate
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   406
  quoting rules for the Bash shell vs.\ ML):
61407
7ba7b8103565 @{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents: 61406
diff changeset
   407
  @{verbatim [display] \<open>isabelle_process -e 'Thy_Info.get_theory "Main";' -q -r HOL\<close>}
7ba7b8103565 @{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents: 61406
diff changeset
   408
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   409
  Note that the output text will be interspersed with additional junk messages
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   410
  by the ML runtime environment. The \<^verbatim>\<open>-W\<close> option allows to communicate with
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   411
  the Isabelle process via an external program in a more robust fashion.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   412
\<close>
28238
398bf960d3d4 misc tuning and modernization;
wenzelm
parents: 28223
diff changeset
   413
398bf960d3d4 misc tuning and modernization;
wenzelm
parents: 28223
diff changeset
   414
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   415
section \<open>The Isabelle tool wrapper \label{sec:isabelle-tool}\<close>
28238
398bf960d3d4 misc tuning and modernization;
wenzelm
parents: 28223
diff changeset
   416
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   417
text \<open>
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   418
  All Isabelle related tools and interfaces are called via a common wrapper
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   419
  --- @{executable isabelle}:
61407
7ba7b8103565 @{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents: 61406
diff changeset
   420
  @{verbatim [display]
7ba7b8103565 @{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents: 61406
diff changeset
   421
\<open>Usage: isabelle TOOL [ARGS ...]
28238
398bf960d3d4 misc tuning and modernization;
wenzelm
parents: 28223
diff changeset
   422
28506
3ab515ee4e6f tuned isabelle usage;
wenzelm
parents: 28504
diff changeset
   423
  Start Isabelle tool NAME with ARGS; pass "-?" for tool specific help.
28238
398bf960d3d4 misc tuning and modernization;
wenzelm
parents: 28223
diff changeset
   424
48858
86816c61b5ca tuned message;
wenzelm
parents: 48844
diff changeset
   425
Available tools:
61407
7ba7b8103565 @{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents: 61406
diff changeset
   426
  ...\<close>}
28238
398bf960d3d4 misc tuning and modernization;
wenzelm
parents: 28223
diff changeset
   427
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   428
  In principle, Isabelle tools are ordinary executable scripts that are run
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   429
  within the Isabelle settings environment, see \secref{sec:settings}. The set
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   430
  of available tools is collected by @{executable isabelle} from the
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   431
  directories listed in the @{setting ISABELLE_TOOLS} setting. Do not try to
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   432
  call the scripts directly from the shell. Neither should you add the tool
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   433
  directories to your shell's search path!
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   434
\<close>
28238
398bf960d3d4 misc tuning and modernization;
wenzelm
parents: 28223
diff changeset
   435
398bf960d3d4 misc tuning and modernization;
wenzelm
parents: 28223
diff changeset
   436
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   437
subsubsection \<open>Examples\<close>
28238
398bf960d3d4 misc tuning and modernization;
wenzelm
parents: 28223
diff changeset
   438
61575
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   439
text \<open>
f18f6e51e901 tuned whitespace;
wenzelm
parents: 61572
diff changeset
   440
  Show the list of available documentation of the Isabelle distribution:
61407
7ba7b8103565 @{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents: 61406
diff changeset
   441
  @{verbatim [display] \<open>isabelle doc\<close>}
28238
398bf960d3d4 misc tuning and modernization;
wenzelm
parents: 28223
diff changeset
   442
398bf960d3d4 misc tuning and modernization;
wenzelm
parents: 28223
diff changeset
   443
  View a certain document as follows:
61407
7ba7b8103565 @{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents: 61406
diff changeset
   444
  @{verbatim [display] \<open>isabelle doc system\<close>}
28238
398bf960d3d4 misc tuning and modernization;
wenzelm
parents: 28223
diff changeset
   445
48813
wenzelm
parents: 48602
diff changeset
   446
  Query the Isabelle settings environment:
61407
7ba7b8103565 @{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents: 61406
diff changeset
   447
  @{verbatim [display] \<open>isabelle getenv ISABELLE_HOME_USER\<close>}
58618
782f0b662cae more cartouches;
wenzelm
parents: 58553
diff changeset
   448
\<close>
28215
a1cfc43ac47d converted basics.tex to theory file;
wenzelm
parents:
diff changeset
   449
28223
wenzelm
parents: 28215
diff changeset
   450
end