doc-src/System/misc.tex
author wenzelm
Mon, 11 Aug 2008 18:37:49 +0200
changeset 27828 edafacb690a3
parent 27348 ca9fa1844fd6
permissions -rw-r--r--
renamed Markup.class to Markup.tclass, to avoid potential conflicts with spacial meaning in markup languages (e.g. HTML);
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3188
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
     1
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
     2
% $Id$
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
     3
3278
636322bfd057 release version (sort of);
wenzelm
parents: 3262
diff changeset
     4
\chapter{Miscellaneous tools} \label{ch:tools}
3188
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
     5
11031
99c4bed16b9b isatool convert;
wenzelm
parents: 9790
diff changeset
     6
Subsequently we describe various Isabelle related utilities, given in
3217
d30d62128fe5 still under construction!
wenzelm
parents: 3188
diff changeset
     7
alphabetical order.
d30d62128fe5 still under construction!
wenzelm
parents: 3188
diff changeset
     8
d30d62128fe5 still under construction!
wenzelm
parents: 3188
diff changeset
     9
11031
99c4bed16b9b isatool convert;
wenzelm
parents: 9790
diff changeset
    10
\section{Converting legacy ML scripts --- \texttt{isatool convert}}
99c4bed16b9b isatool convert;
wenzelm
parents: 9790
diff changeset
    11
99c4bed16b9b isatool convert;
wenzelm
parents: 9790
diff changeset
    12
The \tooldx{convert} utility assists in converting legacy ML proof scripts
99c4bed16b9b isatool convert;
wenzelm
parents: 9790
diff changeset
    13
into the new-style format of Isabelle/Isar:
99c4bed16b9b isatool convert;
wenzelm
parents: 9790
diff changeset
    14
\begin{ttbox}
99c4bed16b9b isatool convert;
wenzelm
parents: 9790
diff changeset
    15
Usage: convert [FILES|DIRS...]
99c4bed16b9b isatool convert;
wenzelm
parents: 9790
diff changeset
    16
99c4bed16b9b isatool convert;
wenzelm
parents: 9790
diff changeset
    17
  Recursively find .ML files, converting legacy tactic scripts to
99c4bed16b9b isatool convert;
wenzelm
parents: 9790
diff changeset
    18
  Isabelle/Isar tactic emulation.
99c4bed16b9b isatool convert;
wenzelm
parents: 9790
diff changeset
    19
  Note: conversion is only approximated, based on some heuristics.
99c4bed16b9b isatool convert;
wenzelm
parents: 9790
diff changeset
    20
99c4bed16b9b isatool convert;
wenzelm
parents: 9790
diff changeset
    21
  Renames old versions of FILES by appending "~0~".
99c4bed16b9b isatool convert;
wenzelm
parents: 9790
diff changeset
    22
  Creates new versions of FILES by appending ".thy".
99c4bed16b9b isatool convert;
wenzelm
parents: 9790
diff changeset
    23
\end{ttbox}
99c4bed16b9b isatool convert;
wenzelm
parents: 9790
diff changeset
    24
The resulting theory text uses the tactic emulation facilities of
99c4bed16b9b isatool convert;
wenzelm
parents: 9790
diff changeset
    25
Isabelle/Isar (see also \cite{isabelle-ref}, especially the ``Conversion
99c4bed16b9b isatool convert;
wenzelm
parents: 9790
diff changeset
    26
guide'' in the appendix).  Usually there is some manual tuning required to get
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    27
an automatically converted script work again --- the success rate is around
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    28
99\% for common ML scripts.
11031
99c4bed16b9b isatool convert;
wenzelm
parents: 9790
diff changeset
    29
99c4bed16b9b isatool convert;
wenzelm
parents: 9790
diff changeset
    30
14932
df56e644da8f added isatool display and isatool print;
wenzelm
parents: 13047
diff changeset
    31
\section{Displaying documents --- \texttt{isatool display}}
df56e644da8f added isatool display and isatool print;
wenzelm
parents: 13047
diff changeset
    32
df56e644da8f added isatool display and isatool print;
wenzelm
parents: 13047
diff changeset
    33
The \tooldx{display} utility displays documents in DVI format:
df56e644da8f added isatool display and isatool print;
wenzelm
parents: 13047
diff changeset
    34
\begin{ttbox}
df56e644da8f added isatool display and isatool print;
wenzelm
parents: 13047
diff changeset
    35
Usage: display [OPTIONS] FILE
df56e644da8f added isatool display and isatool print;
wenzelm
parents: 13047
diff changeset
    36
df56e644da8f added isatool display and isatool print;
wenzelm
parents: 13047
diff changeset
    37
  Options are:
df56e644da8f added isatool display and isatool print;
wenzelm
parents: 13047
diff changeset
    38
    -c           cleanup -- remove FILE after use
df56e644da8f added isatool display and isatool print;
wenzelm
parents: 13047
diff changeset
    39
df56e644da8f added isatool display and isatool print;
wenzelm
parents: 13047
diff changeset
    40
  Display document FILE (in DVI format).
df56e644da8f added isatool display and isatool print;
wenzelm
parents: 13047
diff changeset
    41
\end{ttbox}
df56e644da8f added isatool display and isatool print;
wenzelm
parents: 13047
diff changeset
    42
20572
wenzelm
parents: 17567
diff changeset
    43
\medskip The \texttt{-c} option causes the input file to be removed after use.
wenzelm
parents: 17567
diff changeset
    44
The program for viewing \texttt{dvi} files is determined by the
14932
df56e644da8f added isatool display and isatool print;
wenzelm
parents: 13047
diff changeset
    45
\texttt{DVI_VIEWER} setting.
df56e644da8f added isatool display and isatool print;
wenzelm
parents: 13047
diff changeset
    46
df56e644da8f added isatool display and isatool print;
wenzelm
parents: 13047
diff changeset
    47
3217
d30d62128fe5 still under construction!
wenzelm
parents: 3188
diff changeset
    48
\section{Viewing documentation --- \texttt{isatool doc}} \label{sec:tool-doc}
d30d62128fe5 still under construction!
wenzelm
parents: 3188
diff changeset
    49
d30d62128fe5 still under construction!
wenzelm
parents: 3188
diff changeset
    50
The \tooldx{doc} utility displays online documentation:
d30d62128fe5 still under construction!
wenzelm
parents: 3188
diff changeset
    51
\begin{ttbox}
13047
wenzelm
parents: 12464
diff changeset
    52
Usage: doc [DOC]
3217
d30d62128fe5 still under construction!
wenzelm
parents: 3188
diff changeset
    53
d30d62128fe5 still under construction!
wenzelm
parents: 3188
diff changeset
    54
  View Isabelle documentation DOC, or show list of available documents.
d30d62128fe5 still under construction!
wenzelm
parents: 3188
diff changeset
    55
\end{ttbox}
7882
wenzelm
parents: 7849
diff changeset
    56
If called without arguments, it lists all available documents. Each line
wenzelm
parents: 7849
diff changeset
    57
starts with an identifier, followed by a short description. Any of these
wenzelm
parents: 7849
diff changeset
    58
identifiers may be specified as the first argument in order to have the
wenzelm
parents: 7849
diff changeset
    59
corresponding document displayed.
3217
d30d62128fe5 still under construction!
wenzelm
parents: 3188
diff changeset
    60
7882
wenzelm
parents: 7849
diff changeset
    61
\medskip The \texttt{ISABELLE_DOCS} setting specifies the list of directories
wenzelm
parents: 7849
diff changeset
    62
(separated by colons) to be scanned for documentations.  The program for
wenzelm
parents: 7849
diff changeset
    63
viewing \texttt{dvi} files is determined by the \texttt{DVI_VIEWER} setting.
3217
d30d62128fe5 still under construction!
wenzelm
parents: 3188
diff changeset
    64
d30d62128fe5 still under construction!
wenzelm
parents: 3188
diff changeset
    65
5366
8521cd8b0a40 emacs local vars;
wenzelm
parents: 4555
diff changeset
    66
\section{Getting logic images --- \texttt{isatool findlogics}}
3217
d30d62128fe5 still under construction!
wenzelm
parents: 3188
diff changeset
    67
d30d62128fe5 still under construction!
wenzelm
parents: 3188
diff changeset
    68
The \tooldx{findlogics} utility traverses all directories specified in
7882
wenzelm
parents: 7849
diff changeset
    69
\texttt{ISABELLE_PATH}, looking for Isabelle logic images. Its usage is:
3217
d30d62128fe5 still under construction!
wenzelm
parents: 3188
diff changeset
    70
\begin{ttbox}
13047
wenzelm
parents: 12464
diff changeset
    71
Usage: findlogics
3217
d30d62128fe5 still under construction!
wenzelm
parents: 3188
diff changeset
    72
d30d62128fe5 still under construction!
wenzelm
parents: 3188
diff changeset
    73
  Collect heap file names from ISABELLE_PATH.
d30d62128fe5 still under construction!
wenzelm
parents: 3188
diff changeset
    74
\end{ttbox}
6414
wenzelm
parents: 5571
diff changeset
    75
The base names of all files found on the path are printed --- sorted and with
9790
978c635c77f6 ISABELLE_PATH: ML_IDENTIFIER no longer added;
wenzelm
parents: 7883
diff changeset
    76
duplicates removed. Also note that lookup in \texttt{ISABELLE_PATH} includes
978c635c77f6 ISABELLE_PATH: ML_IDENTIFIER no longer added;
wenzelm
parents: 7883
diff changeset
    77
