doc-src/System/Thy/Misc.thy
author wenzelm
Wed, 08 Aug 2012 14:45:40 +0200
changeset 48736 292b97e17fb7
parent 48722 a5e3ba7cbb2a
child 48814 d488a5f25bf6
permissions -rw-r--r--
discontinued obsolete "isabelle makeall";
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
28224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
     1
theory Misc
43564
9864182c6bad document antiquotations are managed as theory data, with proper name space and entity markup;
wenzelm
parents: 41512
diff changeset
     2
imports Base
28224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
     3
begin
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
     4
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
     5
chapter {* Miscellaneous tools \label{ch:tools} *}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
     6
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
     7
text {*
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
     8
  Subsequently we describe various Isabelle related utilities, given
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
     9
  in alphabetical order.
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    10
*}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    11
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    12
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    13
section {* Displaying documents *}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    14
48602
342ca8f3197b more uniform usage of "isabelle tool";
wenzelm
parents: 48577
diff changeset
    15
text {* The @{tool_def display} tool displays documents in DVI or PDF
28224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    16
  format:
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    17
\begin{ttbox}
48602
342ca8f3197b more uniform usage of "isabelle tool";
wenzelm
parents: 48577
diff changeset
    18
Usage: isabelle display [OPTIONS] FILE
28224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    19
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    20
  Options are:
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    21
    -c           cleanup -- remove FILE after use
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    22
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    23
  Display document FILE (in DVI format).
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    24
\end{ttbox}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    25
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    26
  \medskip The @{verbatim "-c"} option causes the input file to be
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    27
  removed after use.  The program for viewing @{verbatim dvi} files is
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    28
  determined by the @{setting DVI_VIEWER} setting.
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    29
*}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    30
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    31
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    32
section {* Viewing documentation \label{sec:tool-doc} *}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    33
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    34
text {*
48602
342ca8f3197b more uniform usage of "isabelle tool";
wenzelm
parents: 48577
diff changeset
    35
  The @{tool_def doc} tool displays online documentation:
28224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    36
\begin{ttbox}
48602
342ca8f3197b more uniform usage of "isabelle tool";
wenzelm
parents: 48577
diff changeset
    37
Usage: isabelle doc [DOC]
28224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    38
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    39
  View Isabelle documentation DOC, or show list of available documents.
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    40
\end{ttbox}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    41
  If called without arguments, it lists all available documents. Each
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    42
  line starts with an identifier, followed by a short description. Any
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    43
  of these identifiers may be specified as the first argument in order
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    44
  to have the corresponding document displayed.
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    45
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    46
  \medskip The @{setting ISABELLE_DOCS} setting specifies the list of
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    47
  directories (separated by colons) to be scanned for documentations.
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    48
  The program for viewing @{verbatim dvi} files is determined by the
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    49
  @{setting DVI_VIEWER} setting.
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    50
*}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    51
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    52
47828
e6e1b670520b some coverage of isabelle env;
wenzelm
parents: 47827
diff changeset
    53
section {* Shell commands within the settings environment \label{sec:tool-env} *}
e6e1b670520b some coverage of isabelle env;
wenzelm
parents: 47827
diff changeset
    54
48602
342ca8f3197b more uniform usage of "isabelle tool";
wenzelm
parents: 48577
diff changeset
    55
text {* The @{tool_def env} tool is a direct wrapper for the standard
342ca8f3197b more uniform usage of "isabelle tool";
wenzelm
parents: 48577
diff changeset
    56
  @{verbatim "/usr/bin/env"} command on POSIX systems, running within
342ca8f3197b more uniform usage of "isabelle tool";
wenzelm
parents: 48577
diff changeset
    57
  the Isabelle settings environment (\secref{sec:settings}).
47828
e6e1b670520b some coverage of isabelle env;
wenzelm
parents: 47827
diff changeset
    58
e6e1b670520b some coverage of isabelle env;
wenzelm
parents: 47827
diff changeset
    59
  The command-line arguments are that of the underlying version of
e6e1b670520b some coverage of isabelle env;
wenzelm
parents: 47827
diff changeset
    60
  @{verbatim env}.  For example, the following invokes an instance of
e6e1b670520b some coverage of isabelle env;
wenzelm
parents: 47827
diff changeset
    61
  the GNU Bash shell within the Isabelle environment:
e6e1b670520b some coverage of isabelle env;
wenzelm
parents: 47827
diff changeset
    62
\begin{alltt}
e6e1b670520b some coverage of isabelle env;
wenzelm
parents: 47827
diff changeset
    63
  isabelle env bash
e6e1b670520b some coverage of isabelle env;
wenzelm
parents: 47827
diff changeset
    64
\end{alltt}
e6e1b670520b some coverage of isabelle env;
wenzelm
parents: 47827
diff changeset
    65
*}
e6e1b670520b some coverage of isabelle env;
wenzelm
parents: 47827
diff changeset
    66
e6e1b670520b some coverage of isabelle env;
wenzelm
parents: 47827
diff changeset
    67
28224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    68
section {* Getting logic images *}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    69
48602
342ca8f3197b more uniform usage of "isabelle tool";
wenzelm
parents: 48577
diff changeset
    70
text {* The @{tool_def findlogics} tool traverses all directories
28224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    71
  specified in @{setting ISABELLE_PATH}, looking for Isabelle logic
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    72
  images. Its usage is:
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    73
\begin{ttbox}
48577
wenzelm
parents: 47828
diff changeset
    74
Usage: isabelle findlogics
28224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    75
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    76
  Collect heap file names from ISABELLE_PATH.
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    77
\end{ttbox}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    78
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    79
  The base names of all files found on the path are printed --- sorted
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    80
  and with duplicates removed. Also note that lookup in @{setting
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    81
  ISABELLE_PATH} includes the current values of @{setting ML_SYSTEM}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    82
  and @{setting ML_PLATFORM}. Thus switching to another ML compiler
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    83
  may change the set of logic images available.
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    84
*}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    85
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    86
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    87
section {* Inspecting the settings environment \label{sec:tool-getenv} *}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    88
48602
342ca8f3197b more uniform usage of "isabelle tool";
wenzelm
parents: 48577
diff changeset
    89
text {* The Isabelle settings environment --- as provided by the
28224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    90
  site-default and user-specific settings files --- can be inspected
48602
342ca8f3197b more uniform usage of "isabelle tool";
wenzelm
parents: 48577
diff changeset
    91
  with the @{tool_def getenv} tool:
28224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    92
\begin{ttbox}
48602
342ca8f3197b more uniform usage of "isabelle tool";
wenzelm
parents: 48577
diff changeset
    93
Usage: isabelle getenv [OPTIONS] [VARNAMES ...]
28224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    94
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    95
  Options are:
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    96
    -a           display complete environment
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
    97
    -b           print values only (doesn't work for -a)
31497
5333aa739082 isabelle getenv: option -d;
wenzelm
parents: 28916
diff changeset
    98
    -d FILE      dump complete environment to FILE
5333aa739082 isabelle getenv: option -d;
wenzelm
parents: 28916
diff changeset
    99
                 (null terminated entries)
28224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   100
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   101
  Get value of VARNAMES from the Isabelle settings.
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   102
\end{ttbox}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   103
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   104
  With the @{verbatim "-a"} option, one may inspect the full process
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   105
  environment that Isabelle related programs are run in. This usually
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   106
  contains much more variables than are actually Isabelle settings.
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   107
  Normally, output is a list of lines of the form @{text
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   108
  name}@{verbatim "="}@{text value}. The @{verbatim "-b"} option
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   109
  causes only the values to be printed.
31497
5333aa739082 isabelle getenv: option -d;
wenzelm
parents: 28916
diff changeset
   110
5333aa739082 isabelle getenv: option -d;
wenzelm
parents: 28916
diff changeset
   111
  Option @{verbatim "-d"} produces a dump of the complete environment
5333aa739082 isabelle getenv: option -d;
wenzelm
parents: 28916
diff changeset
   112
  to the specified file.  Entries are terminated by the ASCII null
5333aa739082 isabelle getenv: option -d;
wenzelm
parents: 28916
diff changeset
   113
  character, i.e.\ the C string terminator.
28224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   114
*}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   115
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   116
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   117
subsubsection {* Examples *}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   118
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   119
text {*
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   120
  Get the ML system name and the location where the compiler binaries
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   121
  are supposed to reside as follows:
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   122
\begin{ttbox}
28504
7ad7d7d6df47 simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
wenzelm
parents: 28253
diff changeset
   123
isabelle getenv ML_SYSTEM ML_HOME
28224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   124
{\out ML_SYSTEM=polyml}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   125
{\out ML_HOME=/usr/share/polyml/x86-linux}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   126
\end{ttbox}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   127
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   128
  The next one peeks at the output directory for Isabelle logic
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   129
  images:
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   130
\begin{ttbox}
28504
7ad7d7d6df47 simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
wenzelm
parents: 28253
diff changeset
   131
isabelle getenv -b ISABELLE_OUTPUT
28224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   132
{\out /home/me/isabelle/heaps/polyml_x86-linux}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   133
\end{ttbox}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   134
  Here we have used the @{verbatim "-b"} option to suppress the
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   135
  @{verbatim "ISABELLE_OUTPUT="} prefix.  The value above is what
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   136
  became of the following assignment in the default settings file:
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   137
\begin{ttbox}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   138
ISABELLE_OUTPUT="\$ISABELLE_HOME_USER/heaps"
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   139
\end{ttbox}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   140
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   141
  Note how the @{setting ML_IDENTIFIER} value got appended
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   142
  automatically to each path component. This is a special feature of
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   143
  @{setting ISABELLE_OUTPUT}.
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   144
*}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   145
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   146
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   147
section {* Installing standalone Isabelle executables \label{sec:tool-install} *}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   148
48602
342ca8f3197b more uniform usage of "isabelle tool";
wenzelm
parents: 48577
diff changeset
   149
text {* By default, the main Isabelle binaries (@{executable
342ca8f3197b more uniform usage of "isabelle tool";
wenzelm
parents: 48577
diff changeset
   150
  "isabelle"} etc.)  are just run from their location within the
342ca8f3197b more uniform usage of "isabelle tool";
wenzelm
parents: 48577
diff changeset
   151
  distribution directory, probably indirectly by the shell through its
342ca8f3197b more uniform usage of "isabelle tool";
wenzelm
parents: 48577
diff changeset
   152
  @{setting PATH}.  Other schemes of installation are supported by the
342ca8f3197b more uniform usage of "isabelle tool";
wenzelm
parents: 48577
diff changeset
   153
  @{tool_def install} tool:
28224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   154
\begin{ttbox}
48602
342ca8f3197b more uniform usage of "isabelle tool";
wenzelm
parents: 48577
diff changeset
   155
Usage: isabelle install [OPTIONS]
28224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   156
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   157
  Options are:
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   158
    -d DISTDIR   use DISTDIR as Isabelle distribution
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   159
                 (default ISABELLE_HOME)
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   160
    -p DIR       install standalone binaries in DIR
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   161
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   162
  Install Isabelle executables with absolute references to the current
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   163
  distribution directory.
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   164
\end{ttbox}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   165
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   166
  The @{verbatim "-d"} option overrides the current Isabelle
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   167
  distribution directory as determined by @{setting ISABELLE_HOME}.
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   168
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   169
  The @{verbatim "-p"} option installs executable wrapper scripts for
28504
7ad7d7d6df47 simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
wenzelm
parents: 28253
diff changeset
   170
  @{executable "isabelle-process"}, @{executable isabelle},
28238
398bf960d3d4 misc tuning and modernization;
wenzelm
parents: 28224
diff changeset
   171
  @{executable Isabelle}, containing proper absolute references to the
398bf960d3d4 misc tuning and modernization;
wenzelm
parents: 28224
diff changeset
   172
  Isabelle distribution directory.  A typical @{verbatim DIR}
398bf960d3d4 misc tuning and modernization;
wenzelm
parents: 28224
diff changeset
   173
  specification would be some directory expected to be in the shell's
398bf960d3d4 misc tuning and modernization;
wenzelm
parents: 28224
diff changeset
   174
  @{setting PATH}, such as @{verbatim "/usr/local/bin"}.  It is
398bf960d3d4 misc tuning and modernization;
wenzelm
parents: 28224
diff changeset
   175
  important to note that a plain manual copy of the original Isabelle
398bf960d3d4 misc tuning and modernization;
wenzelm
parents: 28224
diff changeset
   176
  executables does not work, since it disrupts the integrity of the
398bf960d3d4 misc tuning and modernization;
wenzelm
parents: 28224
diff changeset
   177
  Isabelle distribution.
28224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   178
*}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   179
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   180
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   181
section {* Creating instances of the Isabelle logo *}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   182
48602
342ca8f3197b more uniform usage of "isabelle tool";
wenzelm
parents: 48577
diff changeset
   183
text {* The @{tool_def logo} tool creates any instance of the generic
28224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   184
  Isabelle logo as an Encapsuled Postscript file (EPS):
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   185
\begin{ttbox}
48602
342ca8f3197b more uniform usage of "isabelle tool";
wenzelm
parents: 48577
diff changeset
   186
Usage: isabelle logo [OPTIONS] NAME
28224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   187
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   188
  Create instance NAME of the Isabelle logo (as EPS).
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   189
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   190
  Options are:
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   191
    -o OUTFILE   set output file (default determined from NAME)
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   192
    -q           quiet mode
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   193
\end{ttbox}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   194
  You are encouraged to use this to create a derived logo for your
48602
342ca8f3197b more uniform usage of "isabelle tool";
wenzelm
parents: 48577
diff changeset
   195
  Isabelle project.  For example, @{tool logo}~@{verbatim Bali}
342ca8f3197b more uniform usage of "isabelle tool";
wenzelm
parents: 48577
diff changeset
   196
  creates @{verbatim isabelle_bali.eps}.  *}
28224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   197
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   198
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   199
section {* Isabelle's version of make \label{sec:tool-make} *}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   200
48602
342ca8f3197b more uniform usage of "isabelle tool";
wenzelm
parents: 48577
diff changeset
   201
text {* The @{tool_def make} tool is a very simple wrapper for
28224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   202
  ordinary Unix @{executable make}:
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   203
\begin{ttbox}
48602
342ca8f3197b more uniform usage of "isabelle tool";
wenzelm
parents: 48577
diff changeset
   204
Usage: isabelle make [ARGS ...]
28224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   205
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   206
  Compile the logic in current directory using IsaMakefile.
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   207
  ARGS are directly passed to the system make program.
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   208
\end{ttbox}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   209
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   210
  Note that the Isabelle settings environment is also active. Thus one
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   211
  may refer to its values within the @{verbatim IsaMakefile}, e.g.\
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   212
  @{verbatim "$(ISABELLE_OUTPUT)"}. Furthermore, programs started from
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   213
  the make file also inherit this environment.  Typically, @{verbatim
48602
342ca8f3197b more uniform usage of "isabelle tool";
wenzelm
parents: 48577
diff changeset
   214
  IsaMakefile}s defer the real work to @{tool_ref usedir}.
28224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   215
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   216
  \medskip The basic @{verbatim IsaMakefile} convention is that the
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   217
  default target builds the actual logic, including its parents if
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   218
  appropriate.  The @{verbatim images} target is intended to build all
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   219
  local logic images, while the @{verbatim test} target shall build
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   220
  all related examples.  The @{verbatim all} target shall do
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   221
  @{verbatim images} and @{verbatim test}.
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   222
*}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   223
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   225
section {* Printing documents *}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   226
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   227
text {*
48602
342ca8f3197b more uniform usage of "isabelle tool";
wenzelm
parents: 48577
diff changeset
   228
  The @{tool_def print} tool prints documents:
28224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   229
\begin{ttbox}
48602
342ca8f3197b more uniform usage of "isabelle tool";
wenzelm
parents: 48577
diff changeset
   230
Usage: isabelle print [OPTIONS] FILE
28224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   231
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   232
  Options are:
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   233
    -c           cleanup -- remove FILE after use
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   234
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   235
  Print document FILE.
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   236
\end{ttbox}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   237
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   238
  The @{verbatim "-c"} option causes the input file to be removed
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   239
  after use.  The printer spool command is determined by the @{setting
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   240
  PRINT_COMMAND} setting.
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   241
*}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   242
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   243
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   244
section {* Remove awkward symbol names from theory sources *}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   245
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   246
text {*
48602
342ca8f3197b more uniform usage of "isabelle tool";
wenzelm
parents: 48577
diff changeset
   247
  The @{tool_def unsymbolize} tool tunes Isabelle theory sources to
28224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   248
  improve readability for plain ASCII output (e.g.\ in email
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   249
  communication).  Most notably, @{tool unsymbolize} replaces awkward
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   250
  arrow symbols such as @{verbatim "\\"}@{verbatim "<Longrightarrow>"}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   251
  by @{verbatim "==>"}.
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   252
\begin{ttbox}
48602
342ca8f3197b more uniform usage of "isabelle tool";
wenzelm
parents: 48577
diff changeset
   253
Usage: isabelle unsymbolize [FILES|DIRS...]
28224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   254
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   255
  Recursively find .thy/.ML files, removing unreadable symbol names.
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   256
  Note: this is an ad-hoc script; there is no systematic way to replace
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   257
  symbols independently of the inner syntax of a theory!
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   258
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   259
  Renames old versions of FILES by appending "~~".
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   260
\end{ttbox}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   261
*}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   262
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   263
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   264
section {* Output the version identifier of the Isabelle distribution *}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   265
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   266
text {*
48602
342ca8f3197b more uniform usage of "isabelle tool";
wenzelm
parents: 48577
diff changeset
   267
  The @{tool_def version} tool displays Isabelle version information:
41511
2fe62d602681 isabelle version -i;
wenzelm
parents: 40800
diff changeset
   268
\begin{ttbox}
2fe62d602681 isabelle version -i;
wenzelm
parents: 40800
diff changeset
   269
Usage: isabelle version [OPTIONS]
2fe62d602681 isabelle version -i;
wenzelm
parents: 40800
diff changeset
   270
2fe62d602681 isabelle version -i;
wenzelm
parents: 40800
diff changeset
   271
  Options are:
2fe62d602681 isabelle version -i;
wenzelm
parents: 40800
diff changeset
   272
    -i           short identification (derived from Mercurial id)
2fe62d602681 isabelle version -i;
wenzelm
parents: 40800
diff changeset
   273
2fe62d602681 isabelle version -i;
wenzelm
parents: 40800
diff changeset
   274
  Display Isabelle version information.
2fe62d602681 isabelle version -i;
wenzelm
parents: 40800
diff changeset
   275
\end{ttbox}
2fe62d602681 isabelle version -i;
wenzelm
parents: 40800
diff changeset
   276
2fe62d602681 isabelle version -i;
wenzelm
parents: 40800
diff changeset
   277
  \medskip The default is to output the full version string of the
47827
13530d774a21 updated system manual for release;
wenzelm
parents: 44799
diff changeset
   278
  Isabelle distribution, e.g.\ ``@{verbatim "Isabelle2012: May 2012"}.
41511
2fe62d602681 isabelle version -i;
wenzelm
parents: 40800
diff changeset
   279
2fe62d602681 isabelle version -i;
wenzelm
parents: 40800
diff changeset
   280
  The @{verbatim "-i"} option produces a short identification derived
2fe62d602681 isabelle version -i;
wenzelm
parents: 40800
diff changeset
   281
  from the Mercurial id of the @{setting ISABELLE_HOME} directory.
28224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   282
*}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   283
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   284
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   285
section {* Convert XML to YXML *}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   286
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   287
text {*
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   288
  The @{tool_def yxml} tool converts a standard XML document (stdin)
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   289
  to the much simpler and more efficient YXML format of Isabelle
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   290
  (stdout).  The YXML format is defined as follows.
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   291
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   292
  \begin{enumerate}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   293
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   294
  \item The encoding is always UTF-8.
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   295
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   296
  \item Body text is represented verbatim (no escaping, no special
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   297
  treatment of white space, no named entities, no CDATA chunks, no
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   298
  comments).
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   299
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   300
  \item Markup elements are represented via ASCII control characters
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   301
  @{text "\<^bold>X = 5"} and @{text "\<^bold>Y = 6"} as follows:
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   302
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   303
  \begin{tabular}{ll}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   304
    XML & YXML \\\hline
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   305
    @{verbatim "<"}@{text "name attribute"}@{verbatim "="}@{text "value \<dots>"}@{verbatim ">"} &
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   306
    @{text "\<^bold>X\<^bold>Yname\<^bold>Yattribute"}@{verbatim "="}@{text "value\<dots>\<^bold>X"} \\
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   307
    @{verbatim "</"}@{text name}@{verbatim ">"} & @{text "\<^bold>X\<^bold>Y\<^bold>X"} \\
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   308
  \end{tabular}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   309
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   310
  There is no special case for empty body text, i.e.\ @{verbatim
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   311
  "<foo/>"} is treated like @{verbatim "<foo></foo>"}.  Also note that
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   312
  @{text "\<^bold>X"} and @{text "\<^bold>Y"} may never occur in
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   313
  well-formed XML documents.
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   314
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   315
  \end{enumerate}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   316
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   317
  Parsing YXML is pretty straight-forward: split the text into chunks
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   318
  separated by @{text "\<^bold>X"}, then split each chunk into
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   319
  sub-chunks separated by @{text "\<^bold>Y"}.  Markup chunks start
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   320
  with an empty sub-chunk, and a second empty sub-chunk indicates
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   321
  close of an element.  Any other non-empty chunk consists of plain
44799
1fd0a1276a09 updated file locations;
wenzelm
parents: 43564
diff changeset
   322
  text.  For example, see @{file "~~/src/Pure/PIDE/yxml.ML"} or
1fd0a1276a09 updated file locations;
wenzelm
parents: 43564
diff changeset
   323
  @{file "~~/src/Pure/PIDE/yxml.scala"}.
28224
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   324
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   325
  YXML documents may be detected quickly by checking that the first
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   326
  two characters are @{text "\<^bold>X\<^bold>Y"}.
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   327
*}
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   328
10487d954a8f converted misc.tex;
wenzelm
parents:
diff changeset
   329
end