doc-src/IsarImplementation/Thy/prelim.thy
author wenzelm
Tue, 29 Aug 2006 18:56:11 +0200
changeset 20430 fd646e926983
parent 20429 116255c9209b
child 20437 0eb5e30fd620
permissions -rw-r--r--
tuned;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
18537
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
     1
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
     2
(* $Id$ *)
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
     3
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
     4
theory prelim imports base begin
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
     5
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
     6
chapter {* Preliminaries *}
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
     7
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
     8
section {* Named entities *}
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
     9
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    10
text {* Named entities of different kinds (logical constant, type,
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    11
type class, theorem, method etc.) live in separate name spaces.  It is
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    12
usually clear from the occurrence of a name which kind of entity it
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    13
refers to.  For example, proof method @{text "foo"} vs.\ theorem
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    14
@{text "foo"} vs.\ logical constant @{text "foo"} are easily
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    15
distinguished by means of the syntactic context.  A notable exception
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    16
are logical identifiers within a term (\secref{sec:terms}): constants,
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    17
fixed variables, and bound variables all share the same identifier
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    18
syntax, but are distinguished by their scope.
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    19
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    20
Each name space is organized as a collection of \emph{qualified
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    21
names}, which consist of a sequence of basic name components separated
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    22
by dots: @{text "Bar.bar.foo"}, @{text "Bar.foo"}, and @{text "foo"}
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    23
are examples for valid qualified names.  Name components are
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    24
subdivided into \emph{symbols}, which constitute the smallest textual
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    25
unit in Isabelle --- raw characters are normally not encountered
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    26
directly. *}
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    27
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    28
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    29
subsection {* Strings of symbols *}
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    30
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    31
text {* Isabelle strings consist of a sequence of
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    32
symbols\glossary{Symbol}{The smalles unit of text in Isabelle,
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    33
subsumes plain ASCII characters as well as an infinite collection of
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    34
named symbols (for greek, math etc.).}, which are either packed as an
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    35
actual @{text "string"}, or represented as a list.  Each symbol is in
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    36
itself a small string of the following form:
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    37
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    38
\begin{enumerate}
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    39
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    40
\item either a singleton ASCII character ``@{text "c"}'' (with
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    41
character code 0--127), for example ``\verb,a,'',
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    42
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    43
\item or a regular symbol ``\verb,\,\verb,<,@{text "ident"}\verb,>,'',
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    44
for example ``\verb,\,\verb,<alpha>,'',
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    45
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    46
\item or a control symbol ``\verb,\,\verb,<^,@{text
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    47
"ident"}\verb,>,'', for example ``\verb,\,\verb,<^bold>,'',
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    48
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    49
\item or a raw control symbol ``\verb,\,\verb,<^raw:,@{text
20205
7b2958d3d575 raw symbols: disallow dot to avoid confusion in NameSpace.unpack;
wenzelm
parents: 18554
diff changeset
    50
"\<dots>"}\verb,>,'' where ``@{text "\<dots>"}'' refers to any
7b2958d3d575 raw symbols: disallow dot to avoid confusion in NameSpace.unpack;
wenzelm
parents: 18554
diff changeset
    51
printable ASCII character (excluding ``\verb,.,'' and ``\verb,>,'') or
20214
525f934b438b fixed LaTeX problem;
wenzelm
parents: 20205
diff changeset
    52
non-ASCII character, for example ``\verb,\,\verb,<^raw:$\sum_{i = 1}^n$>,'',
18537
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    53
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    54
\item or a numbered raw control symbol ``\verb,\,\verb,<^raw,@{text
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    55
"nnn"}\verb,>, where @{text "nnn"} are digits, for example
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    56
``\verb,\,\verb,<^raw42>,''.
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    57
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    58
\end{enumerate}
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    59
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    60
The @{text "ident"} syntax for symbol names is @{text "letter (letter
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    61
| digit)\<^sup>*"}, where @{text "letter = A..Za..Z"} and @{text
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    62
"digit = 0..9"}.  There are infinitely many regular symbols and
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    63
control symbols available, but a certain collection of standard
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    64
symbols is treated specifically.  For example,
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    65
``\verb,\,\verb,<alpha>,'' is classified as a (non-ASCII) letter,
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    66
which means it may occur within regular Isabelle identifier syntax.
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    67
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    68
Output of symbols depends on the print mode (\secref{sec:print-mode}).
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    69
For example, the standard {\LaTeX} setup of the Isabelle document
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    70
preparation system would present ``\verb,\,\verb,<alpha>,'' as @{text
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    71
"\<alpha>"}, and ``\verb,\,\verb,<^bold>,\verb,\,\verb,<alpha>,'' as @{text
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    72
"\<^bold>\<alpha>"}.
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    73
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    74
\medskip It is important to note that the character set underlying
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    75
Isabelle symbols is plain 7-bit ASCII.  Since 8-bit characters are
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    76
passed through transparently, Isabelle may easily process actual
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    77
Unicode/UCS data (using the well-known UTF-8 encoding, for example).
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    78
Unicode provides its own collection of mathematical symbols, but there
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    79
is presently no link to Isabelle's named ones; both kinds of symbols
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    80
coexist independently. *}
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    81
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    82
text %mlref {*
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    83
  \begin{mldecls}
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    84
  @{index_ML_type "Symbol.symbol"} \\
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    85
  @{index_ML Symbol.explode: "string -> Symbol.symbol list"} \\
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    86
  @{index_ML Symbol.is_letter: "Symbol.symbol -> bool"} \\
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    87
  @{index_ML Symbol.is_digit: "Symbol.symbol -> bool"} \\
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    88
  @{index_ML Symbol.is_quasi: "Symbol.symbol -> bool"} \\
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    89
  @{index_ML Symbol.is_blank: "Symbol.symbol -> bool"} \\
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    90
  @{index_ML_type "Symbol.sym"} \\
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    91
  @{index_ML Symbol.decode: "Symbol.symbol -> Symbol.sym"} \\
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    92
  \end{mldecls}
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    93
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    94
  \begin{description}
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    95
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    96
  \item @{ML_type "Symbol.symbol"} represents Isabelle symbols; this type
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    97
  is merely an alias for @{ML_type "string"}, but emphasizes the
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    98
  specific format encountered here.
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
    99
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   100
  \item @{ML "Symbol.explode"}~@{text "s"} produces an actual symbol
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   101
  list from the packed form usually encountered as user input.  This
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   102
  function replaces @{ML "String.explode"} for virtually all purposes
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   103
  of manipulating text in Isabelle!  Plain @{text "implode"} may be
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   104
  used for the reverse operation.
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   105
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   106
  \item @{ML "Symbol.is_letter"}, @{ML "Symbol.is_digit"}, @{ML
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   107
  "Symbol.is_quasi"}, @{ML "Symbol.is_blank"} classify certain symbols
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   108
  (both ASCII and several named ones) according to fixed syntactic
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   109
  convections of Isabelle, e.g.\ see \cite{isabelle-isar-ref}.
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   110
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   111
  \item @{ML_type "Symbol.sym"} is a concrete datatype that represents
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   112
  the different kinds of symbols explicitly as @{ML "Symbol.Char"},
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   113
  @{ML "Symbol.Sym"}, @{ML "Symbol.Ctrl"}, or @{ML "Symbol.Raw"}.
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   114
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   115
  \item @{ML "Symbol.decode"} converts the string representation of a
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   116
  symbol into the explicit datatype version.
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   117
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   118
  \end{description}
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   119
*}
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   120
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   121
20429
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   122
subsection {* Simple names *}
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   123
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   124
text FIXME
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   125
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   126
18537
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   127
subsection {* Qualified names and name spaces *}
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   128
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   129
text %FIXME {* Qualified names are constructed according to implicit naming
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   130
principles of the present context.
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   131
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   132
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   133
The last component is called \emph{base name}; the remaining prefix of
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   134
qualification may be empty.
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   135
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   136
Some practical conventions help to organize named entities more
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   137
systematically:
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   138
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   139
\begin{itemize}
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   140
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   141
\item Names are qualified first by the theory name, second by an
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   142
optional ``structure''.  For example, a constant @{text "c"} declared
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   143
as part of a certain structure @{text "b"} (say a type definition) in
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   144
theory @{text "A"} will be named @{text "A.b.c"} internally.
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   145
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   146
\item
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   147
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   148
\item
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   149
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   150
\item
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   151
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   152
\item
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   153
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   154
\end{itemize}
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   155
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   156
Names of different kinds of entities are basically independent, but
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   157
some practical naming conventions relate them to each other.  For
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   158
example, a constant @{text "foo"} may be accompanied with theorems
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   159
@{text "foo.intro"}, @{text "foo.elim"}, @{text "foo.simps"} etc.  The
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   160
same may happen for a type @{text "foo"}, which is then apt to cause
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   161
clashes in the theorem name space!  To avoid this, we occasionally
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   162
follow an additional convention of suffixes that determine the
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   163
original kind of entity that a name has been derived.  For example,
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   164
constant @{text "foo"} is associated with theorem @{text "foo.intro"},
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   165
type @{text "foo"} with theorem @{text "foo_type.intro"}, and type
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   166
class @{text "foo"} with @{text "foo_class.intro"}.
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   167
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   168
*}
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   169
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   170
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   171
section {* Structured output *}
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   172
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   173
subsection {* Pretty printing *}
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   174
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   175
text FIXME
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   176
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   177
subsection {* Output channels *}
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   178
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   179
text FIXME
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   180
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   181
subsection {* Print modes *}
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   182
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   183
text FIXME
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   184
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   185
20429
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   186
section {* Contexts \label{sec:context} *}
18537
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   187
20429
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   188
text {*
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   189
  A logical context represents the background that is taken for
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   190
  granted when formulating statements and composing proofs.  It acts
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   191
  as a medium to produce formal content, depending on earlier material
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   192
  (declarations, results etc.).
18537
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   193
20429
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   194
  In particular, derivations within the primitive Pure logic can be
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   195
  described as a judgment @{text "\<Gamma> \<turnstile>\<^sub>\<Theta> \<phi>"}, meaning that a
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   196
  proposition @{text "\<phi>"} is derivable from hypotheses @{text "\<Gamma>"}
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   197
  within the theory @{text "\<Theta>"}.  There are logical reasons for
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   198
  keeping @{text "\<Theta>"} and @{text "\<Gamma>"} separate: theories support type
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   199
  constructors and schematic polymorphism of constants and axioms,
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   200
  while the inner calculus of @{text "\<Gamma> \<turnstile> \<phi>"} is limited to Simple
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   201
  Type Theory (with fixed type variables in the assumptions).
18537
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   202
20429
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   203
  \medskip Contexts and derivations are linked by the following key
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   204
  principles:
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   205
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   206
  \begin{itemize}
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   207
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   208
  \item Transfer: monotonicity of derivations admits results to be
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   209
  transferred into a larger context, i.e.\ @{text "\<Gamma> \<turnstile>\<^sub>\<Theta> \<phi>"}
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   210
  implies @{text "\<Gamma>' \<turnstile>\<^sub>\<Theta>\<^sub>' \<phi>"} for contexts @{text "\<Theta>' \<supseteq>
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   211
  \<Theta>"} and @{text "\<Gamma>' \<supseteq> \<Gamma>"}.
18537
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   212
20429
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   213
  \item Export: discharge of hypotheses admits results to be exported
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   214
  into a smaller context, i.e.\ @{text "\<Gamma>' \<turnstile>\<^sub>\<Theta> \<phi>"} implies
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   215
  @{text "\<Gamma> \<turnstile>\<^sub>\<Theta> \<Delta> \<Longrightarrow> \<phi>"} where @{text "\<Gamma>' \<supseteq> \<Gamma>"} and @{text "\<Delta> =
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   216
  \<Gamma>' - \<Gamma>"}.  Note that @{text "\<Theta>"} remains unchanged here, only the
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   217
  @{text "\<Gamma>"} part is affected.
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   218
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   219
  \end{itemize}
18537
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   220
20429
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   221
  \medskip Isabelle/Isar provides two different notions of abstract
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   222
  containers called \emph{theory context} and \emph{proof context},
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   223
  respectively.  These model the main characteristics of the primitive
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   224
  @{text "\<Theta>"} and @{text "\<Gamma>"} above, without subscribing to any
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   225
  particular kind of content yet.  Instead, contexts merely impose a
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   226
  certain policy of managing arbitrary \emph{context data}.  The
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   227
  system provides strongly typed mechanisms to declare new kinds of
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   228
  data at compile time.
18537
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   229
20429
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   230
  Thus the internal bootstrap process of Isabelle/Pure eventually
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   231
  reaches a stage where certain data slots provide the logical content
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   232
  of @{text "\<Theta>"} and @{text "\<Gamma>"} sketched above, but this does not
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   233
  stop there!  Various additional data slots support all kinds of
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   234
  mechanisms that are not necessarily part of the core logic.
18537
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   235
20429
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   236
  For example, there would be data for canonical introduction and
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   237
  elimination rules for arbitrary operators (depending on the
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   238
  object-logic and application), which enables users to perform
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   239
  standard proof steps implicitly (cf.\ the @{text "rule"} method).
18537
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   240
20429
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   241
  Isabelle is able to bring forth more and more concepts successively.
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   242
  In particular, an object-logic like Isabelle/HOL continues the
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   243
  Isabelle/Pure setup by adding specific components for automated
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   244
  reasoning (classical reasoner, tableau prover, structured induction
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   245
  etc.) and derived specification mechanisms (inductive predicates,
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   246
  recursive functions etc.).  All of this is based on the generic data
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   247
  management by theory and proof contexts.
18537
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   248
*}
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   249
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   250
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   251
subsection {* Theory context \label{sec:context-theory} *}
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   252
20429
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   253
text {*
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   254
  Each theory is explicitly named and holds a unique identifier.
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   255
  There is a separate \emph{theory reference} for pointing backwards
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   256
  to the enclosing theory context of derived entities.  Theories are
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   257
  related by a (nominal) sub-theory relation, which corresponds to the
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   258
  canonical dependency graph: each theory is derived from a certain
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   259
  sub-graph of ancestor theories.  The @{text "merge"} of two theories
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   260
  refers to the least upper bound, which actually degenerates into
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   261
  absorption of one theory into the other, due to the nominal
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   262
  sub-theory relation this.
18537
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   263
20429
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   264
  The @{text "begin"} operation starts a new theory by importing
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   265
  several parent theories and entering a special @{text "draft"} mode,
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   266
  which is sustained until the final @{text "end"} operation.  A draft
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   267
  mode theory acts like a linear type, where updates invalidate
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   268
  earlier drafts, but theory reference values will be propagated
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   269
  automatically.  Thus derived entities that ``belong'' to a draft
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   270
  might be transferred spontaneously to a larger context.  An
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   271
  invalidated draft is called ``stale''.  The @{text "copy"} operation
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   272
  produces an auxiliary version with the same data content, but is
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   273
  unrelated to the original: updates of the copy do not affect the
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   274
  original, neither does the sub-theory relation hold.
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   275
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   276
  The example below shows a theory graph derived from @{text "Pure"}.
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   277
  Theory @{text "Length"} imports @{text "Nat"} and @{text "List"}.
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   278
  The linear draft mode is enabled during the ``@{text "\<dots>"}'' stage of
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   279
  the theory body.
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   280
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   281
  \bigskip
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   282
  \begin{tabular}{rcccl}
18537
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   283
        &            & $Pure$ \\
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   284
        &            & $\downarrow$ \\
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   285
        &            & $FOL$ \\
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   286
        & $\swarrow$ &              & $\searrow$ & \\
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   287
  $Nat$ &            &              &            & $List$ \\
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   288
        & $\searrow$ &              & $\swarrow$ \\
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   289
        &            & $Length$ \\
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   290
        &            & \multicolumn{3}{l}{~~$\isarkeyword{imports}$} \\
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   291
        &            & \multicolumn{3}{l}{~~$\isarkeyword{begin}$} \\
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   292
        &            & $\vdots$~~ \\
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   293
        &            & \multicolumn{3}{l}{~~$\isarkeyword{end}$} \\
20429
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   294
  \end{tabular}
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   295
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   296
  \medskip In practice, derived theory operations mostly operate
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   297
  drafts, namely the body of the current portion of theory that the
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   298
  user happens to be composing.
18537
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   299
20429
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   300
 \medskip There is also a builtin theory history mechanism that amends for
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   301
  the destructive behaviour of theory drafts.  The @{text
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   302
  "checkpoint"} operation produces an intermediate stepping stone that
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   303
  survives the next update unscathed: both the original and the
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   304
  changed theory remain valid and are related by the sub-theory
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   305
  relation.  This recovering of pure theory values comes at the cost
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   306
  of extra internal bookeeping.  The cumulative effect of
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   307
  checkpointing is purged by the @{text "finish"} operation.
18537
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   308
20429
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   309
  History operations are usually managed by the system, e.g.\ notably
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   310
  in the Isar transaction loop.
18537
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   311
20429
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   312
  \medskip
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   313
  FIXME theory data
18537
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   314
*}
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   315
20430
wenzelm
parents: 20429
diff changeset
   316
text %mlref {*
wenzelm
parents: 20429
diff changeset
   317
*}
wenzelm
parents: 20429
diff changeset
   318
18537
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   319
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   320
subsection {* Proof context \label{sec:context-proof} *}
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   321
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   322
text {*
20429
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   323
  A proof context is an arbitrary container that is initialized from a
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   324
  given theory.  The result contains a back-reference to the theory it
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   325
  belongs to, together with pure data.  No further bookkeeping is
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   326
  required here, thanks to the lack of destructive features.
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   327
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   328
  There is no restriction on producing proof contexts, although the
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   329
  usual discipline is to follow block structure as a mental model: a
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   330
  given context is extended consecutively, results are exported back
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   331
  into the original context.  In particular, the concept of Isar proof
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   332
  state models block-structured reasoning explicitly, using a stack of
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   333
  proof contexts.
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   334
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   335
  Due to the lack of identification and back-referencing, entities
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   336
  derived in a proof context need to record inherent logical
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   337
  requirements explicitly.  For example, hypotheses used in a
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   338
  derivation will be recorded separately within the sequent @{text "\<Gamma>
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   339
  \<turnstile> \<phi>"}, just to make double sure.  Results could leak into an alien
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   340
  proof context do to programming errors, but Isabelle/Isar
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   341
  occasionally includes extra validity checks at the end of a
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   342
  sub-proof.
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   343
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   344
  \medskip
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   345
  FIXME proof data
18537
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   346
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   347
\glossary{Proof context}{The static context of a structured proof,
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   348
acts like a local ``theory'' of the current portion of Isar proof
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   349
text, generalizes the idea of local hypotheses @{text "\<Gamma>"} in
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   350
judgments @{text "\<Gamma> \<turnstile> \<phi>"} of natural deduction calculi.  There is a
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   351
generic notion of introducing and discharging hypotheses.  Arbritrary
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   352
auxiliary context data may be adjoined.}
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   353
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   354
*}
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   355
20430
wenzelm
parents: 20429
diff changeset
   356
text %mlref {* FIXME *}
wenzelm
parents: 20429
diff changeset
   357
20429
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   358
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   359
subsection {* Generic contexts *}
116255c9209b more on contexts;
wenzelm
parents: 20214
diff changeset
   360
20430
wenzelm
parents: 20429
diff changeset
   361
text FIXME
wenzelm
parents: 20429
diff changeset
   362
wenzelm
parents: 20429
diff changeset
   363
text %mlref {* FIXME *}
wenzelm
parents: 20429
diff changeset
   364
18537
2681f9e34390 "The Isabelle/Isar Implementation" manual;
wenzelm
parents:
diff changeset
   365
end