the current values of \texttt{ML_SYSTEM} and \texttt{ML_PLATFORM}. Thus
978c635c77f6 ISABELLE_PATH: ML_IDENTIFIER no longer added;
wenzelm
parents: 7883
diff changeset
    78
switching to another {\ML} compiler may change the set of logic images
978c635c77f6 ISABELLE_PATH: ML_IDENTIFIER no longer added;
wenzelm
parents: 7883
diff changeset
    79
available.
3217
d30d62128fe5 still under construction!
wenzelm
parents: 3188
diff changeset
    80
3188
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
    81
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
    82
\section{Inspecting the settings environment --- \texttt{isatool getenv}}
3188
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
    83
\label{sec:tool-getenv}
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
    84
7882
wenzelm
parents: 7849
diff changeset
    85
The Isabelle settings environment --- as provided by the site-default and
wenzelm
parents: 7849
diff changeset
    86
user-specific settings files --- can be inspected with the \tooldx{getenv}
wenzelm
parents: 7849
diff changeset
    87
utility:
3188
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
    88
\begin{ttbox}
13047
wenzelm
parents: 12464
diff changeset
    89
Usage: getenv [OPTIONS] [VARNAMES ...]
3188
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
    90
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
    91
  Options are:
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
    92
    -a           display complete environment
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
    93
    -b           print values only (doesn't work for -a)
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
    94
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
    95
  Get value of VARNAMES from the Isabelle settings.
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
    96
\end{ttbox}
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
    97
7882
wenzelm
parents: 7849
diff changeset
    98
With the \texttt{-a} option, one may inspect the full process environment that
wenzelm
parents: 7849
diff changeset
    99
Isabelle related programs are run in. This usually contains much more
wenzelm
parents: 7849
diff changeset
   100
variables than are actually Isabelle settings.  Normally, output is a list of
wenzelm
parents: 7849
diff changeset
   101
lines of the form \mbox{$name$\texttt{=}$value$}. The \texttt{-b} option
wenzelm
parents: 7849
diff changeset
   102
causes only the values to be printed.
3188
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
   103
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
   104
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
   105
\subsection*{Examples}
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
   106
9790
978c635c77f6 ISABELLE_PATH: ML_IDENTIFIER no longer added;
wenzelm
parents: 7883
diff changeset
   107
Get the {\ML} system name and the location where the compiler binaries are
978c635c77f6 ISABELLE_PATH: ML_IDENTIFIER no longer added;
wenzelm
parents: 7883
diff changeset
   108
supposed to reside as follows:
3188
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
   109
\begin{ttbox}
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
   110
isatool getenv ML_SYSTEM ML_HOME
9790
978c635c77f6 ISABELLE_PATH: ML_IDENTIFIER no longer added;
wenzelm
parents: 7883
diff changeset
   111
{\out ML_SYSTEM=polyml}
978c635c77f6 ISABELLE_PATH: ML_IDENTIFIER no longer added;
wenzelm
parents: 7883
diff changeset
   112
{\out ML_HOME=/usr/share/polyml/x86-linux}
3188
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
   113
\end{ttbox}
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
   114
9790
978c635c77f6 ISABELLE_PATH: ML_IDENTIFIER no longer added;
wenzelm
parents: 7883
diff changeset
   115
The next one peeks at the output directory for \texttt{isabelle} logic images:
3188
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
   116
\begin{ttbox}
9790
978c635c77f6 ISABELLE_PATH: ML_IDENTIFIER no longer added;
wenzelm
parents: 7883
diff changeset
   117
isatool getenv -b ISABELLE_OUTPUT
978c635c77f6 ISABELLE_PATH: ML_IDENTIFIER no longer added;
wenzelm
parents: 7883
diff changeset
   118
{\out /home/me/isabelle/heaps/polyml_x86-linux}
3188
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
   119
\end{ttbox}
4555
wenzelm
parents: 4540
diff changeset
   120
Here we have used the \texttt{-b} option to suppress the
9790
978c635c77f6 ISABELLE_PATH: ML_IDENTIFIER no longer added;
wenzelm
parents: 7883
diff changeset
   121
\texttt{ISABELLE_OUTPUT=} prefix.  The value above is what became of the
4555
wenzelm
parents: 4540
diff changeset
   122
following assignment in the default settings file:
3188
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
   123
\begin{ttbox}
9790
978c635c77f6 ISABELLE_PATH: ML_IDENTIFIER no longer added;
wenzelm
parents: 7883
diff changeset
   124
ISABELLE_OUTPUT="\$ISABELLE_HOME_USER/heaps"
3188
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
   125
\end{ttbox}
9790
978c635c77f6 ISABELLE_PATH: ML_IDENTIFIER no longer added;
wenzelm
parents: 7883
diff changeset
   126
Note how the \texttt{ML_IDENTIFIER} value got appended automatically to each
978c635c77f6 ISABELLE_PATH: ML_IDENTIFIER no longer added;
wenzelm
parents: 7883
diff changeset
   127
path component. This is a special feature of \texttt{ISABELLE_OUTPUT}.
3188
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
   128
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
   129
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   130
\section{Installing standalone Isabelle executables --- \texttt{isatool install}}
7882
wenzelm
parents: 7849
diff changeset
   131
\label{sec:tool-install}
5366
8521cd8b0a40 emacs local vars;
wenzelm
parents: 4555
diff changeset
   132
7882
wenzelm
parents: 7849
diff changeset
   133
By default, the Isabelle binaries (\texttt{isabelle}, \texttt{isatool} etc.)
wenzelm
parents: 7849
diff changeset
   134
are just run from their location within the distribution directory, probably
6418
87aa3e5190e0 updated isatool install;
wenzelm
parents: 6414
diff changeset
   135
indirectly by the shell through its \texttt{PATH}.  Other schemes of
87aa3e5190e0 updated isatool install;
wenzelm
parents: 6414
diff changeset
   136
installation are supported by the \tooldx{install} utility:
5366
8521cd8b0a40 emacs local vars;
wenzelm
parents: 4555
diff changeset
   137
\begin{ttbox}
6418
87aa3e5190e0 updated isatool install;
wenzelm
parents: 6414
diff changeset
   138
Usage: install [OPTIONS]
5366
8521cd8b0a40 emacs local vars;
wenzelm
parents: 4555
diff changeset
   139
5405
2ecb74e65439 tuned isatool install;
wenzelm
parents: 5366
diff changeset
   140
  Options are:
7883
wenzelm
parents: 7882
diff changeset
   141
    -d DISTDIR   use DISTDIR as Isabelle distribution
wenzelm
parents: 7882
diff changeset
   142
                 (default ISABELLE_HOME)
6418
87aa3e5190e0 updated isatool install;
wenzelm
parents: 6414
diff changeset
   143
    -p DIR       install standalone binaries in DIR
5405
2ecb74e65439 tuned isatool install;
wenzelm
parents: 5366
diff changeset
   144
6418
87aa3e5190e0 updated isatool install;
wenzelm
parents: 6414
diff changeset
   145
  Install Isabelle executables with absolute references to the current
87aa3e5190e0 updated isatool install;
wenzelm
parents: 6414
diff changeset
   146
  distribution directory.
5366
8521cd8b0a40 emacs local vars;
wenzelm
parents: 4555
diff changeset
   147
\end{ttbox}
8521cd8b0a40 emacs local vars;
wenzelm
parents: 4555
diff changeset
   148
6418
87aa3e5190e0 updated isatool install;
wenzelm
parents: 6414
diff changeset
   149
The \texttt{-d} option overrides the current Isabelle distribution directory
87aa3e5190e0 updated isatool install;
wenzelm
parents: 6414
diff changeset
   150
as determined by \texttt{ISABELLE_HOME}.
87aa3e5190e0 updated isatool install;
wenzelm
parents: 6414
diff changeset
   151
87aa3e5190e0 updated isatool install;
wenzelm
parents: 6414
diff changeset
   152
The \texttt{-p} option installs executable wrapper scripts for
87aa3e5190e0 updated isatool install;
wenzelm
parents: 6414
diff changeset
   153
\texttt{isabelle}, \texttt{isatool}, \texttt{Isabelle}, containing proper
87aa3e5190e0 updated isatool install;
wenzelm
parents: 6414
diff changeset
   154
absolute references to the Isabelle distribution directory.  A typical
87aa3e5190e0 updated isatool install;
wenzelm
parents: 6414
diff changeset
   155
\texttt{DIR} specification would be some directory expected to be in the
87aa3e5190e0 updated isatool install;
wenzelm
parents: 6414
diff changeset
   156
shell's \texttt{PATH}, such as \texttt{/usr/local/bin}.  It is important to
87aa3e5190e0 updated isatool install;
wenzelm
parents: 6414
diff changeset
   157
note that a plain manual copy of the original Isabelle executables just would
87aa3e5190e0 updated isatool install;
wenzelm
parents: 6414
diff changeset
   158
not work!
87aa3e5190e0 updated isatool install;
wenzelm
parents: 6414
diff changeset
   159
5366
8521cd8b0a40 emacs local vars;
wenzelm
parents: 4555
diff changeset
   160
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   161
\section{Creating instances of the Isabelle logo --- \texttt{isatool
5571
3613c5d22cc6 added isatool logo;
wenzelm
parents: 5405
diff changeset
   162
    logo}}
3613c5d22cc6 added isatool logo;
wenzelm
parents: 5405
diff changeset
   163
3613c5d22cc6 added isatool logo;
wenzelm
parents: 5405
diff changeset
   164
The \tooldx{logo} utility creates any instance of the generic Isabelle logo as
3613c5d22cc6 added isatool logo;
wenzelm
parents: 5405
diff changeset
   165
an Encapsuled Postscript file (EPS):
3613c5d22cc6 added isatool logo;
wenzelm
parents: 5405
diff changeset
   166
\begin{ttbox}
3613c5d22cc6 added isatool logo;
wenzelm
parents: 5405
diff changeset
   167
Usage: logo [OPTIONS] NAME
3613c5d22cc6 added isatool logo;
wenzelm
parents: 5405
diff changeset
   168
3613c5d22cc6 added isatool logo;
wenzelm
parents: 5405
diff changeset
   169
  Create instance NAME of the Isabelle logo (as EPS).
3613c5d22cc6 added isatool logo;
wenzelm
parents: 5405
diff changeset
   170
3613c5d22cc6 added isatool logo;
wenzelm
parents: 5405
diff changeset
   171
  Options are:
3613c5d22cc6 added isatool logo;
wenzelm
parents: 5405
diff changeset
   172
    -o OUTFILE   set output file (default determined from NAME)
3613c5d22cc6 added isatool logo;
wenzelm
parents: 5405
diff changeset
   173
    -q           quiet mode
3613c5d22cc6 added isatool logo;
wenzelm
parents: 5405
diff changeset
   174
\end{ttbox}
3613c5d22cc6 added isatool logo;
wenzelm
parents: 5405
diff changeset
   175
You are encouraged to use this to create a derived logo for your Isabelle
13047
wenzelm
parents: 12464
diff changeset
   176
project.  For example, \texttt{isatool logo Bali} creates
wenzelm
parents: 12464
diff changeset
   177
\texttt{isabelle_bali.eps}.
5571
3613c5d22cc6 added isatool logo;
wenzelm
parents: 5405
diff changeset
   178
3613c5d22cc6 added isatool logo;
wenzelm
parents: 5405
diff changeset
   179
3188
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
   180
\section{Isabelle's version of make --- \texttt{isatool make}}
11616
wenzelm
parents: 11124
diff changeset
   181
\label{sec:tool-make}
3188
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
   182
3217
d30d62128fe5 still under construction!
wenzelm
parents: 3188
diff changeset
   183
The Isabelle \tooldx{make} utility is a very simple wrapper for
d30d62128fe5 still under construction!
wenzelm
parents: 3188
diff changeset
   184
ordinary Unix \texttt{make}:
3188
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
   185
\begin{ttbox}
13047
wenzelm
parents: 12464
diff changeset
   186
Usage: make [ARGS ...]
3188
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
   187
7801
535112d1f316 make: tuned usage;
wenzelm
parents: 7498
diff changeset
   188
  Compile the logic in current directory using IsaMakefile.
3188
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
   189
  ARGS are directly passed to the system make program.
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
   190
\end{ttbox}
3217
d30d62128fe5 still under construction!
wenzelm
parents: 3188
diff changeset
   191
Note that the Isabelle settings environment is also active. Thus one
3278
636322bfd057 release version (sort of);
wenzelm
parents: 3262
diff changeset
   192
may refer to its values within the \ttindex{IsaMakefile}, e.g.\ 
3217
d30d62128fe5 still under construction!
wenzelm
parents: 3188
diff changeset
   193
\texttt{\$(ISABELLE_OUTPUT)}. Furthermore, programs started from the
3278
636322bfd057 release version (sort of);
wenzelm
parents: 3262
diff changeset
   194
make file also inherit this environment.  Typically,
636322bfd057 release version (sort of);
wenzelm
parents: 3262
diff changeset
   195
\texttt{IsaMakefile}s defer the real work to the \texttt{usedir}
636322bfd057 release version (sort of);
wenzelm
parents: 3262
diff changeset
   196
utility, see \S\ref{sec:tool-usedir}.
3217
d30d62128fe5 still under construction!
wenzelm
parents: 3188
diff changeset
   197
3278
636322bfd057 release version (sort of);
wenzelm
parents: 3262
diff changeset
   198
\medskip The basic \texttt{IsaMakefile} convention is that the default
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3752
diff changeset
   199
target builds the actual logic, including its parents if appropriate.
4555
wenzelm
parents: 4540
diff changeset
   200
The \texttt{images} target is intended to build all local logic
wenzelm
parents: 4540
diff changeset
   201
images, while the \texttt{test} target shall build all related
wenzelm
parents: 4540
diff changeset
   202
examples.  The \texttt{all} target shall do \texttt{images} and
wenzelm
parents: 4540
diff changeset
   203
\texttt{test}.
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3752
diff changeset
   204
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3752
diff changeset
   205
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3752
diff changeset
   206
\subsection*{Examples}
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3752
diff changeset
   207
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3752
diff changeset
   208
Refer to the \texttt{IsaMakefile}s of the Isabelle distribution's
13047
wenzelm
parents: 12464
diff changeset
   209
object-logics as a model for your own developments.  For example, see
4555
wenzelm
parents: 4540
diff changeset
   210
\texttt{src/FOL/IsaMakefile}.
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3752
diff changeset
   211
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3752
diff changeset
   212
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   213
\section{Make all logics --- \texttt{isatool makeall}}
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3752
diff changeset
   214
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3752
diff changeset
   215
The \tooldx{makeall} utility applies Isabelle make to all logic
4555
wenzelm
parents: 4540
diff changeset
   216
directories of the distribution:
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3752
diff changeset
   217
\begin{ttbox}
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3752
diff changeset
   218
Usage: makeall [ARGS ...]
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3752
diff changeset
   219
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3752
diff changeset
   220
  Apply isatool make to all logics (passing ARGS).
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3752
diff changeset
   221
\end{ttbox}
4555
wenzelm
parents: 4540
diff changeset
   222
The arguments \texttt{ARGS} are just passed verbatim to each
4540
24fcf5ecae88 updated to Isabelle98;
wenzelm
parents: 3752
diff changeset
   223
\texttt{make} invocation.
3188
445555a7b714 preliminary!
wenzelm
parents:
diff changeset
   224
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   225
14932
df56e644da8f added isatool display and isatool print;
wenzelm
parents: 13047
diff changeset
   226
\section{Printing documents --- \texttt{isatool print}}
df56e644da8f added isatool display and isatool print;
wenzelm
parents: 13047
diff changeset
   227
df56e644da8f added isatool display and isatool print;
wenzelm
parents: 13047
diff changeset
   228
The \tooldx{print} utility prints documents:
df56e644da8f added isatool display and isatool print;
wenzelm
parents: 13047
diff changeset
   229
\begin{ttbox}
df56e644da8f added isatool display and isatool print;
wenzelm
parents: 13047
diff changeset
   230
Usage: print [OPTIONS] FILE
df56e644da8f added isatool display and isatool print;
wenzelm
parents: 13047
diff changeset
   231
df56e644da8f added isatool display and isatool print;
wenzelm
parents: 13047
diff changeset
   232
  Options are:
df56e644da8f added isatool display and isatool print;
wenzelm
parents: 13047
diff changeset
   233
    -c           cleanup -- remove FILE after use
df56e644da8f added isatool display and isatool print;
wenzelm
parents: 13047
diff changeset
   234
df56e644da8f added isatool display and isatool print;
wenzelm
parents: 13047
diff changeset
   235
  Print document FILE.
df56e644da8f added isatool display and isatool print;
wenzelm
parents: 13047
diff changeset
   236
\end{ttbox}
df56e644da8f added isatool display and isatool print;
wenzelm
parents: 13047
diff changeset
   237
df56e644da8f added isatool display and isatool print;
wenzelm
parents: 13047
diff changeset
   238
The \texttt{-c} option causes the input file to be removed after use.  The
df56e644da8f added isatool display and isatool print;
wenzelm
parents: 13047
diff changeset
   239
printer spool command is determined by the \texttt{PRINT_COMMAND} setting.
df56e644da8f added isatool display and isatool print;
wenzelm
parents: 13047
diff changeset
   240
df56e644da8f added isatool display and isatool print;
wenzelm
parents: 13047
diff changeset
   241
25629
f7c6ca73a8bd added isatool tty;
wenzelm
parents: 25435
diff changeset
   242
\section{Run Isabelle with plain tty interaction --- \texttt{isatool tty}} \label{sec:tool-tty}
f7c6ca73a8bd added isatool tty;
wenzelm
parents: 25435
diff changeset
   243
f7c6ca73a8bd added isatool tty;
wenzelm
parents: 25435
diff changeset
   244
The \tooldx{tty} utility runs the Isabelle process interactively
f7c6ca73a8bd added isatool tty;
wenzelm
parents: 25435
diff changeset
   245
within a plain terminal session:
f7c6ca73a8bd added isatool tty;
wenzelm
parents: 25435
diff changeset
   246
\begin{ttbox}
f7c6ca73a8bd added isatool tty;
wenzelm
parents: 25435
diff changeset
   247
Usage: tty [OPTIONS]
f7c6ca73a8bd added isatool tty;
wenzelm
parents: 25435
diff changeset
   248
f7c6ca73a8bd added isatool tty;
wenzelm
parents: 25435
diff changeset
   249
  Options are:
f7c6ca73a8bd added isatool tty;
wenzelm
parents: 25435
diff changeset
   250
    -l NAME      logic image name (default ISABELLE_LOGIC)
f7c6ca73a8bd added isatool tty;
wenzelm
parents: 25435
diff changeset
   251
    -m MODE      add print mode for output
f7c6ca73a8bd added isatool tty;
wenzelm
parents: 25435
diff changeset
   252
    -p NAME      line editor program name (default ISABELLE_LINE_EDITOR)
f7c6ca73a8bd added isatool tty;
wenzelm
parents: 25435
diff changeset
   253
f7c6ca73a8bd added isatool tty;
wenzelm
parents: 25435
diff changeset
   254
  Run Isabelle process with plain tty interaction, and optional line editor.
f7c6ca73a8bd added isatool tty;
wenzelm
parents: 25435
diff changeset
   255
\end{ttbox}
f7c6ca73a8bd added isatool tty;
wenzelm
parents: 25435
diff changeset
   256
f7c6ca73a8bd added isatool tty;
wenzelm
parents: 25435
diff changeset
   257
The \texttt{-l} option specifies the logic image.  The \texttt{-m}
f7c6ca73a8bd added isatool tty;
wenzelm
parents: 25435
diff changeset
   258
option specifies additional print modes.  The The \texttt{-p} option
f7c6ca73a8bd added isatool tty;
wenzelm
parents: 25435
diff changeset
   259
specifies an alternative line editor (such as the \texttt{rlwrap}
f7c6ca73a8bd added isatool tty;
wenzelm
parents: 25435
diff changeset
   260
wrapper for GNU readline); the fall-back is to use raw standard input.
f7c6ca73a8bd added isatool tty;
wenzelm
parents: 25435
diff changeset
   261
f7c6ca73a8bd added isatool tty;
wenzelm
parents: 25435
diff changeset
   262
12464
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   263
\section{Remove awkward symbol names from theory sources --- \texttt{isatool unsymbolize}}
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   264
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   265
The \tooldx{unsymbolize} utility tunes Isabelle theory sources to improve
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   266
readability for plain ASCII output (e.g.\ in email communication).  Most
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   267
notably, \texttt{unsymbolize} replaces awkward arrow symbols such as
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   268
\verb|\<Longrightarrow>| by \verb|==>|.
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   269
\begin{ttbox}
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   270
Usage: unsymbolize [FILES|DIRS...]
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   271
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   272
  Recursively find .thy/.ML files, removing unreadable symbol names.
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   273
  Note: this is an ad-hoc script; there is no systematic way to replace
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   274
  symbols independently of the inner syntax of a theory!
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   275
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   276
  Renames old versions of FILES by appending "~~".
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   277
\end{ttbox}
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   278
f9d3c92eae4d updated;
wenzelm
parents: 11616
diff changeset
   279
16257
98337d5acd0e added isatool version;
wenzelm
parents: 14932
diff changeset
   280
\section{Output the version identifier of the Isabelle distribution --- \texttt{isatool version}}
98337d5acd0e added isatool version;
wenzelm
parents: 14932
diff changeset
   281
25435
bafaea364a66 isatool version: clarify that this is the *long* form;
wenzelm
parents: 20572
diff changeset
   282
The \tooldx{version} utility outputs the full version string of the
bafaea364a66 isatool version: clarify that this is the *long* form;
wenzelm
parents: 20572
diff changeset
   283
Isabelle distribution being used, e.g.\ ``\texttt{Isabelle2007:
bafaea364a66 isatool version: clarify that this is the *long* form;
wenzelm
parents: 20572
diff changeset
   284
  November 2007}''.  There are no options nor arguments.
16257
98337d5acd0e added isatool version;
wenzelm
parents: 14932
diff changeset
   285
25629
f7c6ca73a8bd added isatool tty;
wenzelm
parents: 25435
diff changeset
   286
26578
e6511a920168 removed isatool expandshort;
wenzelm
parents: 25629
diff changeset
   287
\section{Convert XML to YXML --- \texttt{isatool yxml}}
e6511a920168 removed isatool expandshort;
wenzelm
parents: 25629
diff changeset
   288
e6511a920168 removed isatool expandshort;
wenzelm
parents: 25629
diff changeset
   289
The \tooldx{yxml} utility converts a standard XML document (stdin) to
e6511a920168 removed isatool expandshort;
wenzelm
parents: 25629
diff changeset
   290
the much simpler and more efficient YXML format of Isabelle (stdout).
e6511a920168 removed isatool expandshort;
wenzelm
parents: 25629
diff changeset
   291
The YXML format is defined as follows.
e6511a920168 removed isatool expandshort;
wenzelm
parents: 25629
diff changeset
   292
e6511a920168 removed isatool expandshort;
wenzelm
parents: 25629
diff changeset
   293
\begin{enumerate}
e6511a920168 removed isatool expandshort;
wenzelm
parents: 25629
diff changeset
   294
e6511a920168 removed isatool expandshort;
wenzelm
parents: 25629
diff changeset
   295
\item The encoding is always UTF-8.
e6511a920168 removed isatool expandshort;
wenzelm
parents: 25629
diff changeset
   296
27348
ca9fa1844fd6 YXML: no special treatment of white space;
wenzelm
parents: 26581
diff changeset
   297
\item Body text is represented verbatim (no escaping, no special
ca9fa1844fd6 YXML: no special treatment of white space;
wenzelm
parents: 26581
diff changeset
   298
  treatment of white space, no named entities, no CDATA chunks, no
ca9fa1844fd6 YXML: no special treatment of white space;
wenzelm
parents: 26581
diff changeset
   299
  comments).
26578
e6511a920168 removed isatool expandshort;
wenzelm
parents: 25629
diff changeset
   300
e6511a920168 removed isatool expandshort;
wenzelm
parents: 25629
diff changeset
   301
\item Markup elements are represented via ASCII control characters $X
e6511a920168 removed isatool expandshort;
wenzelm
parents: 25629
diff changeset
   302
  = 5$ and $Y = 6$ as follows:
e6511a920168 removed isatool expandshort;
wenzelm
parents: 25629
diff changeset
   303
e6511a920168 removed isatool expandshort;
wenzelm
parents: 25629
diff changeset
   304
  \begin{tabular}{ll}
e6511a920168 removed isatool expandshort;
wenzelm
parents: 25629
diff changeset
   305
    XML & YXML \\\hline
e6511a920168 removed isatool expandshort;
wenzelm
parents: 25629
diff changeset
   306
    \verb,<,\emph{name}~\emph{attribute}\verb,=,\emph{value}~\dots\verb,>, &
e6511a920168 removed isatool expandshort;
wenzelm
parents: 25629
diff changeset
   307
    \emph{X\,Y\,name\,Y\,attribute}\verb,=,\emph{value}\dots\emph{X} \\
e6511a920168 removed isatool expandshort;
wenzelm
parents: 25629
diff changeset
   308
    \verb,</,\emph{name}\verb,>, & \emph{X\,Y\,X} \\
e6511a920168 removed isatool expandshort;
wenzelm
parents: 25629
diff changeset
   309
  \end{tabular}
e6511a920168 removed isatool expandshort;
wenzelm
parents: 25629
diff changeset
   310
e6511a920168 removed isatool expandshort;
wenzelm
parents: 25629
diff changeset
   311
  There is no special case for empty body text, i.e.\ \verb,<foo/>, is
e6511a920168 removed isatool expandshort;
wenzelm
parents: 25629
diff changeset
   312
  treated like \verb,<foo></foo>,.  Also note that \emph{X} and
e6511a920168 removed isatool expandshort;
wenzelm
parents: 25629
diff changeset
   313
  \emph{Y} may never occur in well-formed XML documents.
e6511a920168 removed isatool expandshort;
wenzelm
parents: 25629
diff changeset
   314
e6511a920168 removed isatool expandshort;
wenzelm
parents: 25629
diff changeset
   315
\end{enumerate}
e6511a920168 removed isatool expandshort;
wenzelm
parents: 25629
diff changeset
   316
26581
wenzelm
parents: 26578
diff changeset
   317
Parsing YXML is pretty straight-forward: split the text into chunks separated
wenzelm
parents: 26578
diff changeset
   318
by \emph{X}, then split each chunk into sub-chunks separated by \emph{Y}.
wenzelm
parents: 26578
diff changeset
   319
Markup chunks start with an empty sub-chunk, and a second empty sub-chunk
wenzelm
parents: 26578
diff changeset
   320
indicates close of an element.  Any other non-empty chunk consists of plain
wenzelm
parents: 26578
diff changeset
   321
text.
26578
e6511a920168 removed isatool expandshort;
wenzelm
parents: 25629
diff changeset
   322
e6511a920168 removed isatool expandshort;
wenzelm
parents: 25629
diff changeset
   323
YXML documents may be detected quickly by checking that the first two
e6511a920168 removed isatool expandshort;
wenzelm
parents: 25629
diff changeset
   324
characters are \emph{X\,Y}.
e6511a920168 removed isatool expandshort;
wenzelm
parents: 25629
diff changeset
   325
5366
8521cd8b0a40 emacs local vars;
wenzelm
parents: 4555
diff changeset
   326
%%% Local Variables: 
8521cd8b0a40 emacs local vars;
wenzelm
parents: 4555
diff changeset
   327
%%% mode: latex
8521cd8b0a40 emacs local vars;
wenzelm
parents: 4555
diff changeset
   328
%%% TeX-master: "system"
8521cd8b0a40 emacs local vars;
wenzelm
parents: 4555
diff changeset
   329
%%% End: