doc-src/IsarRef/Thy/document/Spec.tex
author wenzelm
Mon, 29 Nov 2010 11:27:39 +0100
changeset 40802 3cd23f676c5b
parent 40784 177e8cea3e09
child 41249 26f12f98f50a
permissions -rw-r--r--
updated generated files;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
26869
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
     1
%
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
     2
\begin{isabellebody}%
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
     3
\def\isabellecontext{Spec}%
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
     4
%
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
     5
\isadelimtheory
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
     6
%
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
     7
\endisadelimtheory
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
     8
%
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
     9
\isatagtheory
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
    10
\isacommand{theory}\isamarkupfalse%
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
    11
\ Spec\isanewline
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
    12
\isakeyword{imports}\ Main\isanewline
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
    13
\isakeyword{begin}%
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
    14
\endisatagtheory
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
    15
{\isafoldtheory}%
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
    16
%
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
    17
\isadelimtheory
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
    18
%
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
    19
\endisadelimtheory
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
    20
%
27047
2dcdea037385 updated generated file;
wenzelm
parents: 27042
diff changeset
    21
\isamarkupchapter{Theory specifications%
26869
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
    22
}
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
    23
\isamarkuptrue%
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
    24
%
29746
533c27b43ee1 updated generated files;
wenzelm
parents: 29706
diff changeset
    25
\begin{isamarkuptext}%
533c27b43ee1 updated generated files;
wenzelm
parents: 29706
diff changeset
    26
The Isabelle/Isar theory format integrates specifications and
533c27b43ee1 updated generated files;
wenzelm
parents: 29706
diff changeset
    27
  proofs, supporting interactive development with unlimited undo
533c27b43ee1 updated generated files;
wenzelm
parents: 29706
diff changeset
    28
  operation.  There is an integrated document preparation system (see
533c27b43ee1 updated generated files;
wenzelm
parents: 29706
diff changeset
    29
  \chref{ch:document-prep}), for typesetting formal developments
533c27b43ee1 updated generated files;
wenzelm
parents: 29706
diff changeset
    30
  together with informal text.  The resulting hyper-linked PDF
533c27b43ee1 updated generated files;
wenzelm
parents: 29706
diff changeset
    31
  documents can be used both for WWW presentation and printed copies.
533c27b43ee1 updated generated files;
wenzelm
parents: 29706
diff changeset
    32
533c27b43ee1 updated generated files;
wenzelm
parents: 29706
diff changeset
    33
  The Isar proof language (see \chref{ch:proofs}) is embedded into the
533c27b43ee1 updated generated files;
wenzelm
parents: 29706
diff changeset
    34
  theory language as a proper sub-language.  Proof mode is entered by
533c27b43ee1 updated generated files;
wenzelm
parents: 29706
diff changeset
    35
  stating some \hyperlink{command.theorem}{\mbox{\isa{\isacommand{theorem}}}} or \hyperlink{command.lemma}{\mbox{\isa{\isacommand{lemma}}}} at the theory
533c27b43ee1 updated generated files;
wenzelm
parents: 29706
diff changeset
    36
  level, and left again with the final conclusion (e.g.\ via \hyperlink{command.qed}{\mbox{\isa{\isacommand{qed}}}}).  Some theory specification mechanisms also require a proof,
533c27b43ee1 updated generated files;
wenzelm
parents: 29706
diff changeset
    37
  such as \hyperlink{command.typedef}{\mbox{\isa{\isacommand{typedef}}}} in HOL, which demands non-emptiness of
533c27b43ee1 updated generated files;
wenzelm
parents: 29706
diff changeset
    38
  the representing sets.%
533c27b43ee1 updated generated files;
wenzelm
parents: 29706
diff changeset
    39
\end{isamarkuptext}%
533c27b43ee1 updated generated files;
wenzelm
parents: 29706
diff changeset
    40
\isamarkuptrue%
533c27b43ee1 updated generated files;
wenzelm
parents: 29706
diff changeset
    41
%
26870
94bedbb34b92 misc reorganization;
wenzelm
parents: 26869
diff changeset
    42
\isamarkupsection{Defining theories \label{sec:begin-thy}%
94bedbb34b92 misc reorganization;
wenzelm
parents: 26869
diff changeset
    43
}
94bedbb34b92 misc reorganization;
wenzelm
parents: 26869
diff changeset
    44
\isamarkuptrue%
94bedbb34b92 misc reorganization;
wenzelm
parents: 26869
diff changeset
    45
%
94bedbb34b92 misc reorganization;
wenzelm
parents: 26869
diff changeset
    46
\begin{isamarkuptext}%
94bedbb34b92 misc reorganization;
wenzelm
parents: 26869
diff changeset
    47
\begin{matharray}{rcl}
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
    48
    \indexdef{}{command}{theory}\hypertarget{command.theory}{\hyperlink{command.theory}{\mbox{\isa{\isacommand{theory}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}toplevel\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
    49
    \indexdef{global}{command}{end}\hypertarget{command.global.end}{\hyperlink{command.global.end}{\mbox{\isa{\isacommand{end}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ toplevel{\isaliteral{22}{\isachardoublequote}}} \\
26870
94bedbb34b92 misc reorganization;
wenzelm
parents: 26869
diff changeset
    50
  \end{matharray}
94bedbb34b92 misc reorganization;
wenzelm
parents: 26869
diff changeset
    51
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
    52
  Isabelle/Isar theories are defined via theory files, which may
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
    53
  contain both specifications and proofs; occasionally definitional
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
    54
  mechanisms also require some explicit proof.  The theory body may be
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
    55
  sub-structured by means of \emph{local theory targets}, such as
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
    56
  \hyperlink{command.locale}{\mbox{\isa{\isacommand{locale}}}} and \hyperlink{command.class}{\mbox{\isa{\isacommand{class}}}}.
26870
94bedbb34b92 misc reorganization;
wenzelm
parents: 26869
diff changeset
    57
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
    58
  The first proper command of a theory is \hyperlink{command.theory}{\mbox{\isa{\isacommand{theory}}}}, which
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
    59
  indicates imports of previous theories and optional dependencies on
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
    60
  other source files (usually in ML).  Just preceding the initial
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
    61
  \hyperlink{command.theory}{\mbox{\isa{\isacommand{theory}}}} command there may be an optional \hyperlink{command.header}{\mbox{\isa{\isacommand{header}}}} declaration, which is only relevant to document
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
    62
  preparation: see also the other section markup commands in
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
    63
  \secref{sec:markup}.
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
    64
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
    65
  A theory is concluded by a final \hyperlink{command.global.end}{\mbox{\isa{\isacommand{end}}}} command,
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
    66
  one that does not belong to a local theory target.  No further
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
    67
  commands may follow such a global \hyperlink{command.global.end}{\mbox{\isa{\isacommand{end}}}},
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
    68
  although some user-interfaces might pretend that trailing input is
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
    69
  admissible.
26870
94bedbb34b92 misc reorganization;
wenzelm
parents: 26869
diff changeset
    70
94bedbb34b92 misc reorganization;
wenzelm
parents: 26869
diff changeset
    71
  \begin{rail}
94bedbb34b92 misc reorganization;
wenzelm
parents: 26869
diff changeset
    72
    'theory' name 'imports' (name +) uses? 'begin'
94bedbb34b92 misc reorganization;
wenzelm
parents: 26869
diff changeset
    73
    ;
94bedbb34b92 misc reorganization;
wenzelm
parents: 26869
diff changeset
    74
94bedbb34b92 misc reorganization;
wenzelm
parents: 26869
diff changeset
    75
    uses: 'uses' ((name | parname) +);
94bedbb34b92 misc reorganization;
wenzelm
parents: 26869
diff changeset
    76
  \end{rail}
94bedbb34b92 misc reorganization;
wenzelm
parents: 26869
diff changeset
    77
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
    78
  \begin{description}
26870
94bedbb34b92 misc reorganization;
wenzelm
parents: 26869
diff changeset
    79
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
    80
  \item \hyperlink{command.theory}{\mbox{\isa{\isacommand{theory}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}A\ {\isaliteral{5C3C494D504F5254533E}{\isasymIMPORTS}}\ B\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ B\isaliteral{5C3C5E7375623E}{}\isactrlsub n\ {\isaliteral{5C3C424547494E3E}{\isasymBEGIN}}{\isaliteral{22}{\isachardoublequote}}}
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
    81
  starts a new theory \isa{A} based on the merge of existing
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
    82
  theories \isa{{\isaliteral{22}{\isachardoublequote}}B\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ B\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}}.
26870
94bedbb34b92 misc reorganization;
wenzelm
parents: 26869
diff changeset
    83
  
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
    84
  Due to the possibility to import more than one ancestor, the
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
    85
  resulting theory structure of an Isabelle session forms a directed
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
    86
  acyclic graph (DAG).  Isabelle's theory loader ensures that the
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
    87
  sources contributing to the development graph are always up-to-date:
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
    88
  changed files are automatically reloaded whenever a theory header
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
    89
  specification is processed.
26870
94bedbb34b92 misc reorganization;
wenzelm
parents: 26869
diff changeset
    90
  
26902
8db1e960d636 updated generated file;
wenzelm
parents: 26870
diff changeset
    91
  The optional \indexdef{}{keyword}{uses}\hypertarget{keyword.uses}{\hyperlink{keyword.uses}{\mbox{\isa{\isakeyword{uses}}}}} specification declares additional
26870
94bedbb34b92 misc reorganization;
wenzelm
parents: 26869
diff changeset
    92
  dependencies on extra files (usually ML sources).  Files will be
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
    93
  loaded immediately (as ML), unless the name is parenthesized.  The
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
    94
  latter case records a dependency that needs to be resolved later in
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
    95
  the text, usually via explicit \indexref{}{command}{use}\hyperlink{command.use}{\mbox{\isa{\isacommand{use}}}} for ML files;
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
    96
  other file formats require specific load commands defined by the
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
    97
  corresponding tools or packages.
26870
94bedbb34b92 misc reorganization;
wenzelm
parents: 26869
diff changeset
    98
  
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
    99
  \item \hyperlink{command.global.end}{\mbox{\isa{\isacommand{end}}}} concludes the current theory
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   100
  definition.  Note that local theory targets involve a local
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   101
  \hyperlink{command.local.end}{\mbox{\isa{\isacommand{end}}}}, which is clear from the nesting.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   102
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   103
  \end{description}%
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   104
\end{isamarkuptext}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   105
\isamarkuptrue%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   106
%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   107
\isamarkupsection{Local theory targets \label{sec:target}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   108
}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   109
\isamarkuptrue%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   110
%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   111
\begin{isamarkuptext}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   112
A local theory target is a context managed separately within the
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   113
  enclosing theory.  Contexts may introduce parameters (fixed
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   114
  variables) and assumptions (hypotheses).  Definitions and theorems
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   115
  depending on the context may be added incrementally later on.  Named
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   116
  contexts refer to locales (cf.\ \secref{sec:locale}) or type classes
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   117
  (cf.\ \secref{sec:class}); the name ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{2D}{\isacharminus}}{\isaliteral{22}{\isachardoublequote}}}'' signifies the
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   118
  global theory context.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   119
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   120
  \begin{matharray}{rcll}
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   121
    \indexdef{}{command}{context}\hypertarget{command.context}{\hyperlink{command.context}{\mbox{\isa{\isacommand{context}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   122
    \indexdef{local}{command}{end}\hypertarget{command.local.end}{\hyperlink{command.local.end}{\mbox{\isa{\isacommand{end}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   123
  \end{matharray}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   124
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   125
  \indexouternonterm{target}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   126
  \begin{rail}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   127
    'context' name 'begin'
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   128
    ;
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   129
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   130
    target: '(' 'in' name ')'
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   131
    ;
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   132
  \end{rail}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   133
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   134
  \begin{description}
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   135
  
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   136
  \item \hyperlink{command.context}{\mbox{\isa{\isacommand{context}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}c\ {\isaliteral{5C3C424547494E3E}{\isasymBEGIN}}{\isaliteral{22}{\isachardoublequote}}} recommences an
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   137
  existing locale or class context \isa{c}.  Note that locale and
27052
5c48cecb981b updated generated file;
wenzelm
parents: 27047
diff changeset
   138
  class definitions allow to include the \hyperlink{keyword.begin}{\mbox{\isa{\isakeyword{begin}}}} keyword as
5c48cecb981b updated generated file;
wenzelm
parents: 27047
diff changeset
   139
  well, in order to continue the local theory immediately after the
5c48cecb981b updated generated file;
wenzelm
parents: 27047
diff changeset
   140
  initial specification.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   141
  
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   142
  \item \hyperlink{command.local.end}{\mbox{\isa{\isacommand{end}}}} concludes the current local theory
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   143
  and continues the enclosing global theory.  Note that a global
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   144
  \hyperlink{command.global.end}{\mbox{\isa{\isacommand{end}}}} has a different meaning: it concludes the
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   145
  theory itself (\secref{sec:begin-thy}).
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   146
  
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   147
  \item \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{22}{\isachardoublequote}}}\indexdef{}{keyword}{in}\hypertarget{keyword.in}{\hyperlink{keyword.in}{\mbox{\isa{\isakeyword{in}}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}c{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} given after any
29746
533c27b43ee1 updated generated files;
wenzelm
parents: 29706
diff changeset
   148
  local theory command specifies an immediate target, e.g.\
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   149
  ``\hyperlink{command.definition}{\mbox{\isa{\isacommand{definition}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C494E3E}{\isasymIN}}\ c{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{22}{\isachardoublequote}}}'' or ``\hyperlink{command.theorem}{\mbox{\isa{\isacommand{theorem}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C494E3E}{\isasymIN}}\ c{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{22}{\isachardoublequote}}}''.  This works both in a local or
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   150
  global theory context; the current target context will be suspended
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   151
  for this command only.  Note that ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C494E3E}{\isasymIN}}\ {\isaliteral{2D}{\isacharminus}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}'' will
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   152
  always produce a global result independently of the current target
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   153
  context.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   154
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   155
  \end{description}
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   156
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   157
  The exact meaning of results produced within a local theory context
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   158
  depends on the underlying target infrastructure (locale, type class
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   159
  etc.).  The general idea is as follows, considering a context named
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   160
  \isa{c} with parameter \isa{x} and assumption \isa{{\isaliteral{22}{\isachardoublequote}}A{\isaliteral{5B}{\isacharbrackleft}}x{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{22}{\isachardoublequote}}}.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   161
  
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   162
  Definitions are exported by introducing a global version with
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   163
  additional arguments; a syntactic abbreviation links the long form
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   164
  with the abstract version of the target context.  For example,
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   165
  \isa{{\isaliteral{22}{\isachardoublequote}}a\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ t{\isaliteral{5B}{\isacharbrackleft}}x{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{22}{\isachardoublequote}}} becomes \isa{{\isaliteral{22}{\isachardoublequote}}c{\isaliteral{2E}{\isachardot}}a\ {\isaliteral{3F}{\isacharquery}}x\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ t{\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{3F}{\isacharquery}}x{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{22}{\isachardoublequote}}} at the theory
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   166
  level (for arbitrary \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3F}{\isacharquery}}x{\isaliteral{22}{\isachardoublequote}}}), together with a local
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   167
  abbreviation \isa{{\isaliteral{22}{\isachardoublequote}}c\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ c{\isaliteral{2E}{\isachardot}}a\ x{\isaliteral{22}{\isachardoublequote}}} in the target context (for the
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   168
  fixed parameter \isa{x}).
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   169
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   170
  Theorems are exported by discharging the assumptions and
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   171
  generalizing the parameters of the context.  For example, \isa{{\isaliteral{22}{\isachardoublequote}}a{\isaliteral{3A}{\isacharcolon}}\ B{\isaliteral{5B}{\isacharbrackleft}}x{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{22}{\isachardoublequote}}} becomes \isa{{\isaliteral{22}{\isachardoublequote}}c{\isaliteral{2E}{\isachardot}}a{\isaliteral{3A}{\isacharcolon}}\ A{\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{3F}{\isacharquery}}x{\isaliteral{5D}{\isacharbrackright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ B{\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{3F}{\isacharquery}}x{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{22}{\isachardoublequote}}}, again for arbitrary
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   172
  \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3F}{\isacharquery}}x{\isaliteral{22}{\isachardoublequote}}}.%
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   173
\end{isamarkuptext}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   174
\isamarkuptrue%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   175
%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   176
\isamarkupsection{Basic specification elements%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   177
}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   178
\isamarkuptrue%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   179
%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   180
\begin{isamarkuptext}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   181
\begin{matharray}{rcll}
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   182
    \indexdef{}{command}{axiomatization}\hypertarget{command.axiomatization}{\hyperlink{command.axiomatization}{\mbox{\isa{\isacommand{axiomatization}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} & (axiomatic!) \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   183
    \indexdef{}{command}{definition}\hypertarget{command.definition}{\hyperlink{command.definition}{\mbox{\isa{\isacommand{definition}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   184
    \indexdef{}{attribute}{defn}\hypertarget{attribute.defn}{\hyperlink{attribute.defn}{\mbox{\isa{defn}}}} & : & \isa{attribute} \\
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   185
    \indexdef{}{command}{abbreviation}\hypertarget{command.abbreviation}{\hyperlink{command.abbreviation}{\mbox{\isa{\isacommand{abbreviation}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   186
    \indexdef{}{command}{print\_abbrevs}\hypertarget{command.print-abbrevs}{\hyperlink{command.print-abbrevs}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}abbrevs}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ {\isaliteral{22}{\isachardoublequote}}} \\
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   187
  \end{matharray}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   188
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   189
  These specification mechanisms provide a slightly more abstract view
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   190
  than the underlying primitives of \hyperlink{command.consts}{\mbox{\isa{\isacommand{consts}}}}, \hyperlink{command.defs}{\mbox{\isa{\isacommand{defs}}}} (see \secref{sec:consts}), and \hyperlink{command.axioms}{\mbox{\isa{\isacommand{axioms}}}} (see
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   191
  \secref{sec:axms-thms}).  In particular, type-inference is commonly
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   192
  available, and result names need not be given.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   193
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   194
  \begin{rail}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   195
    'axiomatization' target? fixes? ('where' specs)?
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   196
    ;
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   197
    'definition' target? (decl 'where')? thmdecl? prop
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   198
    ;
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   199
    'abbreviation' target? mode? (decl 'where')? prop
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   200
    ;
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   201
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   202
    fixes: ((name ('::' type)? mixfix? | vars) + 'and')
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   203
    ;
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   204
    specs: (thmdecl? props + 'and')
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   205
    ;
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   206
    decl: name ('::' type)? mixfix?
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   207
    ;
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   208
  \end{rail}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   209
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   210
  \begin{description}
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   211
  
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   212
  \item \hyperlink{command.axiomatization}{\mbox{\isa{\isacommand{axiomatization}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}c\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ c\isaliteral{5C3C5E7375623E}{}\isactrlsub m\ {\isaliteral{5C3C57484552453E}{\isasymWHERE}}\ {\isaliteral{5C3C7068693E}{\isasymphi}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{5C3C7068693E}{\isasymphi}}\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}}
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   213
  introduces several constants simultaneously and states axiomatic
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   214
  properties for these.  The constants are marked as being specified
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   215
  once and for all, which prevents additional specifications being
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   216
  issued later on.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   217
  
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   218
  Note that axiomatic specifications are only appropriate when
28110
9d121b171a0a Sign.declare_const: Name.binding;
wenzelm
parents: 28085
diff changeset
   219
  declaring a new logical system; axiomatic specifications are
9d121b171a0a Sign.declare_const: Name.binding;
wenzelm
parents: 28085
diff changeset
   220
  restricted to global theory contexts.  Normal applications should
9d121b171a0a Sign.declare_const: Name.binding;
wenzelm
parents: 28085
diff changeset
   221
  only use definitional mechanisms!
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   222
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   223
  \item \hyperlink{command.definition}{\mbox{\isa{\isacommand{definition}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}c\ {\isaliteral{5C3C57484552453E}{\isasymWHERE}}\ eq{\isaliteral{22}{\isachardoublequote}}} produces an
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   224
  internal definition \isa{{\isaliteral{22}{\isachardoublequote}}c\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ t{\isaliteral{22}{\isachardoublequote}}} according to the specification
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   225
  given as \isa{eq}, which is then turned into a proven fact.  The
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   226
  given proposition may deviate from internal meta-level equality
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   227
  according to the rewrite rules declared as \hyperlink{attribute.defn}{\mbox{\isa{defn}}} by the
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   228
  object-logic.  This usually covers object-level equality \isa{{\isaliteral{22}{\isachardoublequote}}x\ {\isaliteral{3D}{\isacharequal}}\ y{\isaliteral{22}{\isachardoublequote}}} and equivalence \isa{{\isaliteral{22}{\isachardoublequote}}A\ {\isaliteral{5C3C6C65667472696768746172726F773E}{\isasymleftrightarrow}}\ B{\isaliteral{22}{\isachardoublequote}}}.  End-users normally need not
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   229
  change the \hyperlink{attribute.defn}{\mbox{\isa{defn}}} setup.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   230
  
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   231
  Definitions may be presented with explicit arguments on the LHS, as
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   232
  well as additional conditions, e.g.\ \isa{{\isaliteral{22}{\isachardoublequote}}f\ x\ y\ {\isaliteral{3D}{\isacharequal}}\ t{\isaliteral{22}{\isachardoublequote}}} instead of
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   233
  \isa{{\isaliteral{22}{\isachardoublequote}}f\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ {\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}x\ y{\isaliteral{2E}{\isachardot}}\ t{\isaliteral{22}{\isachardoublequote}}} and \isa{{\isaliteral{22}{\isachardoublequote}}y\ {\isaliteral{5C3C6E6F7465713E}{\isasymnoteq}}\ {\isadigit{0}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ g\ x\ y\ {\isaliteral{3D}{\isacharequal}}\ u{\isaliteral{22}{\isachardoublequote}}} instead of an
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   234
  unrestricted \isa{{\isaliteral{22}{\isachardoublequote}}g\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ {\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}x\ y{\isaliteral{2E}{\isachardot}}\ u{\isaliteral{22}{\isachardoublequote}}}.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   235
  
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   236
  \item \hyperlink{command.abbreviation}{\mbox{\isa{\isacommand{abbreviation}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}c\ {\isaliteral{5C3C57484552453E}{\isasymWHERE}}\ eq{\isaliteral{22}{\isachardoublequote}}} introduces a
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   237
  syntactic constant which is associated with a certain term according
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   238
  to the meta-level equality \isa{eq}.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   239
  
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   240
  Abbreviations participate in the usual type-inference process, but
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   241
  are expanded before the logic ever sees them.  Pretty printing of
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   242
  terms involves higher-order rewriting with rules stemming from
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   243
  reverted abbreviations.  This needs some care to avoid overlapping
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   244
  or looping syntactic replacements!
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   245
  
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   246
  The optional \isa{mode} specification restricts output to a
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   247
  particular print mode; using ``\isa{input}'' here achieves the
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   248
  effect of one-way abbreviations.  The mode may also include an
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   249
  ``\hyperlink{keyword.output}{\mbox{\isa{\isakeyword{output}}}}'' qualifier that affects the concrete syntax
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   250
  declared for abbreviations, cf.\ \hyperlink{command.syntax}{\mbox{\isa{\isacommand{syntax}}}} in
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   251
  \secref{sec:syn-trans}.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   252
  
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   253
  \item \hyperlink{command.print-abbrevs}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}abbrevs}}}} prints all constant abbreviations
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   254
  of the current context.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   255
  
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   256
  \end{description}%
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   257
\end{isamarkuptext}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   258
\isamarkuptrue%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   259
%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   260
\isamarkupsection{Generic declarations%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   261
}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   262
\isamarkuptrue%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   263
%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   264
\begin{isamarkuptext}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   265
Arbitrary operations on the background context may be wrapped-up as
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   266
  generic declaration elements.  Since the underlying concept of local
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   267
  theories may be subject to later re-interpretation, there is an
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   268
  additional dependency on a morphism that tells the difference of the
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   269
  original declaration context wrt.\ the application context
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   270
  encountered later on.  A fact declaration is an important special
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   271
  case: it consists of a theorem which is applied to the context by
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   272
  means of an attribute.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   273
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   274
  \begin{matharray}{rcl}
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   275
    \indexdef{}{command}{declaration}\hypertarget{command.declaration}{\hyperlink{command.declaration}{\mbox{\isa{\isacommand{declaration}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
40784
177e8cea3e09 added 'syntax_declaration' command;
wenzelm
parents: 40406
diff changeset
   276
    \indexdef{}{command}{syntax\_declaration}\hypertarget{command.syntax-declaration}{\hyperlink{command.syntax-declaration}{\mbox{\isa{\isacommand{syntax{\isaliteral{5F}{\isacharunderscore}}declaration}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   277
    \indexdef{}{command}{declare}\hypertarget{command.declare}{\hyperlink{command.declare}{\mbox{\isa{\isacommand{declare}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   278
  \end{matharray}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   279
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   280
  \begin{rail}
40784
177e8cea3e09 added 'syntax_declaration' command;
wenzelm
parents: 40406
diff changeset
   281
    ('declaration' | 'syntax_declaration') ('(pervasive)')? target? text
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   282
    ;
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   283
    'declare' target? (thmrefs + 'and')
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   284
    ;
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   285
  \end{rail}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   286
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   287
  \begin{description}
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   288
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   289
  \item \hyperlink{command.declaration}{\mbox{\isa{\isacommand{declaration}}}}~\isa{d} adds the declaration
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   290
  function \isa{d} of ML type \verb|declaration|, to the current
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   291
  local theory under construction.  In later application contexts, the
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   292
  function is transformed according to the morphisms being involved in
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   293
  the interpretation hierarchy.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   294
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   295
  If the \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}pervasive{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} option is given, the corresponding
33516
0855a09bc5cf added "declaration (pervasive)";
wenzelm
parents: 31914
diff changeset
   296
  declaration is applied to all possible contexts involved, including
0855a09bc5cf added "declaration (pervasive)";
wenzelm
parents: 31914
diff changeset
   297
  the global background theory.
0855a09bc5cf added "declaration (pervasive)";
wenzelm
parents: 31914
diff changeset
   298
40784
177e8cea3e09 added 'syntax_declaration' command;
wenzelm
parents: 40406
diff changeset
   299
  \item \hyperlink{command.syntax-declaration}{\mbox{\isa{\isacommand{syntax{\isaliteral{5F}{\isacharunderscore}}declaration}}}} is similar to \hyperlink{command.declaration}{\mbox{\isa{\isacommand{declaration}}}}, but is meant to affect only ``syntactic'' tools by
177e8cea3e09 added 'syntax_declaration' command;
wenzelm
parents: 40406
diff changeset
   300
  convention (such as notation and type-checking information).
177e8cea3e09 added 'syntax_declaration' command;
wenzelm
parents: 40406
diff changeset
   301
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   302
  \item \hyperlink{command.declare}{\mbox{\isa{\isacommand{declare}}}}~\isa{thms} declares theorems to the
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   303
  current local theory context.  No theorem binding is involved here,
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   304
  unlike \hyperlink{command.theorems}{\mbox{\isa{\isacommand{theorems}}}} or \hyperlink{command.lemmas}{\mbox{\isa{\isacommand{lemmas}}}} (cf.\
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   305
  \secref{sec:axms-thms}), so \hyperlink{command.declare}{\mbox{\isa{\isacommand{declare}}}} only has the effect
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   306
  of applying attributes as included in the theorem specification.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   307
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   308
  \end{description}%
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   309
\end{isamarkuptext}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   310
\isamarkuptrue%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   311
%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   312
\isamarkupsection{Locales \label{sec:locale}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   313
}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   314
\isamarkuptrue%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   315
%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   316
\begin{isamarkuptext}%
33847
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   317
Locales are parametric named local contexts, consisting of a list of
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   318
  declaration elements that are modeled after the Isar proof context
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   319
  commands (cf.\ \secref{sec:proof-context}).%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   320
\end{isamarkuptext}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   321
\isamarkuptrue%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   322
%
33847
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   323
\isamarkupsubsection{Locale expressions \label{sec:locale-expr}%
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   324
}
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   325
\isamarkuptrue%
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   326
%
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   327
\begin{isamarkuptext}%
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   328
A \emph{locale expression} denotes a structured context composed of
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   329
  instances of existing locales.  The context consists of a list of
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   330
  instances of declaration elements from the locales.  Two locale
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   331
  instances are equal if they are of the same locale and the
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   332
  parameters are instantiated with equivalent terms.  Declaration
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   333
  elements from equal instances are never repeated, thus avoiding
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   334
  duplicate declarations.
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   335
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   336
  \indexouternonterm{localeexpr}
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   337
  \begin{rail}
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   338
    localeexpr: (instance + '+') ('for' (fixes + 'and'))?
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   339
    ;
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   340
    instance: (qualifier ':')? nameref (posinsts | namedinsts)
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   341
    ;
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   342
    qualifier: name ('?' | '!')?
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   343
    ;
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   344
    posinsts: (term | '_')*
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   345
    ;
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   346
    namedinsts: 'where' (name '=' term + 'and')
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   347
    ;
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   348
  \end{rail}
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   349
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   350
  A locale instance consists of a reference to a locale and either
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   351
  positional or named parameter instantiations.  Identical
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   352
  instantiations (that is, those that instante a parameter by itself)
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   353
  may be omitted.  The notation `\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5F}{\isacharunderscore}}{\isaliteral{22}{\isachardoublequote}}}' enables to omit the
40256
eb5412b77ac4 eliminated obsolete \_ escape;
wenzelm
parents: 40255
diff changeset
   354
  instantiation for a parameter inside a positional instantiation.
33847
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   355
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   356
  Terms in instantiations are from the context the locale expressions
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   357
  is declared in.  Local names may be added to this context with the
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   358
  optional for clause.  In addition, syntax declarations from one
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   359
  instance are effective when parsing subsequent instances of the same
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   360
  expression.
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   361
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   362
  Instances have an optional qualifier which applies to names in
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   363
  declarations.  Names include local definitions and theorem names.
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   364
  If present, the qualifier itself is either optional
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   365
  (``\texttt{?}''), which means that it may be omitted on input of the
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   366
  qualified name, or mandatory (``\texttt{!}'').  If neither
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   367
  ``\texttt{?}'' nor ``\texttt{!}'' are present, the command's default
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   368
  is used.  For \hyperlink{command.interpretation}{\mbox{\isa{\isacommand{interpretation}}}} and \hyperlink{command.interpret}{\mbox{\isa{\isacommand{interpret}}}}
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   369
  the default is ``mandatory'', for \hyperlink{command.locale}{\mbox{\isa{\isacommand{locale}}}} and \hyperlink{command.sublocale}{\mbox{\isa{\isacommand{sublocale}}}} the default is ``optional''.%
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   370
\end{isamarkuptext}%
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   371
\isamarkuptrue%
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   372
%
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   373
\isamarkupsubsection{Locale declarations%
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   374
}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   375
\isamarkuptrue%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   376
%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   377
\begin{isamarkuptext}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   378
\begin{matharray}{rcl}
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   379
    \indexdef{}{command}{locale}\hypertarget{command.locale}{\hyperlink{command.locale}{\mbox{\isa{\isacommand{locale}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   380
    \indexdef{}{command}{print\_locale}\hypertarget{command.print-locale}{\hyperlink{command.print-locale}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}locale}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   381
    \indexdef{}{command}{print\_locales}\hypertarget{command.print-locales}{\hyperlink{command.print-locales}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}locales}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   382
    \indexdef{}{method}{intro\_locales}\hypertarget{method.intro-locales}{\hyperlink{method.intro-locales}{\mbox{\isa{intro{\isaliteral{5F}{\isacharunderscore}}locales}}}} & : & \isa{method} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   383
    \indexdef{}{method}{unfold\_locales}\hypertarget{method.unfold-locales}{\hyperlink{method.unfold-locales}{\mbox{\isa{unfold{\isaliteral{5F}{\isacharunderscore}}locales}}}} & : & \isa{method} \\
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   384
  \end{matharray}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   385
33847
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   386
  \indexouternonterm{contextelem}
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   387
  \indexisarelem{fixes}\indexisarelem{constrains}\indexisarelem{assumes}
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   388
  \indexisarelem{defines}\indexisarelem{notes}
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   389
  \begin{rail}
33847
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   390
    'locale' name ('=' locale)? 'begin'?
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   391
    ;
40255
9ffbc25e1606 eliminated obsolete \_ escapes in rail environments;
wenzelm
parents: 40240
diff changeset
   392
    'print_locale' '!'? nameref
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   393
    ;
33847
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   394
    locale: contextelem+ | localeexpr ('+' (contextelem+))?
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   395
    ;
33847
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   396
    contextelem:
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   397
    'fixes' (fixes + 'and')
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   398
    | 'constrains' (name '::' type + 'and')
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   399
    | 'assumes' (props + 'and')
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   400
    | 'defines' (thmdecl? prop proppat? + 'and')
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   401
    | 'notes' (thmdef? thmrefs + 'and')
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   402
    ;
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   403
  \end{rail}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   404
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   405
  \begin{description}
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   406
  
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   407
  \item \hyperlink{command.locale}{\mbox{\isa{\isacommand{locale}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}loc\ {\isaliteral{3D}{\isacharequal}}\ import\ {\isaliteral{2B}{\isacharplus}}\ body{\isaliteral{22}{\isachardoublequote}}} defines a
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   408
  new locale \isa{loc} as a context consisting of a certain view of
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   409
  existing locales (\isa{import}) plus some additional elements
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   410
  (\isa{body}).  Both \isa{import} and \isa{body} are optional;
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   411
  the degenerate form \hyperlink{command.locale}{\mbox{\isa{\isacommand{locale}}}}~\isa{loc} defines an empty
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   412
  locale, which may still be useful to collect declarations of facts
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   413
  later on.  Type-inference on locale expressions automatically takes
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   414
  care of the most general typing that the combined context elements
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   415
  may acquire.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   416
33847
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   417
  The \isa{import} consists of a structured locale expression; see
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   418
  \secref{sec:proof-context} above.  Its for clause defines the local
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   419
  parameters of the \isa{import}.  In addition, locale parameters
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   420
  whose instantance is omitted automatically extend the (possibly
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   421
  empty) for clause: they are inserted at its beginning.  This means
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   422
  that these parameters may be referred to from within the expression
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   423
  and also in the subsequent context elements and provides a
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   424
  notational convenience for the inheritance of parameters in locale
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   425
  declarations.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   426
33847
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   427
  The \isa{body} consists of context elements.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   428
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   429
  \begin{description}
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   430
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   431
  \item \hyperlink{element.fixes}{\mbox{\isa{\isakeyword{fixes}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}x\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}\ {\isaliteral{28}{\isacharparenleft}}mx{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} declares a local
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   432
  parameter of type \isa{{\isaliteral{5C3C7461753E}{\isasymtau}}} and mixfix annotation \isa{mx} (both
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   433
  are optional).  The special syntax declaration ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C5354525543545552453E}{\isasymSTRUCTURE}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}'' means that \isa{x} may be referenced
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   434
  implicitly in this context.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   435
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   436
  \item \hyperlink{element.constrains}{\mbox{\isa{\isakeyword{constrains}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}x\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{22}{\isachardoublequote}}} introduces a type
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   437
  constraint \isa{{\isaliteral{5C3C7461753E}{\isasymtau}}} on the local parameter \isa{x}.  This
38110
2c1913d1b945 Documentation of 'interpret' updated.
ballarin
parents: 37768
diff changeset
   438
  element is deprecated.  The type constraint should be introduced in
33847
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   439
  the for clause or the relevant \hyperlink{element.fixes}{\mbox{\isa{\isakeyword{fixes}}}} element.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   440
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   441
  \item \hyperlink{element.assumes}{\mbox{\isa{\isakeyword{assumes}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}a{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7068693E}{\isasymphi}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{5C3C7068693E}{\isasymphi}}\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}}
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   442
  introduces local premises, similar to \hyperlink{command.assume}{\mbox{\isa{\isacommand{assume}}}} within a
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   443
  proof (cf.\ \secref{sec:proof-context}).
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   444
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   445
  \item \hyperlink{element.defines}{\mbox{\isa{\isakeyword{defines}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}a{\isaliteral{3A}{\isacharcolon}}\ x\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ t{\isaliteral{22}{\isachardoublequote}}} defines a previously
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   446
  declared parameter.  This is similar to \hyperlink{command.def}{\mbox{\isa{\isacommand{def}}}} within a
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   447
  proof (cf.\ \secref{sec:proof-context}), but \hyperlink{element.defines}{\mbox{\isa{\isakeyword{defines}}}}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   448
  takes an equational proposition instead of variable-term pair.  The
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   449
  left-hand side of the equation may have additional arguments, e.g.\
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   450
  ``\hyperlink{element.defines}{\mbox{\isa{\isakeyword{defines}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}f\ x\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ x\isaliteral{5C3C5E7375623E}{}\isactrlsub n\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ t{\isaliteral{22}{\isachardoublequote}}}''.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   451
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   452
  \item \hyperlink{element.notes}{\mbox{\isa{\isakeyword{notes}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}a\ {\isaliteral{3D}{\isacharequal}}\ b\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ b\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}}
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   453
  reconsiders facts within a local context.  Most notably, this may
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   454
  include arbitrary declarations in any attribute specifications
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   455
  included here, e.g.\ a local \hyperlink{attribute.simp}{\mbox{\isa{simp}}} rule.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   456
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   457
  The initial \isa{import} specification of a locale expression
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   458
  maintains a dynamic relation to the locales being referenced
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   459
  (benefiting from any later fact declarations in the obvious manner).
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   460
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   461
  \end{description}
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   462
  
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   463
  Note that ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C49533E}{\isasymIS}}\ p\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ p\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}'' patterns given
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   464
  in the syntax of \hyperlink{element.assumes}{\mbox{\isa{\isakeyword{assumes}}}} and \hyperlink{element.defines}{\mbox{\isa{\isakeyword{defines}}}} above
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   465
  are illegal in locale definitions.  In the long goal format of
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   466
  \secref{sec:goals}, term bindings may be included as expected,
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   467
  though.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   468
  
33847
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   469
  \medskip Locale specifications are ``closed up'' by
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   470
  turning the given text into a predicate definition \isa{loc{\isaliteral{5F}{\isacharunderscore}}axioms} and deriving the original assumptions as local lemmas
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   471
  (modulo local definitions).  The predicate statement covers only the
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   472
  newly specified assumptions, omitting the content of included locale
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   473
  expressions.  The full cumulative view is only provided on export,
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   474
  involving another predicate \isa{loc} that refers to the complete
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   475
  specification text.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   476
  
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   477
  In any case, the predicate arguments are those locale parameters
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   478
  that actually occur in the respective piece of text.  Also note that
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   479
  these predicates operate at the meta-level in theory, but the locale
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   480
  packages attempts to internalize statements according to the
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   481
  object-logic setup (e.g.\ replacing \isa{{\isaliteral{5C3C416E643E}{\isasymAnd}}} by \isa{{\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}}, and
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   482
  \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}{\isaliteral{22}{\isachardoublequote}}} by \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}{\isaliteral{22}{\isachardoublequote}}} in HOL; see also
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   483
  \secref{sec:object-logic}).  Separate introduction rules \isa{loc{\isaliteral{5F}{\isacharunderscore}}axioms{\isaliteral{2E}{\isachardot}}intro} and \isa{loc{\isaliteral{2E}{\isachardot}}intro} are provided as well.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   484
  
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   485
  \item \hyperlink{command.print-locale}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}locale}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}locale{\isaliteral{22}{\isachardoublequote}}} prints the
33868
62251d6b0038 Generated files.
ballarin
parents: 33847
diff changeset
   486
  contents of the named locale.  The command omits \hyperlink{element.notes}{\mbox{\isa{\isakeyword{notes}}}}
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   487
  elements by default.  Use \hyperlink{command.print-locale}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}locale}}}}\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{21}{\isacharbang}}{\isaliteral{22}{\isachardoublequote}}} to
33868
62251d6b0038 Generated files.
ballarin
parents: 33847
diff changeset
   488
  have them included.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   489
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   490
  \item \hyperlink{command.print-locales}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}locales}}}} prints the names of all locales
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   491
  of the current theory.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   492
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   493
  \item \hyperlink{method.intro-locales}{\mbox{\isa{intro{\isaliteral{5F}{\isacharunderscore}}locales}}} and \hyperlink{method.unfold-locales}{\mbox{\isa{unfold{\isaliteral{5F}{\isacharunderscore}}locales}}}
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   494
  repeatedly expand all introduction rules of locale predicates of the
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   495
  theory.  While \hyperlink{method.intro-locales}{\mbox{\isa{intro{\isaliteral{5F}{\isacharunderscore}}locales}}} only applies the \isa{loc{\isaliteral{2E}{\isachardot}}intro} introduction rules and therefore does not decend to
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   496
  assumptions, \hyperlink{method.unfold-locales}{\mbox{\isa{unfold{\isaliteral{5F}{\isacharunderscore}}locales}}} is more aggressive and applies
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   497
  \isa{loc{\isaliteral{5F}{\isacharunderscore}}axioms{\isaliteral{2E}{\isachardot}}intro} as well.  Both methods are aware of locale
28728
08314d96246b Made doc compatible with the system.
ballarin
parents: 28291
diff changeset
   498
  specifications entailed by the context, both from target statements,
08314d96246b Made doc compatible with the system.
ballarin
parents: 28291
diff changeset
   499
  and from interpretations (see below).  New goals that are entailed
08314d96246b Made doc compatible with the system.
ballarin
parents: 28291
diff changeset
   500
  by the current context are discharged automatically.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   501
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   502
  \end{description}%
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   503
\end{isamarkuptext}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   504
\isamarkuptrue%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   505
%
33847
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   506
\isamarkupsubsection{Locale interpretations%
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   507
}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   508
\isamarkuptrue%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   509
%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   510
\begin{isamarkuptext}%
33847
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   511
Locale expressions may be instantiated, and the instantiated facts
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   512
  added to the current context.  This requires a proof of the
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   513
  instantiated specification and is called \emph{locale
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   514
  interpretation}.  Interpretation is possible in locales \hyperlink{command.sublocale}{\mbox{\isa{\isacommand{sublocale}}}}, theories (command \hyperlink{command.interpretation}{\mbox{\isa{\isacommand{interpretation}}}}) and
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   515
  also within a proof body (command \hyperlink{command.interpret}{\mbox{\isa{\isacommand{interpret}}}}).
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   516
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   517
  \begin{matharray}{rcl}
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   518
    \indexdef{}{command}{sublocale}\hypertarget{command.sublocale}{\hyperlink{command.sublocale}{\mbox{\isa{\isacommand{sublocale}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ proof{\isaliteral{28}{\isacharparenleft}}prove{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   519
    \indexdef{}{command}{interpretation}\hypertarget{command.interpretation}{\hyperlink{command.interpretation}{\mbox{\isa{\isacommand{interpretation}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ proof{\isaliteral{28}{\isacharparenleft}}prove{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   520
    \indexdef{}{command}{interpret}\hypertarget{command.interpret}{\hyperlink{command.interpret}{\mbox{\isa{\isacommand{interpret}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}proof{\isaliteral{28}{\isacharparenleft}}state{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{7C}{\isacharbar}}\ proof{\isaliteral{28}{\isacharparenleft}}chain{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ proof{\isaliteral{28}{\isacharparenleft}}prove{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   521
    \indexdef{}{command}{print\_interps}\hypertarget{command.print-interps}{\hyperlink{command.print-interps}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}interps}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   522
  \end{matharray}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   523
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   524
  \indexouternonterm{interp}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   525
  \begin{rail}
33847
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   526
    'sublocale' nameref ('<' | subseteq) localeexpr
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   527
    ;
33847
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   528
    'interpretation' localeepxr equations?
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   529
    ;
38110
2c1913d1b945 Documentation of 'interpret' updated.
ballarin
parents: 37768
diff changeset
   530
    'interpret' localeexpr equations?
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   531
    ;
40255
9ffbc25e1606 eliminated obsolete \_ escapes in rail environments;
wenzelm
parents: 40240
diff changeset
   532
    'print_interps' nameref
33847
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   533
    ;
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   534
    equations: 'where' (thmdecl? prop + 'and')
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   535
    ;
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   536
  \end{rail}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   537
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   538
  \begin{description}
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   539
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   540
  \item \hyperlink{command.sublocale}{\mbox{\isa{\isacommand{sublocale}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}name\ {\isaliteral{5C3C73756273657465713E}{\isasymsubseteq}}\ expr{\isaliteral{22}{\isachardoublequote}}}
33847
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   541
  interprets \isa{expr} in the locale \isa{name}.  A proof that
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   542
  the specification of \isa{name} implies the specification of
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   543
  \isa{expr} is required.  As in the localized version of the
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   544
  theorem command, the proof is in the context of \isa{name}.  After
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   545
  the proof obligation has been dischared, the facts of \isa{expr}
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   546
  become part of locale \isa{name} as \emph{derived} context
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   547
  elements and are available when the context \isa{name} is
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   548
  subsequently entered.  Note that, like import, this is dynamic:
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   549
  facts added to a locale part of \isa{expr} after interpretation
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   550
  become also available in \isa{name}.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   551
33847
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   552
  Only specification fragments of \isa{expr} that are not already
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   553
  part of \isa{name} (be it imported, derived or a derived fragment
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   554
  of the import) are considered in this process.  This enables
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   555
  circular interpretations to the extent that no infinite chains are
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   556
  generated in the locale hierarchy.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   557
33847
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   558
  If interpretations of \isa{name} exist in the current theory, the
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   559
  command adds interpretations for \isa{expr} as well, with the same
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   560
  qualifier, although only for fragments of \isa{expr} that are not
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   561
  interpreted in the theory already.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   562
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   563
  \item \hyperlink{command.interpretation}{\mbox{\isa{\isacommand{interpretation}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}expr\ {\isaliteral{5C3C57484552453E}{\isasymWHERE}}\ eqns{\isaliteral{22}{\isachardoublequote}}}
33847
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   564
  interprets \isa{expr} in the theory.  The command generates proof
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   565
  obligations for the instantiated specifications (assumes and defines
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   566
  elements).  Once these are discharged by the user, instantiated
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   567
  facts are added to the theory in a post-processing phase.
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   568
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   569
  Additional equations, which are unfolded during
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   570
  post-processing, may be given after the keyword \hyperlink{keyword.where}{\mbox{\isa{\isakeyword{where}}}}.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   571
  This is useful for interpreting concepts introduced through
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   572
  definition specification elements.  The equations must be proved.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   573
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   574
  The command is aware of interpretations already active in the
28085
914183e229e9 Interpretation commands no longer accept interpretation attributes.
ballarin
parents: 27834
diff changeset
   575
  theory, but does not simplify the goal automatically.  In order to
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   576
  simplify the proof obligations use methods \hyperlink{method.intro-locales}{\mbox{\isa{intro{\isaliteral{5F}{\isacharunderscore}}locales}}}
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   577
  or \hyperlink{method.unfold-locales}{\mbox{\isa{unfold{\isaliteral{5F}{\isacharunderscore}}locales}}}.  Post-processing is not applied to
28085
914183e229e9 Interpretation commands no longer accept interpretation attributes.
ballarin
parents: 27834
diff changeset
   578
  facts of interpretations that are already active.  This avoids
914183e229e9 Interpretation commands no longer accept interpretation attributes.
ballarin
parents: 27834
diff changeset
   579
  duplication of interpreted facts, in particular.  Note that, in the
914183e229e9 Interpretation commands no longer accept interpretation attributes.
ballarin
parents: 27834
diff changeset
   580
  case of a locale with import, parts of the interpretation may
914183e229e9 Interpretation commands no longer accept interpretation attributes.
ballarin
parents: 27834
diff changeset
   581
  already be active.  The command will only process facts for new
914183e229e9 Interpretation commands no longer accept interpretation attributes.
ballarin
parents: 27834
diff changeset
   582
  parts.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   583
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   584
  Adding facts to locales has the effect of adding interpreted facts
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   585
  to the theory for all active interpretations also.  That is,
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   586
  interpretations dynamically participate in any facts added to
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   587
  locales.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   588
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   589
  \item \hyperlink{command.interpret}{\mbox{\isa{\isacommand{interpret}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}expr\ {\isaliteral{5C3C57484552453E}{\isasymWHERE}}\ eqns{\isaliteral{22}{\isachardoublequote}}} interprets
38110
2c1913d1b945 Documentation of 'interpret' updated.
ballarin
parents: 37768
diff changeset
   590
  \isa{expr} in the proof context and is otherwise similar to
2c1913d1b945 Documentation of 'interpret' updated.
ballarin
parents: 37768
diff changeset
   591
  interpretation in theories.  Note that rewrite rules given to
2c1913d1b945 Documentation of 'interpret' updated.
ballarin
parents: 37768
diff changeset
   592
  \hyperlink{command.interpret}{\mbox{\isa{\isacommand{interpret}}}} should be explicitly universally quantified.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   593
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   594
  \item \hyperlink{command.print-interps}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}interps}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}locale{\isaliteral{22}{\isachardoublequote}}} lists all
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   595
  interpretations of \isa{{\isaliteral{22}{\isachardoublequote}}locale{\isaliteral{22}{\isachardoublequote}}} in the current theory or proof
38110
2c1913d1b945 Documentation of 'interpret' updated.
ballarin
parents: 37768
diff changeset
   596
  context, including those due to a combination of a \hyperlink{command.interpretation}{\mbox{\isa{\isacommand{interpretation}}}} or \hyperlink{command.interpret}{\mbox{\isa{\isacommand{interpret}}}} and one or several
2c1913d1b945 Documentation of 'interpret' updated.
ballarin
parents: 37768
diff changeset
   597
  \hyperlink{command.sublocale}{\mbox{\isa{\isacommand{sublocale}}}} declarations.
33868
62251d6b0038 Generated files.
ballarin
parents: 33847
diff changeset
   598
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   599
  \end{description}
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   600
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   601
  \begin{warn}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   602
    Since attributes are applied to interpreted theorems,
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   603
    interpretation may modify the context of common proof tools, e.g.\
33868
62251d6b0038 Generated files.
ballarin
parents: 33847
diff changeset
   604
    the Simplifier or Classical Reasoner.  As the behavior of such
62251d6b0038 Generated files.
ballarin
parents: 33847
diff changeset
   605
    tools is \emph{not} stable under interpretation morphisms, manual
62251d6b0038 Generated files.
ballarin
parents: 33847
diff changeset
   606
    declarations might have to be added to the target context of the
62251d6b0038 Generated files.
ballarin
parents: 33847
diff changeset
   607
    interpretation to revert such declarations.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   608
  \end{warn}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   609
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   610
  \begin{warn}
38110
2c1913d1b945 Documentation of 'interpret' updated.
ballarin
parents: 37768
diff changeset
   611
    An interpretation in a theory or proof context may subsume previous
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   612
    interpretations.  This happens if the same specification fragment
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   613
    is interpreted twice and the instantiation of the second
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   614
    interpretation is more general than the interpretation of the
33847
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   615
    first.  The locale package does not attempt to remove subsumed
e4b55a8de812 Generated latex code.
ballarin
parents: 33516
diff changeset
   616
    interpretations.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   617
  \end{warn}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   618
\end{isamarkuptext}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   619
\isamarkuptrue%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   620
%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   621
\isamarkupsection{Classes \label{sec:class}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   622
}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   623
\isamarkuptrue%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   624
%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   625
\begin{isamarkuptext}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   626
A class is a particular locale with \emph{exactly one} type variable
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   627
  \isa{{\isaliteral{5C3C616C7068613E}{\isasymalpha}}}.  Beyond the underlying locale, a corresponding type class
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   628
  is established which is interpreted logically as axiomatic type
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   629
  class \cite{Wenzel:1997:TPHOL} whose logical content are the
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   630
  assumptions of the locale.  Thus, classes provide the full
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   631
  generality of locales combined with the commodity of type classes
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   632
  (notably type-inference).  See \cite{isabelle-classes} for a short
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   633
  tutorial.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   634
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   635
  \begin{matharray}{rcl}
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   636
    \indexdef{}{command}{class}\hypertarget{command.class}{\hyperlink{command.class}{\mbox{\isa{\isacommand{class}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   637
    \indexdef{}{command}{instantiation}\hypertarget{command.instantiation}{\hyperlink{command.instantiation}{\mbox{\isa{\isacommand{instantiation}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   638
    \indexdef{}{command}{instance}\hypertarget{command.instance}{\hyperlink{command.instance}{\mbox{\isa{\isacommand{instance}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   639
    \indexdef{}{command}{instance}\hypertarget{command.instance}{\hyperlink{command.instance}{\mbox{\isa{\isacommand{instance}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ proof{\isaliteral{28}{\isacharparenleft}}prove{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   640
    \indexdef{}{command}{subclass}\hypertarget{command.subclass}{\hyperlink{command.subclass}{\mbox{\isa{\isacommand{subclass}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   641
    \indexdef{}{command}{print\_classes}\hypertarget{command.print-classes}{\hyperlink{command.print-classes}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}classes}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   642
    \indexdef{}{command}{class\_deps}\hypertarget{command.class-deps}{\hyperlink{command.class-deps}{\mbox{\isa{\isacommand{class{\isaliteral{5F}{\isacharunderscore}}deps}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   643
    \indexdef{}{method}{intro\_classes}\hypertarget{method.intro-classes}{\hyperlink{method.intro-classes}{\mbox{\isa{intro{\isaliteral{5F}{\isacharunderscore}}classes}}}} & : & \isa{method} \\
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   644
  \end{matharray}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   645
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   646
  \begin{rail}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   647
    'class' name '=' ((superclassexpr '+' (contextelem+)) | superclassexpr | (contextelem+)) \\
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   648
      'begin'?
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   649
    ;
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   650
    'instantiation' (nameref + 'and') '::' arity 'begin'
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   651
    ;
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   652
    'instance'
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   653
    ;
31914
0bf275fbe93a instance arities can be simultaneous
haftmann
parents: 31913
diff changeset
   654
    'instance' (nameref + 'and') '::' arity
31681
127e8a8b8cde refined section concerning classes
haftmann
parents: 31047
diff changeset
   655
    ;
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   656
    'subclass' target? nameref
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   657
    ;
31681
127e8a8b8cde refined section concerning classes
haftmann
parents: 31047
diff changeset
   658
    'instance' nameref ('<' | subseteq) nameref
127e8a8b8cde refined section concerning classes
haftmann
parents: 31047
diff changeset
   659
    ;
40255
9ffbc25e1606 eliminated obsolete \_ escapes in rail environments;
wenzelm
parents: 40240
diff changeset
   660
    'print_classes'
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   661
    ;
40255
9ffbc25e1606 eliminated obsolete \_ escapes in rail environments;
wenzelm
parents: 40240
diff changeset
   662
    'class_deps'
29706
10e6f2faa1e5 updated type class section
haftmann
parents: 29613
diff changeset
   663
    ;
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   664
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   665
    superclassexpr: nameref | (nameref '+' superclassexpr)
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   666
    ;
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   667
  \end{rail}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   668
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   669
  \begin{description}
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   670
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   671
  \item \hyperlink{command.class}{\mbox{\isa{\isacommand{class}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}c\ {\isaliteral{3D}{\isacharequal}}\ superclasses\ {\isaliteral{2B}{\isacharplus}}\ body{\isaliteral{22}{\isachardoublequote}}} defines
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   672
  a new class \isa{c}, inheriting from \isa{superclasses}.  This
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   673
  introduces a locale \isa{c} with import of all locales \isa{superclasses}.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   674
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   675
  Any \hyperlink{element.fixes}{\mbox{\isa{\isakeyword{fixes}}}} in \isa{body} are lifted to the global
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   676
  theory level (\emph{class operations} \isa{{\isaliteral{22}{\isachardoublequote}}f\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ f\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}} of class \isa{c}), mapping the local type parameter
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   677
  \isa{{\isaliteral{5C3C616C7068613E}{\isasymalpha}}} to a schematic type variable \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3F}{\isacharquery}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ c{\isaliteral{22}{\isachardoublequote}}}.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   678
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   679
  Likewise, \hyperlink{element.assumes}{\mbox{\isa{\isakeyword{assumes}}}} in \isa{body} are also lifted,
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   680
  mapping each local parameter \isa{{\isaliteral{22}{\isachardoublequote}}f\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{22}{\isachardoublequote}}} to its
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   681
  corresponding global constant \isa{{\isaliteral{22}{\isachardoublequote}}f\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{3F}{\isacharquery}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ c{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{22}{\isachardoublequote}}}.  The
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   682
  corresponding introduction rule is provided as \isa{c{\isaliteral{5F}{\isacharunderscore}}class{\isaliteral{5F}{\isacharunderscore}}axioms{\isaliteral{2E}{\isachardot}}intro}.  This rule should be rarely needed directly
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   683
  --- the \hyperlink{method.intro-classes}{\mbox{\isa{intro{\isaliteral{5F}{\isacharunderscore}}classes}}} method takes care of the details of
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   684
  class membership proofs.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   685
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   686
  \item \hyperlink{command.instantiation}{\mbox{\isa{\isacommand{instantiation}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}t\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{28}{\isacharparenleft}}s\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ s\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{29}{\isacharparenright}}s\ {\isaliteral{5C3C424547494E3E}{\isasymBEGIN}}{\isaliteral{22}{\isachardoublequote}}} opens a theory target (cf.\ \secref{sec:target}) which
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   687
  allows to specify class operations \isa{{\isaliteral{22}{\isachardoublequote}}f\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ f\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}} corresponding
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   688
  to sort \isa{s} at the particular type instance \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ s\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E7375623E}{}\isactrlsub n\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ s\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{29}{\isacharparenright}}\ t{\isaliteral{22}{\isachardoublequote}}}.  A plain \hyperlink{command.instance}{\mbox{\isa{\isacommand{instance}}}} command in the
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   689
  target body poses a goal stating these type arities.  The target is
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   690
  concluded by an \indexref{local}{command}{end}\hyperlink{command.local.end}{\mbox{\isa{\isacommand{end}}}} command.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   691
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   692
  Note that a list of simultaneous type constructors may be given;
31914
0bf275fbe93a instance arities can be simultaneous
haftmann
parents: 31913
diff changeset
   693
  this corresponds nicely to mutually recursive type definitions, e.g.\
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   694
  in Isabelle/HOL.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   695
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   696
  \item \hyperlink{command.instance}{\mbox{\isa{\isacommand{instance}}}} in an instantiation target body sets
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   697
  up a goal stating the type arities claimed at the opening \hyperlink{command.instantiation}{\mbox{\isa{\isacommand{instantiation}}}}.  The proof would usually proceed by \hyperlink{method.intro-classes}{\mbox{\isa{intro{\isaliteral{5F}{\isacharunderscore}}classes}}}, and then establish the characteristic theorems of
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   698
  the type classes involved.  After finishing the proof, the
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   699
  background theory will be augmented by the proven type arities.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   700
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   701
  On the theory level, \hyperlink{command.instance}{\mbox{\isa{\isacommand{instance}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}t\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{28}{\isacharparenleft}}s\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ s\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{29}{\isacharparenright}}s{\isaliteral{22}{\isachardoublequote}}} provides a convenient way to instantiate a type class with no
37115
9b27c3dccb01 updated generated files;
wenzelm
parents: 36454
diff changeset
   702
  need to specify operations: one can continue with the
31681
127e8a8b8cde refined section concerning classes
haftmann
parents: 31047
diff changeset
   703
  instantiation proof immediately.
127e8a8b8cde refined section concerning classes
haftmann
parents: 31047
diff changeset
   704
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   705
  \item \hyperlink{command.subclass}{\mbox{\isa{\isacommand{subclass}}}}~\isa{c} in a class context for class
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   706
  \isa{d} sets up a goal stating that class \isa{c} is logically
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   707
  contained in class \isa{d}.  After finishing the proof, class
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   708
  \isa{d} is proven to be subclass \isa{c} and the locale \isa{c} is interpreted into \isa{d} simultaneously.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   709
31681
127e8a8b8cde refined section concerning classes
haftmann
parents: 31047
diff changeset
   710
  A weakend form of this is available through a further variant of
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   711
  \hyperlink{command.instance}{\mbox{\isa{\isacommand{instance}}}}:  \hyperlink{command.instance}{\mbox{\isa{\isacommand{instance}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}c\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C73756273657465713E}{\isasymsubseteq}}\ c\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}{\isaliteral{22}{\isachardoublequote}}} opens
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   712
  a proof that class \isa{{\isaliteral{22}{\isachardoublequote}}c\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{2}}{\isaliteral{22}{\isachardoublequote}}} implies \isa{{\isaliteral{22}{\isachardoublequote}}c\isaliteral{5C3C5E697375623E}{}\isactrlisub {\isadigit{1}}{\isaliteral{22}{\isachardoublequote}}} without reference
31681
127e8a8b8cde refined section concerning classes
haftmann
parents: 31047
diff changeset
   713
  to the underlying locales;  this is useful if the properties to prove
127e8a8b8cde refined section concerning classes
haftmann
parents: 31047
diff changeset
   714
  the logical connection are not sufficent on the locale level but on
127e8a8b8cde refined section concerning classes
haftmann
parents: 31047
diff changeset
   715
  the theory level.
127e8a8b8cde refined section concerning classes
haftmann
parents: 31047
diff changeset
   716
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   717
  \item \hyperlink{command.print-classes}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}classes}}}} prints all classes in the current
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   718
  theory.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   719
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   720
  \item \hyperlink{command.class-deps}{\mbox{\isa{\isacommand{class{\isaliteral{5F}{\isacharunderscore}}deps}}}} visualizes all classes and their
29706
10e6f2faa1e5 updated type class section
haftmann
parents: 29613
diff changeset
   721
  subclass relations as a Hasse diagram.
10e6f2faa1e5 updated type class section
haftmann
parents: 29613
diff changeset
   722
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   723
  \item \hyperlink{method.intro-classes}{\mbox{\isa{intro{\isaliteral{5F}{\isacharunderscore}}classes}}} repeatedly expands all class
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   724
  introduction rules of this theory.  Note that this method usually
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   725
  needs not be named explicitly, as it is already included in the
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   726
  default proof step (e.g.\ of \hyperlink{command.proof}{\mbox{\isa{\isacommand{proof}}}}).  In particular,
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   727
  instantiation of trivial (syntactic) classes may be performed by a
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   728
  single ``\hyperlink{command.ddot}{\mbox{\isa{\isacommand{{\isaliteral{2E}{\isachardot}}{\isaliteral{2E}{\isachardot}}}}}}'' proof step.
26870
94bedbb34b92 misc reorganization;
wenzelm
parents: 26869
diff changeset
   729
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   730
  \end{description}%
26870
94bedbb34b92 misc reorganization;
wenzelm
parents: 26869
diff changeset
   731
\end{isamarkuptext}%
94bedbb34b92 misc reorganization;
wenzelm
parents: 26869
diff changeset
   732
\isamarkuptrue%
94bedbb34b92 misc reorganization;
wenzelm
parents: 26869
diff changeset
   733
%
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   734
\isamarkupsubsection{The class target%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   735
}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   736
\isamarkuptrue%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   737
%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   738
\begin{isamarkuptext}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   739
%FIXME check
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   740
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   741
  A named context may refer to a locale (cf.\ \secref{sec:target}).
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   742
  If this locale is also a class \isa{c}, apart from the common
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   743
  locale target behaviour the following happens.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   744
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   745
  \begin{itemize}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   746
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   747
  \item Local constant declarations \isa{{\isaliteral{22}{\isachardoublequote}}g{\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{22}{\isachardoublequote}}} referring to the
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   748
  local type parameter \isa{{\isaliteral{5C3C616C7068613E}{\isasymalpha}}} and local parameters \isa{{\isaliteral{22}{\isachardoublequote}}f{\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{22}{\isachardoublequote}}}
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   749
  are accompanied by theory-level constants \isa{{\isaliteral{22}{\isachardoublequote}}g{\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{3F}{\isacharquery}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ c{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{22}{\isachardoublequote}}}
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   750
  referring to theory-level class operations \isa{{\isaliteral{22}{\isachardoublequote}}f{\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{3F}{\isacharquery}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ c{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{22}{\isachardoublequote}}}.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   751
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   752
  \item Local theorem bindings are lifted as are assumptions.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   753
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   754
  \item Local syntax refers to local operations \isa{{\isaliteral{22}{\isachardoublequote}}g{\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{22}{\isachardoublequote}}} and
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   755
  global operations \isa{{\isaliteral{22}{\isachardoublequote}}g{\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{3F}{\isacharquery}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ c{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{22}{\isachardoublequote}}} uniformly.  Type inference
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   756
  resolves ambiguities.  In rare cases, manual type annotations are
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   757
  needed.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   758
  
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   759
  \end{itemize}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   760
\end{isamarkuptext}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   761
\isamarkuptrue%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   762
%
37768
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   763
\isamarkupsubsection{Co-regularity of type classes and arities%
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   764
}
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   765
\isamarkuptrue%
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   766
%
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   767
\begin{isamarkuptext}%
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   768
The class relation together with the collection of
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   769
  type-constructor arities must obey the principle of
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   770
  \emph{co-regularity} as defined below.
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   771
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   772
  \medskip For the subsequent formulation of co-regularity we assume
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   773
  that the class relation is closed by transitivity and reflexivity.
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   774
  Moreover the collection of arities \isa{{\isaliteral{22}{\isachardoublequote}}t\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7665633E}{}\isactrlvec s{\isaliteral{29}{\isacharparenright}}c{\isaliteral{22}{\isachardoublequote}}} is
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   775
  completed such that \isa{{\isaliteral{22}{\isachardoublequote}}t\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7665633E}{}\isactrlvec s{\isaliteral{29}{\isacharparenright}}c{\isaliteral{22}{\isachardoublequote}}} and \isa{{\isaliteral{22}{\isachardoublequote}}c\ {\isaliteral{5C3C73756273657465713E}{\isasymsubseteq}}\ c{\isaliteral{27}{\isacharprime}}{\isaliteral{22}{\isachardoublequote}}}
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   776
  implies \isa{{\isaliteral{22}{\isachardoublequote}}t\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7665633E}{}\isactrlvec s{\isaliteral{29}{\isacharparenright}}c{\isaliteral{27}{\isacharprime}}{\isaliteral{22}{\isachardoublequote}}} for all such declarations.
37768
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   777
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   778
  Treating sorts as finite sets of classes (meaning the intersection),
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   779
  the class relation \isa{{\isaliteral{22}{\isachardoublequote}}c\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C73756273657465713E}{\isasymsubseteq}}\ c\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}{\isaliteral{22}{\isachardoublequote}}} is extended to sorts as
37768
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   780
  follows:
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   781
  \[
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   782
    \isa{{\isaliteral{22}{\isachardoublequote}}s\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C73756273657465713E}{\isasymsubseteq}}\ s\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ {\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}c\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}\ {\isaliteral{5C3C696E3E}{\isasymin}}\ s\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}{\isaliteral{2E}{\isachardot}}\ {\isaliteral{5C3C6578697374733E}{\isasymexists}}c\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C696E3E}{\isasymin}}\ s\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2E}{\isachardot}}\ c\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C73756273657465713E}{\isasymsubseteq}}\ c\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}{\isaliteral{22}{\isachardoublequote}}}
37768
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   783
  \]
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   784
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   785
  This relation on sorts is further extended to tuples of sorts (of
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   786
  the same length) in the component-wise way.
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   787
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   788
  \smallskip Co-regularity of the class relation together with the
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   789
  arities relation means:
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   790
  \[
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   791
    \isa{{\isaliteral{22}{\isachardoublequote}}t\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7665633E}{}\isactrlvec s\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{29}{\isacharparenright}}c\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ t\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{28}{\isacharparenleft}}\isaliteral{5C3C5E7665633E}{}\isactrlvec s\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}{\isaliteral{29}{\isacharparenright}}c\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ c\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C73756273657465713E}{\isasymsubseteq}}\ c\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec s\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C73756273657465713E}{\isasymsubseteq}}\ \isaliteral{5C3C5E7665633E}{}\isactrlvec s\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}{\isaliteral{22}{\isachardoublequote}}}
37768
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   792
  \]
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   793
  \noindent for all such arities.  In other words, whenever the result
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   794
  classes of some type-constructor arities are related, then the
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   795
  argument sorts need to be related in the same way.
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   796
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   797
  \medskip Co-regularity is a very fundamental property of the
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   798
  order-sorted algebra of types.  For example, it entails principle
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   799
  types and most general unifiers, e.g.\ see \cite{nipkow-prehofer}.%
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   800
\end{isamarkuptext}%
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   801
\isamarkuptrue%
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   802
%
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   803
\isamarkupsection{Unrestricted overloading%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   804
}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   805
\isamarkuptrue%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   806
%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   807
\begin{isamarkuptext}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   808
Isabelle/Pure's definitional schemes support certain forms of
31047
c13b0406c039 tuned description of overloading
haftmann
parents: 30548
diff changeset
   809
  overloading (see \secref{sec:consts}).  Overloading means that a
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   810
  constant being declared as \isa{{\isaliteral{22}{\isachardoublequote}}c\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\ decl{\isaliteral{22}{\isachardoublequote}}} may be
31047
c13b0406c039 tuned description of overloading
haftmann
parents: 30548
diff changeset
   811
  defined separately on type instances
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   812
  \isa{{\isaliteral{22}{\isachardoublequote}}c\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C626574613E}{\isasymbeta}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C626574613E}{\isasymbeta}}\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{29}{\isacharparenright}}\ t\ decl{\isaliteral{22}{\isachardoublequote}}}
31047
c13b0406c039 tuned description of overloading
haftmann
parents: 30548
diff changeset
   813
  for each type constructor \isa{t}.  At most occassions
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   814
  overloading will be used in a Haskell-like fashion together with
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   815
  type classes by means of \hyperlink{command.instantiation}{\mbox{\isa{\isacommand{instantiation}}}} (see
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   816
  \secref{sec:class}).  Sometimes low-level overloading is desirable.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   817
  The \hyperlink{command.overloading}{\mbox{\isa{\isacommand{overloading}}}} target provides a convenient view for
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   818
  end-users.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   819
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   820
  \begin{matharray}{rcl}
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   821
    \indexdef{}{command}{overloading}\hypertarget{command.overloading}{\hyperlink{command.overloading}{\mbox{\isa{\isacommand{overloading}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   822
  \end{matharray}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   823
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   824
  \begin{rail}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   825
    'overloading' \\
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   826
    ( string ( '==' | equiv ) term ( '(' 'unchecked' ')' )? + ) 'begin'
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   827
  \end{rail}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   828
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   829
  \begin{description}
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   830
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   831
  \item \hyperlink{command.overloading}{\mbox{\isa{\isacommand{overloading}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}x\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ c\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C414E443E}{\isasymAND}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ x\isaliteral{5C3C5E7375623E}{}\isactrlsub n\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ c\isaliteral{5C3C5E7375623E}{}\isactrlsub n\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}\isaliteral{5C3C5E7375623E}{}\isactrlsub n\ {\isaliteral{5C3C424547494E3E}{\isasymBEGIN}}{\isaliteral{22}{\isachardoublequote}}}
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   832
  opens a theory target (cf.\ \secref{sec:target}) which allows to
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   833
  specify constants with overloaded definitions.  These are identified
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   834
  by an explicitly given mapping from variable names \isa{{\isaliteral{22}{\isachardoublequote}}x\isaliteral{5C3C5E7375623E}{}\isactrlsub i{\isaliteral{22}{\isachardoublequote}}} to
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   835
  constants \isa{{\isaliteral{22}{\isachardoublequote}}c\isaliteral{5C3C5E7375623E}{}\isactrlsub i{\isaliteral{22}{\isachardoublequote}}} at particular type instances.  The
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   836
  definitions themselves are established using common specification
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   837
  tools, using the names \isa{{\isaliteral{22}{\isachardoublequote}}x\isaliteral{5C3C5E7375623E}{}\isactrlsub i{\isaliteral{22}{\isachardoublequote}}} as reference to the
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   838
  corresponding constants.  The target is concluded by \hyperlink{command.local.end}{\mbox{\isa{\isacommand{end}}}}.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   839
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   840
  A \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}unchecked{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} option disables global dependency checks for
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   841
  the corresponding definition, which is occasionally useful for
31047
c13b0406c039 tuned description of overloading
haftmann
parents: 30548
diff changeset
   842
  exotic overloading (see \secref{sec:consts} for a precise description).
c13b0406c039 tuned description of overloading
haftmann
parents: 30548
diff changeset
   843
  It is at the discretion of the user to avoid
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   844
  malformed theory specifications!
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   845
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   846
  \end{description}%
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   847
\end{isamarkuptext}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   848
\isamarkuptrue%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   849
%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   850
\isamarkupsection{Incorporating ML code \label{sec:ML}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   851
}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   852
\isamarkuptrue%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   853
%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   854
\begin{isamarkuptext}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   855
\begin{matharray}{rcl}
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   856
    \indexdef{}{command}{use}\hypertarget{command.use}{\hyperlink{command.use}{\mbox{\isa{\isacommand{use}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   857
    \indexdef{}{command}{ML}\hypertarget{command.ML}{\hyperlink{command.ML}{\mbox{\isa{\isacommand{ML}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   858
    \indexdef{}{command}{ML\_prf}\hypertarget{command.ML-prf}{\hyperlink{command.ML-prf}{\mbox{\isa{\isacommand{ML{\isaliteral{5F}{\isacharunderscore}}prf}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}proof\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ proof{\isaliteral{22}{\isachardoublequote}}} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   859
    \indexdef{}{command}{ML\_val}\hypertarget{command.ML-val}{\hyperlink{command.ML-val}{\mbox{\isa{\isacommand{ML{\isaliteral{5F}{\isacharunderscore}}val}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}any\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   860
    \indexdef{}{command}{ML\_command}\hypertarget{command.ML-command}{\hyperlink{command.ML-command}{\mbox{\isa{\isacommand{ML{\isaliteral{5F}{\isacharunderscore}}command}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}any\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   861
    \indexdef{}{command}{setup}\hypertarget{command.setup}{\hyperlink{command.setup}{\mbox{\isa{\isacommand{setup}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   862
    \indexdef{}{command}{local\_setup}\hypertarget{command.local-setup}{\hyperlink{command.local-setup}{\mbox{\isa{\isacommand{local{\isaliteral{5F}{\isacharunderscore}}setup}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   863
    \indexdef{}{command}{attribute\_setup}\hypertarget{command.attribute-setup}{\hyperlink{command.attribute-setup}{\mbox{\isa{\isacommand{attribute{\isaliteral{5F}{\isacharunderscore}}setup}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   864
  \end{matharray}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   865
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   866
  \begin{rail}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   867
    'use' name
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   868
    ;
40255
9ffbc25e1606 eliminated obsolete \_ escapes in rail environments;
wenzelm
parents: 40240
diff changeset
   869
    ('ML' | 'ML_prf' | 'ML_val' | 'ML_command' | 'setup' | 'local_setup') text
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   870
    ;
40255
9ffbc25e1606 eliminated obsolete \_ escapes in rail environments;
wenzelm
parents: 40240
diff changeset
   871
    'attribute_setup' name '=' text text
30527
fae488569faf updated generated files;
wenzelm
parents: 30463
diff changeset
   872
    ;
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   873
  \end{rail}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   874
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   875
  \begin{description}
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   876
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   877
  \item \hyperlink{command.use}{\mbox{\isa{\isacommand{use}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}file{\isaliteral{22}{\isachardoublequote}}} reads and executes ML
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   878
  commands from \isa{{\isaliteral{22}{\isachardoublequote}}file{\isaliteral{22}{\isachardoublequote}}}.  The current theory context is passed
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   879
  down to the ML toplevel and may be modified, using \verb|Context.>>| or derived ML commands.  The file name is checked with
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   880
  the \indexref{}{keyword}{uses}\hyperlink{keyword.uses}{\mbox{\isa{\isakeyword{uses}}}} dependency declaration given in the theory
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   881
  header (see also \secref{sec:begin-thy}).
28281
132456af0731 added ML_prf;
wenzelm
parents: 28110
diff changeset
   882
132456af0731 added ML_prf;
wenzelm
parents: 28110
diff changeset
   883
  Top-level ML bindings are stored within the (global or local) theory
132456af0731 added ML_prf;
wenzelm
parents: 28110
diff changeset
   884
  context.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   885
  
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   886
  \item \hyperlink{command.ML}{\mbox{\isa{\isacommand{ML}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}text{\isaliteral{22}{\isachardoublequote}}} is similar to \hyperlink{command.use}{\mbox{\isa{\isacommand{use}}}},
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   887
  but executes ML commands directly from the given \isa{{\isaliteral{22}{\isachardoublequote}}text{\isaliteral{22}{\isachardoublequote}}}.
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   888
  Top-level ML bindings are stored within the (global or local) theory
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   889
  context.
28281
132456af0731 added ML_prf;
wenzelm
parents: 28110
diff changeset
   890
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   891
  \item \hyperlink{command.ML-prf}{\mbox{\isa{\isacommand{ML{\isaliteral{5F}{\isacharunderscore}}prf}}}} is analogous to \hyperlink{command.ML}{\mbox{\isa{\isacommand{ML}}}} but works
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   892
  within a proof context.
28281
132456af0731 added ML_prf;
wenzelm
parents: 28110
diff changeset
   893
132456af0731 added ML_prf;
wenzelm
parents: 28110
diff changeset
   894
  Top-level ML bindings are stored within the proof context in a
132456af0731 added ML_prf;
wenzelm
parents: 28110
diff changeset
   895
  purely sequential fashion, disregarding the nested proof structure.
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   896
  ML bindings introduced by \hyperlink{command.ML-prf}{\mbox{\isa{\isacommand{ML{\isaliteral{5F}{\isacharunderscore}}prf}}}} are discarded at the
28281
132456af0731 added ML_prf;
wenzelm
parents: 28110
diff changeset
   897
  end of the proof.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   898
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   899
  \item \hyperlink{command.ML-val}{\mbox{\isa{\isacommand{ML{\isaliteral{5F}{\isacharunderscore}}val}}}} and \hyperlink{command.ML-command}{\mbox{\isa{\isacommand{ML{\isaliteral{5F}{\isacharunderscore}}command}}}} are diagnostic
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   900
  versions of \hyperlink{command.ML}{\mbox{\isa{\isacommand{ML}}}}, which means that the context may not be
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   901
  updated.  \hyperlink{command.ML-val}{\mbox{\isa{\isacommand{ML{\isaliteral{5F}{\isacharunderscore}}val}}}} echos the bindings produced at the ML
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   902
  toplevel, but \hyperlink{command.ML-command}{\mbox{\isa{\isacommand{ML{\isaliteral{5F}{\isacharunderscore}}command}}}} is silent.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   903
  
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   904
  \item \hyperlink{command.setup}{\mbox{\isa{\isacommand{setup}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}text{\isaliteral{22}{\isachardoublequote}}} changes the current theory
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   905
  context by applying \isa{{\isaliteral{22}{\isachardoublequote}}text{\isaliteral{22}{\isachardoublequote}}}, which refers to an ML expression
30463
f1cb00030d4f updated generated files;
wenzelm
parents: 30242
diff changeset
   906
  of type \verb|theory -> theory|.  This enables to initialize
f1cb00030d4f updated generated files;
wenzelm
parents: 30242
diff changeset
   907
  any object-logic specific tools and packages written in ML, for
f1cb00030d4f updated generated files;
wenzelm
parents: 30242
diff changeset
   908
  example.
f1cb00030d4f updated generated files;
wenzelm
parents: 30242
diff changeset
   909
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   910
  \item \hyperlink{command.local-setup}{\mbox{\isa{\isacommand{local{\isaliteral{5F}{\isacharunderscore}}setup}}}} is similar to \hyperlink{command.setup}{\mbox{\isa{\isacommand{setup}}}} for
30463
f1cb00030d4f updated generated files;
wenzelm
parents: 30242
diff changeset
   911
  a local theory context, and an ML expression of type \verb|local_theory -> local_theory|.  This allows to
f1cb00030d4f updated generated files;
wenzelm
parents: 30242
diff changeset
   912
  invoke local theory specification packages without going through
f1cb00030d4f updated generated files;
wenzelm
parents: 30242
diff changeset
   913
  concrete outer syntax, for example.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   914
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   915
  \item \hyperlink{command.attribute-setup}{\mbox{\isa{\isacommand{attribute{\isaliteral{5F}{\isacharunderscore}}setup}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}name\ {\isaliteral{3D}{\isacharequal}}\ text\ description{\isaliteral{22}{\isachardoublequote}}}
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   916
  defines an attribute in the current theory.  The given \isa{{\isaliteral{22}{\isachardoublequote}}text{\isaliteral{22}{\isachardoublequote}}} has to be an ML expression of type
30527
fae488569faf updated generated files;
wenzelm
parents: 30463
diff changeset
   917
  \verb|attribute context_parser|, cf.\ basic parsers defined in
fae488569faf updated generated files;
wenzelm
parents: 30463
diff changeset
   918
  structure \verb|Args| and \verb|Attrib|.
fae488569faf updated generated files;
wenzelm
parents: 30463
diff changeset
   919
fae488569faf updated generated files;
wenzelm
parents: 30463
diff changeset
   920
  In principle, attributes can operate both on a given theorem and the
fae488569faf updated generated files;
wenzelm
parents: 30463
diff changeset
   921
  implicit context, although in practice only one is modified and the
fae488569faf updated generated files;
wenzelm
parents: 30463
diff changeset
   922
  other serves as parameter.  Here are examples for these two cases:
fae488569faf updated generated files;
wenzelm
parents: 30463
diff changeset
   923
fae488569faf updated generated files;
wenzelm
parents: 30463
diff changeset
   924
  \end{description}%
fae488569faf updated generated files;
wenzelm
parents: 30463
diff changeset
   925
\end{isamarkuptext}%
fae488569faf updated generated files;
wenzelm
parents: 30463
diff changeset
   926
\isamarkuptrue%
fae488569faf updated generated files;
wenzelm
parents: 30463
diff changeset
   927
%
fae488569faf updated generated files;
wenzelm
parents: 30463
diff changeset
   928
\isadelimML
fae488569faf updated generated files;
wenzelm
parents: 30463
diff changeset
   929
\ \ \ \ %
fae488569faf updated generated files;
wenzelm
parents: 30463
diff changeset
   930
\endisadelimML
fae488569faf updated generated files;
wenzelm
parents: 30463
diff changeset
   931
%
fae488569faf updated generated files;
wenzelm
parents: 30463
diff changeset
   932
\isatagML
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   933
\isacommand{attribute{\isaliteral{5F}{\isacharunderscore}}setup}\isamarkupfalse%
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   934
\ my{\isaliteral{5F}{\isacharunderscore}}rule\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{7B2A}{\isacharverbatimopen}}\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   935
\ \ \ \ \ \ Attrib{\isaliteral{2E}{\isachardot}}thms\ {\isaliteral{3E}{\isachargreater}}{\isaliteral{3E}{\isachargreater}}\ {\isaliteral{28}{\isacharparenleft}}fn\ ths\ {\isaliteral{3D}{\isacharequal}}{\isaliteral{3E}{\isachargreater}}\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   936
\ \ \ \ \ \ \ \ Thm{\isaliteral{2E}{\isachardot}}rule{\isaliteral{5F}{\isacharunderscore}}attribute\ {\isaliteral{28}{\isacharparenleft}}fn\ context{\isaliteral{3A}{\isacharcolon}}\ Context{\isaliteral{2E}{\isachardot}}generic\ {\isaliteral{3D}{\isacharequal}}{\isaliteral{3E}{\isachargreater}}\ fn\ th{\isaliteral{3A}{\isacharcolon}}\ thm\ {\isaliteral{3D}{\isacharequal}}{\isaliteral{3E}{\isachargreater}}\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   937
\ \ \ \ \ \ \ \ \ \ let\ val\ th{\isaliteral{27}{\isacharprime}}\ {\isaliteral{3D}{\isacharequal}}\ th\ OF\ ths\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   938
\ \ \ \ \ \ \ \ \ \ in\ th{\isaliteral{27}{\isacharprime}}\ end{\isaliteral{29}{\isacharparenright}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{2A7D}{\isacharverbatimclose}}\ \ {\isaliteral{22}{\isachardoublequoteopen}}my\ rule{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
30527
fae488569faf updated generated files;
wenzelm
parents: 30463
diff changeset
   939
\isanewline
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   940
\ \ \ \ \isacommand{attribute{\isaliteral{5F}{\isacharunderscore}}setup}\isamarkupfalse%
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   941
\ my{\isaliteral{5F}{\isacharunderscore}}declaration\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{7B2A}{\isacharverbatimopen}}\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   942
\ \ \ \ \ \ Attrib{\isaliteral{2E}{\isachardot}}thms\ {\isaliteral{3E}{\isachargreater}}{\isaliteral{3E}{\isachargreater}}\ {\isaliteral{28}{\isacharparenleft}}fn\ ths\ {\isaliteral{3D}{\isacharequal}}{\isaliteral{3E}{\isachargreater}}\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   943
\ \ \ \ \ \ \ \ Thm{\isaliteral{2E}{\isachardot}}declaration{\isaliteral{5F}{\isacharunderscore}}attribute\ {\isaliteral{28}{\isacharparenleft}}fn\ th{\isaliteral{3A}{\isacharcolon}}\ thm\ {\isaliteral{3D}{\isacharequal}}{\isaliteral{3E}{\isachargreater}}\ fn\ context{\isaliteral{3A}{\isacharcolon}}\ Context{\isaliteral{2E}{\isachardot}}generic\ {\isaliteral{3D}{\isacharequal}}{\isaliteral{3E}{\isachargreater}}\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   944
\ \ \ \ \ \ \ \ \ \ let\ val\ context{\isaliteral{27}{\isacharprime}}\ {\isaliteral{3D}{\isacharequal}}\ context\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   945
\ \ \ \ \ \ \ \ \ \ in\ context{\isaliteral{27}{\isacharprime}}\ end{\isaliteral{29}{\isacharparenright}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{2A7D}{\isacharverbatimclose}}\ \ {\isaliteral{22}{\isachardoublequoteopen}}my\ declaration{\isaliteral{22}{\isachardoublequoteclose}}%
30527
fae488569faf updated generated files;
wenzelm
parents: 30463
diff changeset
   946
\endisatagML
fae488569faf updated generated files;
wenzelm
parents: 30463
diff changeset
   947
{\isafoldML}%
fae488569faf updated generated files;
wenzelm
parents: 30463
diff changeset
   948
%
fae488569faf updated generated files;
wenzelm
parents: 30463
diff changeset
   949
\isadelimML
fae488569faf updated generated files;
wenzelm
parents: 30463
diff changeset
   950
%
fae488569faf updated generated files;
wenzelm
parents: 30463
diff changeset
   951
\endisadelimML
fae488569faf updated generated files;
wenzelm
parents: 30463
diff changeset
   952
%
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   953
\isamarkupsection{Primitive specification elements%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   954
}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   955
\isamarkuptrue%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   956
%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   957
\isamarkupsubsection{Type classes and sorts \label{sec:classes}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   958
}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   959
\isamarkuptrue%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   960
%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   961
\begin{isamarkuptext}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   962
\begin{matharray}{rcll}
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   963
    \indexdef{}{command}{classes}\hypertarget{command.classes}{\hyperlink{command.classes}{\mbox{\isa{\isacommand{classes}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   964
    \indexdef{}{command}{classrel}\hypertarget{command.classrel}{\hyperlink{command.classrel}{\mbox{\isa{\isacommand{classrel}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} & (axiomatic!) \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   965
    \indexdef{}{command}{default\_sort}\hypertarget{command.default-sort}{\hyperlink{command.default-sort}{\mbox{\isa{\isacommand{default{\isaliteral{5F}{\isacharunderscore}}sort}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}}
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   966
  \end{matharray}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   967
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   968
  \begin{rail}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   969
    'classes' (classdecl +)
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   970
    ;
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   971
    'classrel' (nameref ('<' | subseteq) nameref + 'and')
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   972
    ;
40255
9ffbc25e1606 eliminated obsolete \_ escapes in rail environments;
wenzelm
parents: 40240
diff changeset
   973
    'default_sort' sort
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   974
    ;
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   975
  \end{rail}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   976
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   977
  \begin{description}
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   978
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   979
  \item \hyperlink{command.classes}{\mbox{\isa{\isacommand{classes}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}c\ {\isaliteral{5C3C73756273657465713E}{\isasymsubseteq}}\ c\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ c\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}} declares class
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   980
  \isa{c} to be a subclass of existing classes \isa{{\isaliteral{22}{\isachardoublequote}}c\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ c\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}}.
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   981
  Isabelle implicitly maintains the transitive closure of the class
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   982
  hierarchy.  Cyclic class structures are not permitted.
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   983
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   984
  \item \hyperlink{command.classrel}{\mbox{\isa{\isacommand{classrel}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}c\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C73756273657465713E}{\isasymsubseteq}}\ c\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}{\isaliteral{22}{\isachardoublequote}}} states subclass
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   985
  relations between existing classes \isa{{\isaliteral{22}{\isachardoublequote}}c\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{22}{\isachardoublequote}}} and \isa{{\isaliteral{22}{\isachardoublequote}}c\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}{\isaliteral{22}{\isachardoublequote}}}.
37768
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   986
  This is done axiomatically!  The \indexref{}{command}{subclass}\hyperlink{command.subclass}{\mbox{\isa{\isacommand{subclass}}}} and
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   987
  \indexref{}{command}{instance}\hyperlink{command.instance}{\mbox{\isa{\isacommand{instance}}}} commands (see \secref{sec:class}) provide
e86221f3bac7 moved co-regularity to class section; avoid duplicated class_deps
haftmann
parents: 37115
diff changeset
   988
  a way to introduce proven class relations.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   989
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
   990
  \item \hyperlink{command.default-sort}{\mbox{\isa{\isacommand{default{\isaliteral{5F}{\isacharunderscore}}sort}}}}~\isa{s} makes sort \isa{s} the
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   991
  new default sort for any type variable that is given explicitly in
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   992
  the text, but lacks a sort constraint (wrt.\ the current context).
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   993
  Type variables generated by type inference are not affected.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   994
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   995
  Usually the default sort is only changed when defining a new
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   996
  object-logic.  For example, the default sort in Isabelle/HOL is
39831
350857040d09 prefer checked antiquotations;
wenzelm
parents: 39280
diff changeset
   997
  \isa{type}, the class of all HOL types.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
   998
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
   999
  When merging theories, the default sorts of the parents are
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1000
  logically intersected, i.e.\ the representations as lists of classes
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1001
  are joined.
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1002
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1003
  \end{description}%
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1004
\end{isamarkuptext}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1005
\isamarkuptrue%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1006
%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1007
\isamarkupsubsection{Types and type abbreviations \label{sec:types-pure}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1008
}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1009
\isamarkuptrue%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1010
%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1011
\begin{isamarkuptext}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1012
\begin{matharray}{rcll}
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1013
    \indexdef{}{command}{types}\hypertarget{command.types}{\hyperlink{command.types}{\mbox{\isa{\isacommand{types}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1014
    \indexdef{}{command}{typedecl}\hypertarget{command.typedecl}{\hyperlink{command.typedecl}{\mbox{\isa{\isacommand{typedecl}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1015
    \indexdef{}{command}{arities}\hypertarget{command.arities}{\hyperlink{command.arities}{\mbox{\isa{\isacommand{arities}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} & (axiomatic!) \\
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1016
  \end{matharray}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1017
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1018
  \begin{rail}
35351
7425aece4ee3 allow general mixfix syntax for type constructors;
wenzelm
parents: 35282
diff changeset
  1019
    'types' (typespec '=' type mixfix? +)
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1020
    ;
35351
7425aece4ee3 allow general mixfix syntax for type constructors;
wenzelm
parents: 35282
diff changeset
  1021
    'typedecl' typespec mixfix?
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1022
    ;
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1023
    'arities' (nameref '::' arity +)
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1024
    ;
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1025
  \end{rail}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1026
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1027
  \begin{description}
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1028
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1029
  \item \hyperlink{command.types}{\mbox{\isa{\isacommand{types}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{29}{\isacharparenright}}\ t\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{22}{\isachardoublequote}}} introduces a
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1030
  \emph{type synonym} \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{29}{\isacharparenright}}\ t{\isaliteral{22}{\isachardoublequote}}} for the existing type
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1031
  \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C7461753E}{\isasymtau}}{\isaliteral{22}{\isachardoublequote}}}.  Unlike actual type definitions, as are available in
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1032
  Isabelle/HOL for example, type synonyms are merely syntactic
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1033
  abbreviations without any logical significance.  Internally, type
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1034
  synonyms are fully expanded.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1035
  
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1036
  \item \hyperlink{command.typedecl}{\mbox{\isa{\isacommand{typedecl}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{29}{\isacharparenright}}\ t{\isaliteral{22}{\isachardoublequote}}} declares a new
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1037
  type constructor \isa{t}.  If the object-logic defines a base sort
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1038
  \isa{s}, then the constructor is declared to operate on that, via
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1039
  the axiomatic specification \hyperlink{command.arities}{\mbox{\isa{\isacommand{arities}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}t\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{28}{\isacharparenleft}}s{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ s{\isaliteral{29}{\isacharparenright}}s{\isaliteral{22}{\isachardoublequote}}}.
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1040
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1041
  \item \hyperlink{command.arities}{\mbox{\isa{\isacommand{arities}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}t\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{28}{\isacharparenleft}}s\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ s\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{29}{\isacharparenright}}s{\isaliteral{22}{\isachardoublequote}}} augments
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1042
  Isabelle's order-sorted signature of types by new type constructor
35282
8fd9d555d04d dropped references to old axclass from documentation
haftmann
parents: 33868
diff changeset
  1043
  arities.  This is done axiomatically!  The \indexref{}{command}{instantiation}\hyperlink{command.instantiation}{\mbox{\isa{\isacommand{instantiation}}}}
8fd9d555d04d dropped references to old axclass from documentation
haftmann
parents: 33868
diff changeset
  1044
  target (see \secref{sec:class}) provides a way to introduce
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1045
  proven type arities.
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1046
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1047
  \end{description}%
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1048
\end{isamarkuptext}%
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1049
\isamarkuptrue%
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1050
%
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1051
\isamarkupsubsection{Constants and definitions \label{sec:consts}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1052
}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1053
\isamarkuptrue%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1054
%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1055
\begin{isamarkuptext}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1056
Definitions essentially express abbreviations within the logic.  The
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1057
  simplest form of a definition is \isa{{\isaliteral{22}{\isachardoublequote}}c\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ t{\isaliteral{22}{\isachardoublequote}}}, where \isa{c} is a newly declared constant.  Isabelle also allows derived forms
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1058
  where the arguments of \isa{c} appear on the left, abbreviating a
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1059
  prefix of \isa{{\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}}-abstractions, e.g.\ \isa{{\isaliteral{22}{\isachardoublequote}}c\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ {\isaliteral{5C3C6C616D6264613E}{\isasymlambda}}x\ y{\isaliteral{2E}{\isachardot}}\ t{\isaliteral{22}{\isachardoublequote}}} may be
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1060
  written more conveniently as \isa{{\isaliteral{22}{\isachardoublequote}}c\ x\ y\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ t{\isaliteral{22}{\isachardoublequote}}}.  Moreover,
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1061
  definitions may be weakened by adding arbitrary pre-conditions:
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1062
  \isa{{\isaliteral{22}{\isachardoublequote}}A\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ c\ x\ y\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ t{\isaliteral{22}{\isachardoublequote}}}.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1063
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1064
  \medskip The built-in well-formedness conditions for definitional
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1065
  specifications are:
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1066
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1067
  \begin{itemize}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1068
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1069
  \item Arguments (on the left-hand side) must be distinct variables.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1070
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1071
  \item All variables on the right-hand side must also appear on the
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1072
  left-hand side.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1073
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1074
  \item All type variables on the right-hand side must also appear on
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1075
  the left-hand side; this prohibits \isa{{\isaliteral{22}{\isachardoublequote}}{\isadigit{0}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ nat\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ length\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{5D}{\isacharbrackright}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\ list{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} for example.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1076
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1077
  \item The definition must not be recursive.  Most object-logics
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1078
  provide definitional principles that can be used to express
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1079
  recursion safely.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1080
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1081
  \end{itemize}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1082
31047
c13b0406c039 tuned description of overloading
haftmann
parents: 30548
diff changeset
  1083
  The right-hand side of overloaded definitions may mention overloaded constants
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1084
  recursively at type instances corresponding to the immediate
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1085
  argument types \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C626574613E}{\isasymbeta}}\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C626574613E}{\isasymbeta}}\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}}.  Incomplete
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1086
  specification patterns impose global constraints on all occurrences,
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1087
  e.g.\ \isa{{\isaliteral{22}{\isachardoublequote}}d\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\ {\isaliteral{5C3C74696D65733E}{\isasymtimes}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}{\isaliteral{22}{\isachardoublequote}}} on the left-hand side means that all
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1088
  corresponding occurrences on some right-hand side need to be an
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1089
  instance of this, general \isa{{\isaliteral{22}{\isachardoublequote}}d\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C616C7068613E}{\isasymalpha}}\ {\isaliteral{5C3C74696D65733E}{\isasymtimes}}\ {\isaliteral{5C3C626574613E}{\isasymbeta}}{\isaliteral{22}{\isachardoublequote}}} will be disallowed.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1090
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1091
  \begin{matharray}{rcl}
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1092
    \indexdef{}{command}{consts}\hypertarget{command.consts}{\hyperlink{command.consts}{\mbox{\isa{\isacommand{consts}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1093
    \indexdef{}{command}{defs}\hypertarget{command.defs}{\hyperlink{command.defs}{\mbox{\isa{\isacommand{defs}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1094
  \end{matharray}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1095
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1096
  \begin{rail}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1097
    'consts' ((name '::' type mixfix?) +)
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1098
    ;
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1099
    'defs' ('(' 'unchecked'? 'overloaded'? ')')? \\ (axmdecl prop +)
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1100
    ;
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1101
  \end{rail}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1102
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1103
  \begin{description}
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1104
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1105
  \item \hyperlink{command.consts}{\mbox{\isa{\isacommand{consts}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}c\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}{\isaliteral{22}{\isachardoublequote}}} declares constant \isa{c} to have any instance of type scheme \isa{{\isaliteral{5C3C7369676D613E}{\isasymsigma}}}.  The optional
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1106
  mixfix annotations may attach concrete syntax to the constants
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1107
  declared.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1108
  
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1109
  \item \hyperlink{command.defs}{\mbox{\isa{\isacommand{defs}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}name{\isaliteral{3A}{\isacharcolon}}\ eqn{\isaliteral{22}{\isachardoublequote}}} introduces \isa{eqn}
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1110
  as a definitional axiom for some existing constant.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1111
  
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1112
  The \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}unchecked{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} option disables global dependency checks
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1113
  for this definition, which is occasionally useful for exotic
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1114
  overloading.  It is at the discretion of the user to avoid malformed
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1115
  theory specifications!
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1116
  
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1117
  The \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}overloaded{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} option declares definitions to be
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1118
  potentially overloaded.  Unless this option is given, a warning
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1119
  message would be issued for any definitional equation with a more
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1120
  special type than that of the corresponding constant declaration.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1121
  
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1122
  \end{description}%
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1123
\end{isamarkuptext}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1124
\isamarkuptrue%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1125
%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1126
\isamarkupsection{Axioms and theorems \label{sec:axms-thms}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1127
}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1128
\isamarkuptrue%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1129
%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1130
\begin{isamarkuptext}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1131
\begin{matharray}{rcll}
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1132
    \indexdef{}{command}{axioms}\hypertarget{command.axioms}{\hyperlink{command.axioms}{\mbox{\isa{\isacommand{axioms}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} & (axiomatic!) \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1133
    \indexdef{}{command}{lemmas}\hypertarget{command.lemmas}{\hyperlink{command.lemmas}{\mbox{\isa{\isacommand{lemmas}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1134
    \indexdef{}{command}{theorems}\hypertarget{command.theorems}{\hyperlink{command.theorems}{\mbox{\isa{\isacommand{theorems}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1135
  \end{matharray}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1136
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1137
  \begin{rail}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1138
    'axioms' (axmdecl prop +)
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1139
    ;
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1140
    ('lemmas' | 'theorems') target? (thmdef? thmrefs + 'and')
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1141
    ;
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1142
  \end{rail}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1143
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1144
  \begin{description}
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1145
  
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1146
  \item \hyperlink{command.axioms}{\mbox{\isa{\isacommand{axioms}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}a{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7068693E}{\isasymphi}}{\isaliteral{22}{\isachardoublequote}}} introduces arbitrary
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1147
  statements as axioms of the meta-logic.  In fact, axioms are
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1148
  ``axiomatic theorems'', and may be referred later just as any other
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1149
  theorem.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1150
  
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1151
  Axioms are usually only introduced when declaring new logical
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1152
  systems.  Everyday work is typically done the hard way, with proper
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1153
  definitions and proven theorems.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1154
  
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1155
  \item \hyperlink{command.lemmas}{\mbox{\isa{\isacommand{lemmas}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}a\ {\isaliteral{3D}{\isacharequal}}\ b\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ b\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}} retrieves and stores
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1156
  existing facts in the theory context, or the specified target
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1157
  context (see also \secref{sec:target}).  Typical applications would
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1158
  also involve attributes, to declare Simplifier rules, for example.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1159
  
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1160
  \item \hyperlink{command.theorems}{\mbox{\isa{\isacommand{theorems}}}} is essentially the same as \hyperlink{command.lemmas}{\mbox{\isa{\isacommand{lemmas}}}}, but marks the result as a different kind of facts.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1161
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1162
  \end{description}%
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1163
\end{isamarkuptext}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1164
\isamarkuptrue%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1165
%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1166
\isamarkupsection{Oracles%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1167
}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1168
\isamarkuptrue%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1169
%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1170
\begin{isamarkuptext}%
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1171
Oracles allow Isabelle to take advantage of external reasoners
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1172
  such as arithmetic decision procedures, model checkers, fast
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1173
  tautology checkers or computer algebra systems.  Invoked as an
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1174
  oracle, an external reasoner can create arbitrary Isabelle theorems.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1175
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1176
  It is the responsibility of the user to ensure that the external
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1177
  reasoner is as trustworthy as the application requires.  Another
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1178
  typical source of errors is the linkup between Isabelle and the
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1179
  external tool, not just its concrete implementation, but also the
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1180
  required translation between two different logical environments.
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1181
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1182
  Isabelle merely guarantees well-formedness of the propositions being
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1183
  asserted, and records within the internal derivation object how
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1184
  presumed theorems depend on unproven suppositions.
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1185
40240
wenzelm
parents: 40239
diff changeset
  1186
  \begin{matharray}{rcll}
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1187
    \indexdef{}{command}{oracle}\hypertarget{command.oracle}{\hyperlink{command.oracle}{\mbox{\isa{\isacommand{oracle}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} & (axiomatic!) \\
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1188
  \end{matharray}
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1189
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1190
  \begin{rail}
28291
c49b328d689d updated generated file;
wenzelm
parents: 28281
diff changeset
  1191
    'oracle' name '=' text
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1192
    ;
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1193
  \end{rail}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1194
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1195
  \begin{description}
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1196
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1197
  \item \hyperlink{command.oracle}{\mbox{\isa{\isacommand{oracle}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}name\ {\isaliteral{3D}{\isacharequal}}\ text{\isaliteral{22}{\isachardoublequote}}} turns the given ML
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1198
  expression \isa{{\isaliteral{22}{\isachardoublequote}}text{\isaliteral{22}{\isachardoublequote}}} of type \verb|'a -> cterm| into an
28291
c49b328d689d updated generated file;
wenzelm
parents: 28281
diff changeset
  1199
  ML function of type \verb|'a -> thm|, which is bound to the
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1200
  global identifier \verb|name|.  This acts like an infinitary
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1201
  specification of axioms!  Invoking the oracle only works within the
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1202
  scope of the resulting theory.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1203
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1204
  \end{description}
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1205
40802
3cd23f676c5b updated generated files;
wenzelm
parents: 40784
diff changeset
  1206
  See \verb|~~/src/HOL/ex/Iff_Oracle.thy| for a worked example of
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1207
  defining a new primitive rule as oracle, and turning it into a proof
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1208
  method.%
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1209
\end{isamarkuptext}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1210
\isamarkuptrue%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1211
%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1212
\isamarkupsection{Name spaces%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1213
}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1214
\isamarkuptrue%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1215
%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1216
\begin{isamarkuptext}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1217
\begin{matharray}{rcl}
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1218
    \indexdef{}{command}{hide\_class}\hypertarget{command.hide-class}{\hyperlink{command.hide-class}{\mbox{\isa{\isacommand{hide{\isaliteral{5F}{\isacharunderscore}}class}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1219
    \indexdef{}{command}{hide\_type}\hypertarget{command.hide-type}{\hyperlink{command.hide-type}{\mbox{\isa{\isacommand{hide{\isaliteral{5F}{\isacharunderscore}}type}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1220
    \indexdef{}{command}{hide\_const}\hypertarget{command.hide-const}{\hyperlink{command.hide-const}{\mbox{\isa{\isacommand{hide{\isaliteral{5F}{\isacharunderscore}}const}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1221
    \indexdef{}{command}{hide\_fact}\hypertarget{command.hide-fact}{\hyperlink{command.hide-fact}{\mbox{\isa{\isacommand{hide{\isaliteral{5F}{\isacharunderscore}}fact}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1222
  \end{matharray}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1223
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1224
  \begin{rail}
40255
9ffbc25e1606 eliminated obsolete \_ escapes in rail environments;
wenzelm
parents: 40240
diff changeset
  1225
    ( 'hide_class' | 'hide_type' | 'hide_const' | 'hide_fact' ) ('(open)')? (nameref + )
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1226
    ;
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1227
  \end{rail}
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1228
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1229
  Isabelle organizes any kind of name declarations (of types,
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1230
  constants, theorems etc.) by separate hierarchically structured name
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1231
  spaces.  Normally the user does not have to control the behavior of
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1232
  name spaces by hand, yet the following commands provide some way to
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1233
  do so.
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1234
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1235
  \begin{description}
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1236
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1237
  \item \hyperlink{command.hide-class}{\mbox{\isa{\isacommand{hide{\isaliteral{5F}{\isacharunderscore}}class}}}}~\isa{names} fully removes class
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1238
  declarations from a given name space; with the \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}open{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}
39977
c9cbc16e93ce do not mention unqualified names, now that 'global' and 'local' are gone
krauss
parents: 39280
diff changeset
  1239
  option, only the base name is hidden.
36177
8e0770d2e499 separate commands 'hide_class', 'hide_type', 'hide_const', 'hide_fact';
wenzelm
parents: 35681
diff changeset
  1240
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1241
  Note that hiding name space accesses has no impact on logical
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1242
  declarations --- they remain valid internally.  Entities that are no
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1243
  longer accessible to the user are printed with the special qualifier
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1244
  ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3F}{\isacharquery}}{\isaliteral{3F}{\isacharquery}}{\isaliteral{22}{\isachardoublequote}}}'' prefixed to the full internal name.
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1245
40406
313a24b66a8d updated generated files;
wenzelm
parents: 40256
diff changeset
  1246
  \item \hyperlink{command.hide-type}{\mbox{\isa{\isacommand{hide{\isaliteral{5F}{\isacharunderscore}}type}}}}, \hyperlink{command.hide-const}{\mbox{\isa{\isacommand{hide{\isaliteral{5F}{\isacharunderscore}}const}}}}, and \hyperlink{command.hide-fact}{\mbox{\isa{\isacommand{hide{\isaliteral{5F}{\isacharunderscore}}fact}}}} are similar to \hyperlink{command.hide-class}{\mbox{\isa{\isacommand{hide{\isaliteral{5F}{\isacharunderscore}}class}}}}, but hide types,
36177
8e0770d2e499 separate commands 'hide_class', 'hide_type', 'hide_const', 'hide_fact';
wenzelm
parents: 35681
diff changeset
  1247
  constants, and facts, respectively.
8e0770d2e499 separate commands 'hide_class', 'hide_type', 'hide_const', 'hide_fact';
wenzelm
parents: 35681
diff changeset
  1248
  
28788
ff9d8a8932e4 updated generated files;
wenzelm
parents: 28728
diff changeset
  1249
  \end{description}%
27042
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1250
\end{isamarkuptext}%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1251
\isamarkuptrue%
8fcf19f2168b updated generated file;
wenzelm
parents: 26902
diff changeset
  1252
%
26869
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
  1253
\isadelimtheory
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
  1254
%
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
  1255
\endisadelimtheory
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
  1256
%
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
  1257
\isatagtheory
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
  1258
\isacommand{end}\isamarkupfalse%
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
  1259
%
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
  1260
\endisatagtheory
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
  1261
{\isafoldtheory}%
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
  1262
%
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
  1263
\isadelimtheory
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
  1264
%
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
  1265
\endisadelimtheory
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
  1266
\isanewline
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
  1267
\end{isabellebody}%
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
  1268
%%% Local Variables:
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
  1269
%%% mode: latex
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
  1270
%%% TeX-master: "root"
3bc332135aa7 added chapters for "Specifications" and "Proofs";
wenzelm
parents:
diff changeset
  1271
%%% End: