doc-src/Ref/introduction.tex
author krauss
Tue, 28 Sep 2010 09:54:07 +0200
changeset 39754 150f831ce4a3
parent 37368 1c816f2abb0e
child 39834 b5d688221d1b
permissions -rw-r--r--
no longer declare .psimps rules as [simp]. This regularly caused confusion (e.g., they show up in simp traces when the regular simp rules are disabled). In the few places where the rules are used, explicitly mentioning them actually clarifies the proof text.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3108
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
     1
286
e7efbf03562b first draft of Springer book
lcp
parents: 159
diff changeset
     2
\chapter{Basic Use of Isabelle}\index{sessions|(} 
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
     3
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
     4
\section{Basic interaction with Isabelle}
2225
78a8faae780f Added instructions on starting up
paulson
parents: 1372
diff changeset
     5
\index{starting up|bold}\nobreak
78a8faae780f Added instructions on starting up
paulson
parents: 1372
diff changeset
     6
%
6568
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
     7
We assume that your local Isabelle administrator (this might be you!) has
37368
1c816f2abb0e removed outdated/confusing INSTALL file;
wenzelm
parents: 30184
diff changeset
     8
already installed the Isabelle system together with appropriate object-logics.
3108
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
     9
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
    10
\medskip Let $\langle isabellehome \rangle$ denote the location where
3485
f27a30a18a17 Now there are TWO spaces after each full stop, so that the Emacs sentence
paulson
parents: 3200
diff changeset
    11
the distribution has been installed.  To run Isabelle from a the shell
4317
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
    12
prompt within an ordinary text terminal session, simply type
3108
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
    13
\begin{ttbox}
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
    14
\({\langle}isabellehome{\rangle}\)/bin/isabelle
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
    15
\end{ttbox}
6568
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    16
This should start an interactive \ML{} session with the default object-logic
9695
ec7d7f877712 proper setup of iman.sty/extra.sty/ttbox.sty;
wenzelm
parents: 9231
diff changeset
    17
(usually HOL) already pre-loaded.
3108
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
    18
6568
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    19
Subsequently, we assume that the \texttt{isabelle} executable is determined
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    20
automatically by the shell, e.g.\ by adding {\tt \(\langle isabellehome
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    21
  \rangle\)/bin} to your search path.\footnote{Depending on your installation,
7990
0a604b2fc2b1 updated;
wenzelm
parents: 7592
diff changeset
    22
  there may be stand-alone binaries located in some global directory such as
0a604b2fc2b1 updated;
wenzelm
parents: 7592
diff changeset
    23
  \texttt{/usr/bin}.  Do not attempt to copy {\tt \(\langle isabellehome
28504
7ad7d7d6df47 simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
wenzelm
parents: 12831
diff changeset
    24
    \rangle\)/bin/isabelle}, though!  See \texttt{isabelle install} in
7990
0a604b2fc2b1 updated;
wenzelm
parents: 7592
diff changeset
    25
  \emph{The Isabelle System Manual} of how to do this properly.}
3108
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
    26
6571
wenzelm
parents: 6569
diff changeset
    27
\medskip
wenzelm
parents: 6569
diff changeset
    28
6568
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    29
The object-logic image to load may be also specified explicitly as an argument
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    30
to the {\tt isabelle} command, e.g.
3108
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
    31
\begin{ttbox}
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
    32
isabelle FOL
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
    33
\end{ttbox}
6568
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    34
This should put you into the world of polymorphic first-order logic (assuming
9695
ec7d7f877712 proper setup of iman.sty/extra.sty/ttbox.sty;
wenzelm
parents: 9231
diff changeset
    35
that an image of FOL has been pre-built).
2225
78a8faae780f Added instructions on starting up
paulson
parents: 1372
diff changeset
    36
6568
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    37
\index{saving your session|bold} Isabelle provides no means of storing
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    38
theorems or internal proof objects on files.  Theorems are simply part of the
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    39
\ML{} state.  To save your work between sessions, you may dump the \ML{}
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    40
system state to a file.  This is done automatically when ending the session
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    41
normally (e.g.\ by typing control-D), provided that the image has been opened
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    42
\emph{writable} in the first place.  The standard object-logic images are
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    43
usually read-only, so you have to create a private working copy first.  For
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    44
example, the following shell command puts you into a writable Isabelle session
9695
ec7d7f877712 proper setup of iman.sty/extra.sty/ttbox.sty;
wenzelm
parents: 9231
diff changeset
    45
of name \texttt{Foo} that initially contains just plain HOL:
3108
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
    46
\begin{ttbox}
6568
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    47
isabelle HOL Foo
3108
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
    48
\end{ttbox}
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
    49
Ending the \texttt{Foo} session with control-D will cause the complete
6568
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    50
\ML-world to be saved somewhere in your home directory\footnote{The default
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    51
  location is in \texttt{\~\relax/isabelle/heaps}, but this depends on your
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    52
  local configuration.}.  Make sure there is enough space available! Then one
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    53
may later continue at exactly the same point by running
3108
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
    54
\begin{ttbox}
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
    55
isabelle Foo  
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
    56
\end{ttbox}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    57
6568
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    58
\medskip Saving the {\ML} state is not enough.  Record, on a file, the
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    59
top-level commands that generate your theories and proofs.  Such a record
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    60
allows you to replay the proofs whenever required, for instance after making
6571
wenzelm
parents: 6569
diff changeset
    61
minor changes to the axioms.  Ideally, these sources will be somewhat
6568
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    62
intelligible to others as a formal description of your work.
3108
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
    63
6568
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    64
It is good practice to put all source files that constitute a separate
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    65
Isabelle session into an individual directory, together with an {\ML} file
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    66
called \texttt{ROOT.ML} that contains appropriate commands to load all other
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    67
files required.  Running \texttt{isabelle} with option \texttt{-u}
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    68
automatically loads \texttt{ROOT.ML} on entering the session.  The
28504
7ad7d7d6df47 simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
wenzelm
parents: 12831
diff changeset
    69
\texttt{isabelle usedir} utility provides some more options to manage Isabelle
6568
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    70
sessions, such as automatic generation of theory browsing information.
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    71
28504
7ad7d7d6df47 simplified main Isabelle executables: removed Isabelle and isabelle (replaced by isabelle-process), renamed isatool to isabelle;
wenzelm
parents: 12831
diff changeset
    72
\medskip More details about the \texttt{isabelle} and \texttt{isabelle}
6568
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    73
commands may be found in \emph{The Isabelle System Manual}.
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    74
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    75
\medskip There are more comfortable user interfaces than the bare-bones \ML{}
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    76
top-level run from a text terminal.  The \texttt{Isabelle} executable (note
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    77
the capital I) runs one such interface, depending on your local configuration.
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
    78
Again, see \emph{The Isabelle System Manual} for more information.
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    79
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    80
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    81
\section{Ending a session}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    82
\begin{ttbox} 
3108
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
    83
quit    : unit -> unit
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
    84
exit    : int -> unit
6067
0f8ab32093ae fixed commit spec;
wenzelm
parents: 5371
diff changeset
    85
commit  : unit -> bool
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    86
\end{ttbox}
322
bacfaeeea007 penultimate Springer draft
lcp
parents: 286
diff changeset
    87
\begin{ttdescription}
3108
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
    88
\item[\ttindexbold{quit}();] ends the Isabelle session, without saving
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
    89
  the state.
4317
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
    90
  
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
    91
\item[\ttindexbold{exit} \(i\);] similar to {\tt quit}, passing return
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
    92
  code \(i\) to the operating system.
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    93
3108
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
    94
\item[\ttindexbold{commit}();] saves the current state without ending
6067
0f8ab32093ae fixed commit spec;
wenzelm
parents: 5371
diff changeset
    95
  the session, provided that the logic image is opened read-write;
0f8ab32093ae fixed commit spec;
wenzelm
parents: 5371
diff changeset
    96
  return value {\tt false} indicates an error.
322
bacfaeeea007 penultimate Springer draft
lcp
parents: 286
diff changeset
    97
\end{ttdescription}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    98
3108
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
    99
Typing control-D also finishes the session in essentially the same way
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
   100
as the sequence {\tt commit(); quit();} would.
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   101
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   102
322
bacfaeeea007 penultimate Springer draft
lcp
parents: 286
diff changeset
   103
\section{Reading ML files}
bacfaeeea007 penultimate Springer draft
lcp
parents: 286
diff changeset
   104
\index{files!reading}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   105
\begin{ttbox} 
138
9ba8bff1addc added chapter "Defining Theories" and made changes for new Readthy functions
clasohm
parents: 104
diff changeset
   106
cd              : string -> unit
884
35c836adf48f added documentation of pwd
clasohm
parents: 508
diff changeset
   107
pwd             : unit -> string
138
9ba8bff1addc added chapter "Defining Theories" and made changes for new Readthy functions
clasohm
parents: 104
diff changeset
   108
use             : string -> unit
9ba8bff1addc added chapter "Defining Theories" and made changes for new Readthy functions
clasohm
parents: 104
diff changeset
   109
time_use        : string -> unit
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   110
\end{ttbox}
322
bacfaeeea007 penultimate Springer draft
lcp
parents: 286
diff changeset
   111
\begin{ttdescription}
4317
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   112
\item[\ttindexbold{cd} "{\it dir}";] changes the current directory to
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   113
  {\it dir}.  This is the default directory for reading files.
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   114
  
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   115
\item[\ttindexbold{pwd}();] returns the full path of the current
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   116
  directory.
884
35c836adf48f added documentation of pwd
clasohm
parents: 508
diff changeset
   117
322
bacfaeeea007 penultimate Springer draft
lcp
parents: 286
diff changeset
   118
\item[\ttindexbold{use} "$file$";]  
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   119
reads the given {\it file} as input to the \ML{} session.  Reading a file
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   120
of Isabelle commands is the usual way of replaying a proof.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   121
322
bacfaeeea007 penultimate Springer draft
lcp
parents: 286
diff changeset
   122
\item[\ttindexbold{time_use} "$file$";]  
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   123
performs {\tt use~"$file$"} and prints the total execution time.
322
bacfaeeea007 penultimate Springer draft
lcp
parents: 286
diff changeset
   124
\end{ttdescription}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   125
6343
97c697a32b73 updated;
wenzelm
parents: 6067
diff changeset
   126
The $dir$ and $file$ specifications of the \texttt{cd} and \texttt{use}
97c697a32b73 updated;
wenzelm
parents: 6067
diff changeset
   127
commands may contain path variables (e.g.\ \texttt{\$ISABELLE_HOME}) that are
97c697a32b73 updated;
wenzelm
parents: 6067
diff changeset
   128
expanded appropriately.  Note that \texttt{\~\relax} abbreviates
97c697a32b73 updated;
wenzelm
parents: 6067
diff changeset
   129
\texttt{\$HOME}, and \texttt{\~\relax\~\relax} abbreviates
6571
wenzelm
parents: 6569
diff changeset
   130
\texttt{\$ISABELLE_HOME}\index{*\$ISABELLE_HOME}.  The syntax for path
wenzelm
parents: 6569
diff changeset
   131
specifications follows Unix conventions.
6568
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   132
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   133
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   134
\section{Reading theories}\label{sec:intro-theories}
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   135
\index{theories!reading}
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   136
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   137
In Isabelle, any kind of declarations, definitions, etc.\ are organized around
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   138
named \emph{theory} objects.  Logical reasoning always takes place within a
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   139
certain theory context, which may be switched at any time.  Theory $name$ is
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   140
defined by a theory file $name$\texttt{.thy}, containing declarations of
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   141
\texttt{consts}, \texttt{types}, \texttt{defs}, etc.\ (see
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   142
\S\ref{sec:ref-defining-theories} for more details on concrete syntax).
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   143
Furthermore, there may be an associated {\ML} file $name$\texttt{.ML} with
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   144
proof scripts that are to be run in the context of the theory.
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   145
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   146
\begin{ttbox}
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   147
context      : theory -> unit
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   148
the_context  : unit -> theory
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   149
theory       : string -> theory
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   150
use_thy      : string -> unit
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   151
time_use_thy : string -> unit
7136
71f6eef45713 added update_thy_only;
wenzelm
parents: 6618
diff changeset
   152
update_thy   : string -> unit
6568
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   153
\end{ttbox}
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   154
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   155
\begin{ttdescription}
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   156
  
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   157
\item[\ttindexbold{context} $thy$;] switches the current theory context.  Any
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   158
  subsequent command with ``implicit theory argument'' (e.g.\ \texttt{Goal})
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   159
  will refer to $thy$ as its theory.
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   160
  
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   161
\item[\ttindexbold{the_context}();] obtains the current theory context, or
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   162
  raises an error if absent.
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   163
  
6569
wenzelm
parents: 6568
diff changeset
   164
\item[\ttindexbold{theory} "$name$";] retrieves the theory called $name$ from
8136
8c65f3ca13f2 fixed many bad line & page breaks
paulson
parents: 7990
diff changeset
   165
  the internal data\-base of loaded theories, raising an error if absent.
6568
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   166
  
6569
wenzelm
parents: 6568
diff changeset
   167
\item[\ttindexbold{use_thy} "$name$";] reads theory $name$ from the file
6571
wenzelm
parents: 6569
diff changeset
   168
  system, looking for $name$\texttt{.thy} and $name$\texttt{.ML} (the latter
wenzelm
parents: 6569
diff changeset
   169
  being optional).  It also ensures that all parent theories are loaded as
wenzelm
parents: 6569
diff changeset
   170
  well.  In case some older versions have already been present,
wenzelm
parents: 6569
diff changeset
   171
  \texttt{use_thy} only tries to reload $name$ itself, but is content with any
wenzelm
parents: 6569
diff changeset
   172
  version of its ancestors.
6568
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   173
  
6569
wenzelm
parents: 6568
diff changeset
   174
\item[\ttindexbold{time_use_thy} "$name$";] same as \texttt{use_thy}, but
6568
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   175
  reports the time taken to process the actual theory parts and {\ML} files
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   176
  separately.
7592
wenzelm
parents: 7282
diff changeset
   177
  
7136
71f6eef45713 added update_thy_only;
wenzelm
parents: 6618
diff changeset
   178
\item[\ttindexbold{update_thy} "$name$";] is similar to \texttt{use_thy}, but
71f6eef45713 added update_thy_only;
wenzelm
parents: 6618
diff changeset
   179
  ensures that theory $name$ is fully up-to-date with respect to the file
7592
wenzelm
parents: 7282
diff changeset
   180
  system --- apart from theory $name$ itself, any of its ancestors may be
wenzelm
parents: 7282
diff changeset
   181
  reloaded as well.
6568
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   182
  
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   183
\end{ttdescription}
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   184
9695
ec7d7f877712 proper setup of iman.sty/extra.sty/ttbox.sty;
wenzelm
parents: 9231
diff changeset
   185
Note that theories of pre-built logic images (e.g.\ HOL) are marked as
7282
69d601df351c finished theories;
wenzelm
parents: 7136
diff changeset
   186
\emph{finished} and cannot be updated any more.  See \S\ref{sec:more-theories}
69d601df351c finished theories;
wenzelm
parents: 7136
diff changeset
   187
for further information on Isabelle's theory loader.
4274
2048e7a79d09 cd, use: path variables;
wenzelm
parents: 3485
diff changeset
   188
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   189
3108
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
   190
\section{Setting flags}
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
   191
\begin{ttbox}
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
   192
set     : bool ref -> bool
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
   193
reset   : bool ref -> bool
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
   194
toggle  : bool ref -> bool
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
   195
\end{ttbox}\index{*set}\index{*reset}\index{*toggle}
3485
f27a30a18a17 Now there are TWO spaces after each full stop, so that the Emacs sentence
paulson
parents: 3200
diff changeset
   196
These are some shorthands for manipulating boolean references.  The new
3108
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
   197
value is returned.
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
   198
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2225
diff changeset
   199
4317
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   200
\section{Diagnostic messages}
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   201
\index{error messages}
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   202
\index{warnings}
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   203
6568
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   204
Isabelle conceptually provides three output channels for different kinds of
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   205
messages: ordinary text, warnings, errors.  Depending on the user interface
b38bc78d9a9d theory loader stuff updated and improved;
wenzelm
parents: 6343
diff changeset
   206
involved, these messages may appear in different text styles or colours.
4317
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   207
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   208
The default setup of an \texttt{isabelle} terminal session is as
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   209
follows: plain output of ordinary text, warnings prefixed by
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   210
\texttt{\#\#\#}'s, errors prefixed by \texttt{***}'s.  For example, a
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   211
typical warning would look like this:
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   212
\begin{ttbox}
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   213
\#\#\# Beware the Jabberwock, my son!
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   214
\#\#\# The jaws that bite, the claws that catch!
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   215
\#\#\# Beware the Jubjub Bird, and shun
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   216
\#\#\# The frumious Bandersnatch!
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   217
\end{ttbox}
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   218
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   219
\texttt{ML} programs may output diagnostic messages using the
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   220
following functions:
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   221
\begin{ttbox}
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   222
writeln : string -> unit
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   223
warning : string -> unit
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   224
error   : string -> 'a
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   225
\end{ttbox}
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   226
Note that \ttindex{error} fails by raising exception \ttindex{ERROR}
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   227
after having output the text, while \ttindex{writeln} and
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   228
\ttindex{warning} resume normal program execution.
7264fa2ff2ec several minor updates;
wenzelm
parents: 4274
diff changeset
   229
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   230
30184
37969710e61f removed parts of the manual that are clearly obsolete, or covered by
wenzelm
parents: 28504
diff changeset
   231
\section{Timing}
37969710e61f removed parts of the manual that are clearly obsolete, or covered by
wenzelm
parents: 28504
diff changeset
   232
\index{timing statistics}\index{proofs!timing}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   233
\begin{ttbox} 
30184
37969710e61f removed parts of the manual that are clearly obsolete, or covered by
wenzelm
parents: 28504
diff changeset
   234
timing: bool ref \hfill{\bf initially false}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   235
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   236
322
bacfaeeea007 penultimate Springer draft
lcp
parents: 286
diff changeset
   237
\begin{ttdescription}
30184
37969710e61f removed parts of the manual that are clearly obsolete, or covered by
wenzelm
parents: 28504
diff changeset
   238
\item[set \ttindexbold{timing};] enables global timing in Isabelle.
37969710e61f removed parts of the manual that are clearly obsolete, or covered by
wenzelm
parents: 28504
diff changeset
   239
  This information is compiler-dependent.
322
bacfaeeea007 penultimate Springer draft
lcp
parents: 286
diff changeset
   240
\end{ttdescription}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   241
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   242
\index{sessions|)}
5371
e27558a68b8d emacs local vars;
wenzelm
parents: 4543
diff changeset
   243
e27558a68b8d emacs local vars;
wenzelm
parents: 4543
diff changeset
   244
e27558a68b8d emacs local vars;
wenzelm
parents: 4543
diff changeset
   245
%%% Local Variables: 
e27558a68b8d emacs local vars;
wenzelm
parents: 4543
diff changeset
   246
%%% mode: latex
e27558a68b8d emacs local vars;
wenzelm
parents: 4543
diff changeset
   247
%%% TeX-master: "ref"
e27558a68b8d emacs local vars;
wenzelm
parents: 4543
diff changeset
   248
%%% End: