doc-src/Codegen/Thy/document/Inductive_Predicate.tex
author haftmann
Mon, 27 Sep 2010 16:27:31 +0200
changeset 39745 3aa2bc9c5478
parent 39682 066e2d4d0de8
child 40406 313a24b66a8d
permissions -rw-r--r--
combine quote and typewriter/tt tag
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
     1
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
     2
\begin{isabellebody}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
     3
\def\isabellecontext{Inductive{\isacharunderscore}Predicate}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
     4
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
     5
\isadelimtheory
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
     6
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
     7
\endisadelimtheory
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
     8
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
     9
\isatagtheory
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    10
\isacommand{theory}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    11
\ Inductive{\isacharunderscore}Predicate\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    12
\isakeyword{imports}\ Setup\isanewline
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    13
\isakeyword{begin}\isanewline
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    14
%
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    15
\endisatagtheory
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    16
{\isafoldtheory}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    17
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    18
\isadelimtheory
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    19
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    20
\endisadelimtheory
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    21
%
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    22
\isadeliminvisible
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    23
%
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    24
\endisadeliminvisible
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    25
%
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    26
\isataginvisible
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    27
%
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    28
\endisataginvisible
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    29
{\isafoldinvisible}%
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    30
%
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    31
\isadeliminvisible
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    32
%
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    33
\endisadeliminvisible
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    34
%
38437
ffb1c5bf0425 adaptation to new outline
haftmann
parents: 38405
diff changeset
    35
\isamarkupsection{Inductive Predicates \label{sec:inductive}%
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    36
}
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    37
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    38
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    39
\begin{isamarkuptext}%
38509
9cea8a0e925a updated generated document
haftmann
parents: 38441
diff changeset
    40
The \isa{predicate\ compiler} is an extension of the code generator
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    41
  which turns inductive specifications into equational ones, from
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    42
  which in turn executable code can be generated.  The mechanisms of
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    43
  this compiler are described in detail in
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    44
  \cite{Berghofer-Bulwahn-Haftmann:2009:TPHOL}.
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    45
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    46
  Consider the simple predicate \isa{append} given by these two
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    47
  introduction rules:%
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    48
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    49
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    50
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    51
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    52
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    53
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    54
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    55
\isatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    56
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    57
\begin{isamarkuptext}%
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    58
\isa{append\ {\isacharbrackleft}{\isacharbrackright}\ ys\ ys} \\
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    59
  \isa{append\ xs\ ys\ zs\ {\isasymLongrightarrow}\ append\ {\isacharparenleft}x\ {\isacharhash}\ xs{\isacharparenright}\ ys\ {\isacharparenleft}x\ {\isacharhash}\ zs{\isacharparenright}}%
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    60
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    61
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    62
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    63
\endisatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    64
{\isafoldquote}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    65
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    66
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    67
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    68
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    69
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    70
\begin{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    71
\noindent To invoke the compiler, simply use \indexdef{}{command}{code\_pred}\hypertarget{command.code-pred}{\hyperlink{command.code-pred}{\mbox{\isa{\isacommand{code{\isacharunderscore}pred}}}}}:%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    72
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    73
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    74
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    75
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    76
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    77
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    78
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    79
\isatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    80
\isacommand{code{\isacharunderscore}pred}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    81
\ append\ \isacommand{{\isachardot}}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    82
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    83
\endisatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    84
{\isafoldquote}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    85
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    86
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    87
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    88
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    89
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    90
\begin{isamarkuptext}%
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    91
\noindent The \hyperlink{command.code-pred}{\mbox{\isa{\isacommand{code{\isacharunderscore}pred}}}} command takes the name of the
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    92
  inductive predicate and then you put a period to discharge a trivial
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    93
  correctness proof.  The compiler infers possible modes for the
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    94
  predicate and produces the derived code equations.  Modes annotate
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    95
  which (parts of the) arguments are to be taken as input, and which
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    96
  output. Modes are similar to types, but use the notation \isa{i}
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    97
  for input and \isa{o} for output.
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    98
 
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
    99
  For \isa{append}, the compiler can infer the following modes:
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   100
  \begin{itemize}
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   101
    \item \isa{i\ {\isasymRightarrow}\ i\ {\isasymRightarrow}\ i\ {\isasymRightarrow}\ bool}
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   102
    \item \isa{i\ {\isasymRightarrow}\ i\ {\isasymRightarrow}\ o\ {\isasymRightarrow}\ bool}
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   103
    \item \isa{o\ {\isasymRightarrow}\ o\ {\isasymRightarrow}\ i\ {\isasymRightarrow}\ bool}
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   104
  \end{itemize}
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   105
  You can compute sets of predicates using \indexdef{}{command}{values}\hypertarget{command.values}{\hyperlink{command.values}{\mbox{\isa{\isacommand{values}}}}}:%
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   106
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   107
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   108
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   109
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   110
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   111
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   112
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   113
\isatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   114
\isacommand{values}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   115
\ {\isachardoublequoteopen}{\isacharbraceleft}zs{\isachardot}\ append\ {\isacharbrackleft}{\isacharparenleft}{\isadigit{1}}{\isacharcolon}{\isacharcolon}nat{\isacharparenright}{\isacharcomma}{\isadigit{2}}{\isacharcomma}{\isadigit{3}}{\isacharbrackright}\ {\isacharbrackleft}{\isadigit{4}}{\isacharcomma}{\isadigit{5}}{\isacharbrackright}\ zs{\isacharbraceright}{\isachardoublequoteclose}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   116
\endisatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   117
{\isafoldquote}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   118
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   119
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   120
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   121
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   122
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   123
\begin{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   124
\noindent outputs \isa{{\isacharbraceleft}{\isacharbrackleft}{\isadigit{1}}{\isacharcomma}\ {\isadigit{2}}{\isacharcomma}\ {\isadigit{3}}{\isacharcomma}\ {\isadigit{4}}{\isacharcomma}\ {\isadigit{5}}{\isacharbrackright}{\isacharbraceright}}, and%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   125
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   126
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   127
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   128
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   129
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   130
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   131
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   132
\isatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   133
\isacommand{values}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   134
\ {\isachardoublequoteopen}{\isacharbraceleft}{\isacharparenleft}xs{\isacharcomma}\ ys{\isacharparenright}{\isachardot}\ append\ xs\ ys\ {\isacharbrackleft}{\isacharparenleft}{\isadigit{2}}{\isacharcolon}{\isacharcolon}nat{\isacharparenright}{\isacharcomma}{\isadigit{3}}{\isacharbrackright}{\isacharbraceright}{\isachardoublequoteclose}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   135
\endisatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   136
{\isafoldquote}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   137
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   138
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   139
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   140
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   141
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   142
\begin{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   143
\noindent outputs \isa{{\isacharbraceleft}{\isacharparenleft}{\isacharbrackleft}{\isacharbrackright}{\isacharcomma}\ {\isacharbrackleft}{\isadigit{2}}{\isacharcomma}\ {\isadigit{3}}{\isacharbrackright}{\isacharparenright}{\isacharcomma}\ {\isacharparenleft}{\isacharbrackleft}{\isadigit{2}}{\isacharbrackright}{\isacharcomma}\ {\isacharbrackleft}{\isadigit{3}}{\isacharbrackright}{\isacharparenright}{\isacharcomma}\ {\isacharparenleft}{\isacharbrackleft}{\isadigit{2}}{\isacharcomma}\ {\isadigit{3}}{\isacharbrackright}{\isacharcomma}\ {\isacharbrackleft}{\isacharbrackright}{\isacharparenright}{\isacharbraceright}}.%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   144
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   145
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   146
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   147
\begin{isamarkuptext}%
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   148
\noindent If you are only interested in the first elements of the
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   149
  set comprehension (with respect to a depth-first search on the
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   150
  introduction rules), you can pass an argument to \hyperlink{command.values}{\mbox{\isa{\isacommand{values}}}}
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   151
  to specify the number of elements you want:%
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   152
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   153
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   154
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   155
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   156
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   157
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   158
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   159
\isatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   160
\isacommand{values}\isamarkupfalse%
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   161
\ {\isadigit{1}}\ {\isachardoublequoteopen}{\isacharbraceleft}{\isacharparenleft}xs{\isacharcomma}\ ys{\isacharparenright}{\isachardot}\ append\ xs\ ys\ {\isacharbrackleft}{\isacharparenleft}{\isadigit{1}}{\isacharcolon}{\isacharcolon}nat{\isacharparenright}{\isacharcomma}\ {\isadigit{2}}{\isacharcomma}\ {\isadigit{3}}{\isacharcomma}\ {\isadigit{4}}{\isacharbrackright}{\isacharbraceright}{\isachardoublequoteclose}\isanewline
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   162
\isacommand{values}\isamarkupfalse%
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   163
\ {\isadigit{3}}\ {\isachardoublequoteopen}{\isacharbraceleft}{\isacharparenleft}xs{\isacharcomma}\ ys{\isacharparenright}{\isachardot}\ append\ xs\ ys\ {\isacharbrackleft}{\isacharparenleft}{\isadigit{1}}{\isacharcolon}{\isacharcolon}nat{\isacharparenright}{\isacharcomma}\ {\isadigit{2}}{\isacharcomma}\ {\isadigit{3}}{\isacharcomma}\ {\isadigit{4}}{\isacharbrackright}{\isacharbraceright}{\isachardoublequoteclose}%
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   164
\endisatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   165
{\isafoldquote}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   166
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   167
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   168
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   169
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   170
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   171
\begin{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   172
\noindent The \hyperlink{command.values}{\mbox{\isa{\isacommand{values}}}} command can only compute set
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   173
  comprehensions for which a mode has been inferred.
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   174
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   175
  The code equations for a predicate are made available as theorems with
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   176
  the suffix \isa{equation}, and can be inspected with:%
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   177
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   178
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   179
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   180
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   181
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   182
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   183
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   184
\isatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   185
\isacommand{thm}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   186
\ append{\isachardot}equation%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   187
\endisatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   188
{\isafoldquote}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   189
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   190
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   191
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   192
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   193
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   194
\begin{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   195
\noindent More advanced options are described in the following subsections.%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   196
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   197
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   198
%
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   199
\isamarkupsubsection{Alternative names for functions%
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   200
}
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   201
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   202
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   203
\begin{isamarkuptext}%
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   204
By default, the functions generated from a predicate are named after
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   205
  the predicate with the mode mangled into the name (e.g., \isa{append{\isacharunderscore}i{\isacharunderscore}i{\isacharunderscore}o}).  You can specify your own names as follows:%
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   206
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   207
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   208
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   209
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   210
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   211
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   212
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   213
\isatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   214
\isacommand{code{\isacharunderscore}pred}\isamarkupfalse%
38813
f50f0802ba99 updated generated files
haftmann
parents: 38509
diff changeset
   215
\ {\isacharparenleft}modes{\isacharcolon}\ i\ {\isasymRightarrow}\ i\ {\isasymRightarrow}\ o\ {\isasymRightarrow}\ bool\ as\ concat{\isacharcomma}\isanewline
f50f0802ba99 updated generated files
haftmann
parents: 38509
diff changeset
   216
\ \ o\ {\isasymRightarrow}\ o\ {\isasymRightarrow}\ i\ {\isasymRightarrow}\ bool\ as\ split{\isacharcomma}\isanewline
f50f0802ba99 updated generated files
haftmann
parents: 38509
diff changeset
   217
\ \ i\ {\isasymRightarrow}\ o\ {\isasymRightarrow}\ i\ {\isasymRightarrow}\ bool\ as\ suffix{\isacharparenright}\ append\ \isacommand{{\isachardot}}\isamarkupfalse%
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   218
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   219
\endisatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   220
{\isafoldquote}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   221
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   222
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   223
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   224
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   225
%
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   226
\isamarkupsubsection{Alternative introduction rules%
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   227
}
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   228
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   229
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   230
\begin{isamarkuptext}%
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   231
Sometimes the introduction rules of an predicate are not executable
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   232
  because they contain non-executable constants or specific modes
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   233
  could not be inferred.  It is also possible that the introduction
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   234
  rules yield a function that loops forever due to the execution in a
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   235
  depth-first search manner.  Therefore, you can declare alternative
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   236
  introduction rules for predicates with the attribute \hyperlink{attribute.code-pred-intro}{\mbox{\isa{code{\isacharunderscore}pred{\isacharunderscore}intro}}}.  For example, the transitive closure is defined
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   237
  by:%
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   238
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   239
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   240
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   241
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   242
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   243
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   244
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   245
\isatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   246
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   247
\begin{isamarkuptext}%
39682
066e2d4d0de8 avoid fragile tranclp syntax; corrected resolution; corrected typo
haftmann
parents: 39068
diff changeset
   248
\isa{{\isachardoublequote}r\ a\ b\ {\isasymLongrightarrow}\ tranclp\ r\ a\ b{\isachardoublequote}}\\
066e2d4d0de8 avoid fragile tranclp syntax; corrected resolution; corrected typo
haftmann
parents: 39068
diff changeset
   249
  \isa{{\isachardoublequote}tranclp\ r\ a\ b\ {\isasymLongrightarrow}\ r\ b\ c\ {\isasymLongrightarrow}\ tranclp\ r\ a\ c{\isachardoublequote}}%
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   250
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   251
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   252
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   253
\endisatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   254
{\isafoldquote}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   255
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   256
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   257
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   258
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   259
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   260
\begin{isamarkuptext}%
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   261
\noindent These rules do not suit well for executing the transitive
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   262
  closure with the mode \isa{{\isacharparenleft}i\ {\isasymRightarrow}\ o\ {\isasymRightarrow}\ bool{\isacharparenright}\ {\isasymRightarrow}\ i\ {\isasymRightarrow}\ o\ {\isasymRightarrow}\ bool}, as
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   263
  the second rule will cause an infinite loop in the recursive call.
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   264
  This can be avoided using the following alternative rules which are
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   265
  declared to the predicate compiler by the attribute \hyperlink{attribute.code-pred-intro}{\mbox{\isa{code{\isacharunderscore}pred{\isacharunderscore}intro}}}:%
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   266
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   267
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   268
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   269
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   270
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   271
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   272
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   273
\isatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   274
\isacommand{lemma}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   275
\ {\isacharbrackleft}code{\isacharunderscore}pred{\isacharunderscore}intro{\isacharbrackright}{\isacharcolon}\isanewline
39682
066e2d4d0de8 avoid fragile tranclp syntax; corrected resolution; corrected typo
haftmann
parents: 39068
diff changeset
   276
\ \ {\isachardoublequoteopen}r\ a\ b\ {\isasymLongrightarrow}\ tranclp\ r\ a\ b{\isachardoublequoteclose}\isanewline
066e2d4d0de8 avoid fragile tranclp syntax; corrected resolution; corrected typo
haftmann
parents: 39068
diff changeset
   277
\ \ {\isachardoublequoteopen}r\ a\ b\ {\isasymLongrightarrow}\ tranclp\ r\ b\ c\ {\isasymLongrightarrow}\ tranclp\ r\ a\ c{\isachardoublequoteclose}\isanewline
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   278
\isacommand{by}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   279
\ auto%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   280
\endisatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   281
{\isafoldquote}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   282
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   283
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   284
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   285
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   286
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   287
\begin{isamarkuptext}%
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   288
\noindent After declaring all alternative rules for the transitive
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   289
  closure, you invoke \hyperlink{command.code-pred}{\mbox{\isa{\isacommand{code{\isacharunderscore}pred}}}} as usual.  As you have
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   290
  declared alternative rules for the predicate, you are urged to prove
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   291
  that these introduction rules are complete, i.e., that you can
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   292
  derive an elimination rule for the alternative rules:%
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   293
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   294
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   295
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   296
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   297
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   298
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   299
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   300
\isatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   301
\isacommand{code{\isacharunderscore}pred}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   302
\ tranclp\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   303
\isacommand{proof}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   304
\ {\isacharminus}\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   305
\ \ \isacommand{case}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   306
\ tranclp\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   307
\ \ \isacommand{from}\isamarkupfalse%
39682
066e2d4d0de8 avoid fragile tranclp syntax; corrected resolution; corrected typo
haftmann
parents: 39068
diff changeset
   308
\ this\ converse{\isacharunderscore}tranclpE\ {\isacharbrackleft}OF\ tranclp{\isachardot}prems{\isacharbrackright}\ \isacommand{show}\isamarkupfalse%
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   309
\ thesis\ \isacommand{by}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   310
\ metis\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   311
\isacommand{qed}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   312
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   313
\endisatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   314
{\isafoldquote}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   315
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   316
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   317
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   318
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   319
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   320
\begin{isamarkuptext}%
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   321
\noindent Alternative rules can also be used for constants that have
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   322
  not been defined inductively. For example, the lexicographic order
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   323
  which is defined as:%
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   324
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   325
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   326
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   327
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   328
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   329
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   330
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   331
\isatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   332
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   333
\begin{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   334
\begin{isabelle}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   335
lexord\ r\ {\isacharequal}\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   336
{\isacharbraceleft}{\isacharparenleft}x{\isacharcomma}\ y{\isacharparenright}{\isachardot}\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   337
\isaindent{\ }{\isasymexists}a\ v{\isachardot}\ y\ {\isacharequal}\ x\ {\isacharat}\ a\ {\isacharhash}\ v\ {\isasymor}\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   338
\isaindent{\ {\isasymexists}a\ v{\isachardot}\ }{\isacharparenleft}{\isasymexists}u\ a\ b\ v\ w{\isachardot}\ {\isacharparenleft}a{\isacharcomma}\ b{\isacharparenright}\ {\isasymin}\ r\ {\isasymand}\ x\ {\isacharequal}\ u\ {\isacharat}\ a\ {\isacharhash}\ v\ {\isasymand}\ y\ {\isacharequal}\ u\ {\isacharat}\ b\ {\isacharhash}\ w{\isacharparenright}{\isacharbraceright}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   339
\end{isabelle}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   340
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   341
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   342
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   343
\endisatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   344
{\isafoldquote}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   345
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   346
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   347
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   348
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   349
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   350
\begin{isamarkuptext}%
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   351
\noindent To make it executable, you can derive the following two
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   352
  rules and prove the elimination rule:%
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   353
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   354
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   355
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   356
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   357
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   358
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   359
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   360
\isatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   361
\isacommand{lemma}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   362
\ {\isacharbrackleft}code{\isacharunderscore}pred{\isacharunderscore}intro{\isacharbrackright}{\isacharcolon}\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   363
\ \ {\isachardoublequoteopen}append\ xs\ {\isacharparenleft}a\ {\isacharhash}\ v{\isacharparenright}\ ys\ {\isasymLongrightarrow}\ lexord\ r\ {\isacharparenleft}xs{\isacharcomma}\ ys{\isacharparenright}{\isachardoublequoteclose}\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   364
\isacommand{lemma}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   365
\ {\isacharbrackleft}code{\isacharunderscore}pred{\isacharunderscore}intro{\isacharbrackright}{\isacharcolon}\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   366
\ \ {\isachardoublequoteopen}append\ u\ {\isacharparenleft}a\ {\isacharhash}\ v{\isacharparenright}\ xs\ {\isasymLongrightarrow}\ append\ u\ {\isacharparenleft}b\ {\isacharhash}\ w{\isacharparenright}\ ys\ {\isasymLongrightarrow}\ r\ {\isacharparenleft}a{\isacharcomma}\ b{\isacharparenright}\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   367
\ \ {\isasymLongrightarrow}\ lexord\ r\ {\isacharparenleft}xs{\isacharcomma}\ ys{\isacharparenright}{\isachardoublequoteclose}\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   368
\isacommand{code{\isacharunderscore}pred}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   369
\ lexord%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   370
\endisatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   371
{\isafoldquote}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   372
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   373
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   374
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   375
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   376
%
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   377
\isamarkupsubsection{Options for values%
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   378
}
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   379
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   380
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   381
\begin{isamarkuptext}%
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   382
In the presence of higher-order predicates, multiple modes for some
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   383
  predicate could be inferred that are not disambiguated by the
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   384
  pattern of the set comprehension.  To disambiguate the modes for the
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   385
  arguments of a predicate, you can state the modes explicitly in the
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   386
  \hyperlink{command.values}{\mbox{\isa{\isacommand{values}}}} command.  Consider the simple predicate \isa{succ}:%
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   387
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   388
\isamarkuptrue%
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   389
%
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   390
\isadelimquote
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   391
%
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   392
\endisadelimquote
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   393
%
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   394
\isatagquote
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   395
\isacommand{inductive}\isamarkupfalse%
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   396
\ succ\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequoteopen}nat\ {\isasymRightarrow}\ nat\ {\isasymRightarrow}\ bool{\isachardoublequoteclose}\ \isakeyword{where}\isanewline
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   397
\ \ {\isachardoublequoteopen}succ\ {\isadigit{0}}\ {\isacharparenleft}Suc\ {\isadigit{0}}{\isacharparenright}{\isachardoublequoteclose}\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   398
{\isacharbar}\ {\isachardoublequoteopen}succ\ x\ y\ {\isasymLongrightarrow}\ succ\ {\isacharparenleft}Suc\ x{\isacharparenright}\ {\isacharparenleft}Suc\ y{\isacharparenright}{\isachardoublequoteclose}\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   399
\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   400
\isacommand{code{\isacharunderscore}pred}\isamarkupfalse%
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   401
\ succ\ \isacommand{{\isachardot}}\isamarkupfalse%
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   402
%
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   403
\endisatagquote
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   404
{\isafoldquote}%
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   405
%
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   406
\isadelimquote
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   407
%
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   408
\endisadelimquote
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   409
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   410
\begin{isamarkuptext}%
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   411
\noindent For this, the predicate compiler can infer modes \isa{o\ {\isasymRightarrow}\ o\ {\isasymRightarrow}\ bool}, \isa{i\ {\isasymRightarrow}\ o\ {\isasymRightarrow}\ bool}, \isa{o\ {\isasymRightarrow}\ i\ {\isasymRightarrow}\ bool} and
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   412
  \isa{i\ {\isasymRightarrow}\ i\ {\isasymRightarrow}\ bool}.  The invocation of \hyperlink{command.values}{\mbox{\isa{\isacommand{values}}}}
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   413
  \isa{{\isacharbraceleft}n{\isachardot}\ tranclp\ succ\ {\isadigit{1}}{\isadigit{0}}\ n{\isacharbraceright}} loops, as multiple modes for the
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   414
  predicate \isa{succ} are possible and here the first mode \isa{o\ {\isasymRightarrow}\ o\ {\isasymRightarrow}\ bool} is chosen. To choose another mode for the argument,
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   415
  you can declare the mode for the argument between the \hyperlink{command.values}{\mbox{\isa{\isacommand{values}}}} and the number of elements.%
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   416
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   417
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   418
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   419
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   420
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   421
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   422
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   423
\isatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   424
\isacommand{values}\isamarkupfalse%
39068
5ac590e8b320 updated
haftmann
parents: 38813
diff changeset
   425
\ {\isacharbrackleft}mode{\isacharcolon}\ i\ {\isasymRightarrow}\ o\ {\isasymRightarrow}\ bool{\isacharbrackright}\ {\isadigit{1}}\ {\isachardoublequoteopen}{\isacharbraceleft}n{\isachardot}\ tranclp\ succ\ {\isadigit{1}}{\isadigit{0}}\ n{\isacharbraceright}{\isachardoublequoteclose}\ \isanewline
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   426
\isacommand{values}\isamarkupfalse%
39068
5ac590e8b320 updated
haftmann
parents: 38813
diff changeset
   427
\ {\isacharbrackleft}mode{\isacharcolon}\ o\ {\isasymRightarrow}\ i\ {\isasymRightarrow}\ bool{\isacharbrackright}\ {\isadigit{1}}\ {\isachardoublequoteopen}{\isacharbraceleft}n{\isachardot}\ tranclp\ succ\ n\ {\isadigit{1}}{\isadigit{0}}{\isacharbraceright}{\isachardoublequoteclose}%
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   428
\endisatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   429
{\isafoldquote}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   430
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   431
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   432
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   433
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   434
%
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   435
\isamarkupsubsection{Embedding into functional code within Isabelle/HOL%
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   436
}
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   437
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   438
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   439
\begin{isamarkuptext}%
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   440
To embed the computation of an inductive predicate into functions
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   441
  that are defined in Isabelle/HOL, you have a number of options:
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   442
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   443
  \begin{itemize}
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   444
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   445
    \item You want to use the first-order predicate with the mode
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   446
      where all arguments are input. Then you can use the predicate directly, e.g.
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   447
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   448
      \begin{quote}
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   449
        \isa{valid{\isacharunderscore}suffix\ ys\ zs\ {\isacharequal}} \\
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   450
        \isa{{\isacharparenleft}if\ append\ {\isacharbrackleft}Suc\ {\isadigit{0}}{\isacharcomma}\ {\isadigit{2}}{\isacharbrackright}\ ys\ zs\ then\ Some\ ys\ else\ None{\isacharparenright}}
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   451
      \end{quote}
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   452
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   453
    \item If you know that the execution returns only one value (it is
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   454
      deterministic), then you can use the combinator \isa{Predicate{\isachardot}the}, e.g., a functional concatenation of lists is
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   455
      defined with
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   456
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   457
      \begin{quote}
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   458
        \isa{functional{\isacharunderscore}concat\ xs\ ys\ {\isacharequal}\ Predicate{\isachardot}the\ {\isacharparenleft}append{\isacharunderscore}i{\isacharunderscore}i{\isacharunderscore}o\ xs\ ys{\isacharparenright}}
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   459
      \end{quote}
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   460
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   461
      Note that if the evaluation does not return a unique value, it
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   462
      raises a run-time error \isa{not{\isacharunderscore}unique}.
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   463
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   464
  \end{itemize}%
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   465
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   466
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   467
%
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   468
\isamarkupsubsection{Further Examples%
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   469
}
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   470
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   471
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   472
\begin{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   473
Further examples for compiling inductive predicates can be found in
39682
066e2d4d0de8 avoid fragile tranclp syntax; corrected resolution; corrected typo
haftmann
parents: 39068
diff changeset
   474
  the \isa{HOL{\isacharslash}ex{\isacharslash}Predicate{\isacharunderscore}Compile{\isacharunderscore}ex{\isachardot}thy} theory file.  There are
38441
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   475
  also some examples in the Archive of Formal Proofs, notably in the
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   476
  \isa{POPLmark{\isacharminus}deBruijn} and the \isa{FeatherweightJava}
2fffd5ac487f tuned section on predicate compiler
haftmann
parents: 38437
diff changeset
   477
  sessions.%
37614
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   478
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   479
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   480
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   481
\isadelimtheory
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   482
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   483
\endisadelimtheory
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   484
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   485
\isatagtheory
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   486
\isacommand{end}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   487
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   488
\endisatagtheory
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   489
{\isafoldtheory}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   490
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   491
\isadelimtheory
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   492
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   493
\endisadelimtheory
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   494
\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   495
\end{isabellebody}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   496
%%% Local Variables:
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   497
%%% mode: latex
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   498
%%% TeX-master: "root"
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   499
%%% End: