doc-src/Codegen/Thy/document/Inductive_Predicate.tex
author haftmann
Thu, 08 Jul 2010 16:48:33 +0200
changeset 37749 c7e15d59c58d
parent 37614 d804c8b9c2dc
child 38405 7935b334893e
permissions -rw-r--r--
updated documentation
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
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    13
\isakeyword{begin}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    14
\endisatagtheory
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    15
{\isafoldtheory}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    16
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    17
\isadelimtheory
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    18
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    19
\endisadelimtheory
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    20
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    21
\isamarkupsubsection{Inductive Predicates%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    22
}
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    23
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    24
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    25
\begin{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    26
To execute inductive predicates, a special preprocessor, the predicate
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    27
 compiler, generates code equations from the introduction rules of the predicates.
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    28
The mechanisms of this compiler are described in \cite{Berghofer-Bulwahn-Haftmann:2009:TPHOL}.
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    29
Consider the simple predicate \isa{append} given by these two
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    30
introduction rules:%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    31
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    32
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    33
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    34
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    35
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    36
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    37
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    38
\isatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    39
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    40
\begin{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    41
\isa{append\ {\isacharbrackleft}{\isacharbrackright}\ ys\ ys}\\
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    42
\noindent\isa{append\ xs\ ys\ zs\ {\isasymLongrightarrow}\ append\ {\isacharparenleft}x\ {\isacharhash}\ xs{\isacharparenright}\ ys\ {\isacharparenleft}x\ {\isacharhash}\ zs{\isacharparenright}}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    43
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    44
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    45
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    46
\endisatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    47
{\isafoldquote}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    48
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    49
\isadelimquote
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
\endisadelimquote
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
\begin{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    54
\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
    55
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    56
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    57
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    58
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    59
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    60
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    61
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    62
\isatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    63
\isacommand{code{\isacharunderscore}pred}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    64
\ append\ \isacommand{{\isachardot}}\isamarkupfalse%
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
\endisatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    67
{\isafoldquote}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    68
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    69
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    70
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    71
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    72
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    73
\begin{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    74
\noindent The \hyperlink{command.code-pred}{\mbox{\isa{\isacommand{code{\isacharunderscore}pred}}}} command takes the name
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    75
of the inductive predicate and then you put a period to discharge
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    76
a trivial correctness proof. 
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    77
The compiler infers possible modes 
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    78
for the predicate and produces the derived code equations.
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    79
Modes annotate which (parts of the) arguments are to be taken as input,
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    80
and which output. Modes are similar to types, but use the notation \isa{i}
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    81
for input and \isa{o} for output.
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
For \isa{append}, the compiler can infer the following modes:
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    84
\begin{itemize}
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    85
\item \isa{i\ {\isasymRightarrow}\ i\ {\isasymRightarrow}\ i\ {\isasymRightarrow}\ bool}
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    86
\item \isa{i\ {\isasymRightarrow}\ i\ {\isasymRightarrow}\ o\ {\isasymRightarrow}\ bool}
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    87
\item \isa{o\ {\isasymRightarrow}\ o\ {\isasymRightarrow}\ i\ {\isasymRightarrow}\ bool}
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    88
\end{itemize}
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    89
You can compute sets of predicates using \indexdef{}{command}{values}\hypertarget{command.values}{\hyperlink{command.values}{\mbox{\isa{\isacommand{values}}}}}:%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    90
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    91
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    92
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    93
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    94
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    95
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    96
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    97
\isatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    98
\isacommand{values}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
    99
\ {\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
   100
\endisatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   101
{\isafoldquote}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   102
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   103
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   104
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   105
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   106
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   107
\begin{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   108
\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
   109
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   110
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   111
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   112
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   113
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   114
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   115
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   116
\isatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   117
\isacommand{values}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   118
\ {\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
   119
\endisatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   120
{\isafoldquote}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   121
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   122
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   123
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   124
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   125
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   126
\begin{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   127
\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
   128
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   129
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   130
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   131
\begin{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   132
\noindent If you are only interested in the first elements of the set
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   133
comprehension (with respect to a depth-first search on the introduction rules), you can
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   134
pass an argument to
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   135
\hyperlink{command.values}{\mbox{\isa{\isacommand{values}}}} to specify the number of elements you want:%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   136
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   137
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   138
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   139
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   140
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   141
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   142
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   143
\isatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   144
\isacommand{values}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   145
\ {\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
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   146
\isacommand{values}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   147
\ {\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}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   148
\endisatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   149
{\isafoldquote}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   150
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   151
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   152
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   153
\endisadelimquote
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
\begin{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   156
\noindent The \hyperlink{command.values}{\mbox{\isa{\isacommand{values}}}} command can only compute set
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   157
 comprehensions for which a mode has been inferred.
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
The code equations for a predicate are made available as theorems with
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   160
 the suffix \isa{equation}, and can be inspected with:%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   161
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   162
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   163
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   164
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   165
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   166
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   167
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   168
\isatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   169
\isacommand{thm}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   170
\ append{\isachardot}equation%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   171
\endisatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   172
{\isafoldquote}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   173
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   174
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   175
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   176
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   177
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   178
\begin{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   179
\noindent More advanced options are described in the following subsections.%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   180
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   181
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   182
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   183
\isamarkupsubsubsection{Alternative names for functions%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   184
}
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   185
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   186
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   187
\begin{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   188
By default, the functions generated from a predicate are named after the predicate with the
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   189
mode mangled into the name (e.g., \isa{append{\isacharunderscore}i{\isacharunderscore}i{\isacharunderscore}o}).
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   190
You can specify your own names as follows:%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   191
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   192
\isamarkuptrue%
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
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   195
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   196
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   197
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   198
\isatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   199
\isacommand{code{\isacharunderscore}pred}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   200
\ {\isacharparenleft}modes{\isacharcolon}\ i\ {\isacharequal}{\isachargreater}\ i\ {\isacharequal}{\isachargreater}\ o\ {\isacharequal}{\isachargreater}\ bool\ as\ concat{\isacharcomma}\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   201
\ \ o\ {\isacharequal}{\isachargreater}\ o\ {\isacharequal}{\isachargreater}\ i\ {\isacharequal}{\isachargreater}\ bool\ as\ split{\isacharcomma}\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   202
\ \ i\ {\isacharequal}{\isachargreater}\ o\ {\isacharequal}{\isachargreater}\ i\ {\isacharequal}{\isachargreater}\ bool\ as\ suffix{\isacharparenright}\ append\ \isacommand{{\isachardot}}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   203
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   204
\endisatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   205
{\isafoldquote}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   206
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   207
\isadelimquote
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
\endisadelimquote
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
\isamarkupsubsubsection{Alternative introduction rules%
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
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   214
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   215
\begin{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   216
Sometimes the introduction rules of an predicate are not executable because they contain
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   217
non-executable constants or specific modes could not be inferred.
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   218
It is also possible that the introduction rules yield a function that loops forever
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   219
due to the execution in a depth-first search manner.
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   220
Therefore, you can declare alternative introduction rules for predicates with the attribute
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   221
\hyperlink{attribute.code-pred-intro}{\mbox{\isa{code{\isacharunderscore}pred{\isacharunderscore}intro}}}.
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   222
For example, the transitive closure is defined by:%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   223
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   224
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   225
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   226
\isadelimquote
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
\endisadelimquote
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
\isatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   231
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   232
\begin{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   233
\isa{r\ a\ b\ {\isasymLongrightarrow}\ r\isactrlsup {\isacharplus}\isactrlsup {\isacharplus}\ a\ b}\\
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   234
\noindent \isa{{\isasymlbrakk}r\isactrlsup {\isacharplus}\isactrlsup {\isacharplus}\ a\ b{\isacharsemicolon}\ r\ b\ c{\isasymrbrakk}\ {\isasymLongrightarrow}\ r\isactrlsup {\isacharplus}\isactrlsup {\isacharplus}\ a\ c}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   235
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   236
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   237
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   238
\endisatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   239
{\isafoldquote}%
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
\begin{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   246
\noindent These rules do not suit well for executing the transitive closure 
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   247
with the mode \isa{{\isacharparenleft}i\ {\isasymRightarrow}\ o\ {\isasymRightarrow}\ bool{\isacharparenright}\ {\isasymRightarrow}\ i\ {\isasymRightarrow}\ o\ {\isasymRightarrow}\ bool}, as the second rule will
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   248
cause an infinite loop in the recursive call.
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   249
This can be avoided using the following alternative rules which are
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   250
declared to the predicate compiler by the attribute \hyperlink{attribute.code-pred-intro}{\mbox{\isa{code{\isacharunderscore}pred{\isacharunderscore}intro}}}:%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   251
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   252
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   253
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   254
\isadelimquote
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
\endisadelimquote
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
\isatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   259
\isacommand{lemma}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   260
\ {\isacharbrackleft}code{\isacharunderscore}pred{\isacharunderscore}intro{\isacharbrackright}{\isacharcolon}\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   261
\ \ {\isachardoublequoteopen}r\ a\ b\ {\isasymLongrightarrow}\ r\isactrlsup {\isacharplus}\isactrlsup {\isacharplus}\ a\ b{\isachardoublequoteclose}\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   262
\ \ {\isachardoublequoteopen}r\ a\ b\ {\isasymLongrightarrow}\ r\isactrlsup {\isacharplus}\isactrlsup {\isacharplus}\ b\ c\ {\isasymLongrightarrow}\ r\isactrlsup {\isacharplus}\isactrlsup {\isacharplus}\ a\ c{\isachardoublequoteclose}\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   263
\isacommand{by}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   264
\ auto%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   265
\endisatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   266
{\isafoldquote}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   267
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   268
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   269
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   270
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   271
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   272
\begin{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   273
\noindent After declaring all alternative rules for the transitive closure,
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   274
you invoke \hyperlink{command.code-pred}{\mbox{\isa{\isacommand{code{\isacharunderscore}pred}}}} as usual.
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   275
As you have declared alternative rules for the predicate, you are urged to prove that these
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   276
introduction rules are complete, i.e., that you can derive an elimination rule for the
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   277
alternative rules:%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   278
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   279
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   280
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   281
\isadelimquote
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
\endisadelimquote
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
\isatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   286
\isacommand{code{\isacharunderscore}pred}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   287
\ tranclp\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   288
\isacommand{proof}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   289
\ {\isacharminus}\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   290
\ \ \isacommand{case}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   291
\ tranclp\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   292
\ \ \isacommand{from}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   293
\ this\ converse{\isacharunderscore}tranclpE{\isacharbrackleft}OF\ this{\isacharparenleft}{\isadigit{1}}{\isacharparenright}{\isacharbrackright}\ \isacommand{show}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   294
\ thesis\ \isacommand{by}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   295
\ metis\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   296
\isacommand{qed}\isamarkupfalse%
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
\endisatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   299
{\isafoldquote}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   300
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   301
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   302
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   303
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   304
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   305
\begin{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   306
\noindent Alternative rules can also be used for constants that have not
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   307
been defined inductively. For example, the lexicographic order which
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   308
is defined as:%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   309
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   310
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   311
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   312
\isadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   313
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   314
\endisadelimquote
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
\isatagquote
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
\begin{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   319
\begin{isabelle}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   320
lexord\ r\ {\isacharequal}\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   321
{\isacharbraceleft}{\isacharparenleft}x{\isacharcomma}\ y{\isacharparenright}{\isachardot}\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   322
\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
   323
\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
   324
\end{isabelle}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   325
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   326
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   327
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   328
\endisatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   329
{\isafoldquote}%
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
\isadelimquote
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
\endisadelimquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   334
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   335
\begin{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   336
\noindent To make it executable, you can derive the following two rules and prove the
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   337
elimination rule:%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   338
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   339
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   340
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   341
\isadelimproof
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
\endisadelimproof
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   344
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   345
\isatagproof
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   346
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   347
\endisatagproof
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   348
{\isafoldproof}%
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
\isadelimproof
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   351
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   352
\endisadelimproof
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   353
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   354
\isadelimquote
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
\endisadelimquote
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
\isatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   359
\isacommand{lemma}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   360
\ {\isacharbrackleft}code{\isacharunderscore}pred{\isacharunderscore}intro{\isacharbrackright}{\isacharcolon}\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   361
\ \ {\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
   362
\isacommand{lemma}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   363
\ {\isacharbrackleft}code{\isacharunderscore}pred{\isacharunderscore}intro{\isacharbrackright}{\isacharcolon}\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   364
\ \ {\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
   365
\ \ {\isasymLongrightarrow}\ lexord\ r\ {\isacharparenleft}xs{\isacharcomma}\ ys{\isacharparenright}{\isachardoublequoteclose}\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   366
\isacommand{code{\isacharunderscore}pred}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   367
\ lexord%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   368
\endisatagquote
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   369
{\isafoldquote}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   370
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   371
\isadelimquote
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
\endisadelimquote
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
\isamarkupsubsubsection{Options for values%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   376
}
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   377
\isamarkuptrue%
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
\begin{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   380
In the presence of higher-order predicates, multiple modes for some predicate could be inferred
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   381
that are not disambiguated by the pattern of the set comprehension.
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   382
To disambiguate the modes for the arguments of a predicate, you can state
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   383
the modes explicitly in the \hyperlink{command.values}{\mbox{\isa{\isacommand{values}}}} command. 
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   384
Consider the simple predicate \isa{succ}:%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   385
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   386
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   387
\isacommand{inductive}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   388
\ succ\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequoteopen}nat\ {\isasymRightarrow}\ nat\ {\isasymRightarrow}\ bool{\isachardoublequoteclose}\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   389
\isakeyword{where}\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   390
\ \ {\isachardoublequoteopen}succ\ {\isadigit{0}}\ {\isacharparenleft}Suc\ {\isadigit{0}}{\isacharparenright}{\isachardoublequoteclose}\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   391
{\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
   392
\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   393
\isacommand{code{\isacharunderscore}pred}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   394
\ succ%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   395
\isadelimproof
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   396
\ %
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   397
\endisadelimproof
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   398
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   399
\isatagproof
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   400
\isacommand{{\isachardot}}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   401
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   402
\endisatagproof
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   403
{\isafoldproof}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   404
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   405
\isadelimproof
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   406
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   407
\endisadelimproof
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   408
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   409
\begin{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   410
\noindent For this, the predicate compiler can infer modes \isa{o\ {\isasymRightarrow}\ o\ {\isasymRightarrow}\ bool}, \isa{i\ {\isasymRightarrow}\ o\ {\isasymRightarrow}\ bool},
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   411
  \isa{o\ {\isasymRightarrow}\ i\ {\isasymRightarrow}\ bool} and \isa{i\ {\isasymRightarrow}\ i\ {\isasymRightarrow}\ bool}.
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   412
The invocation of \hyperlink{command.values}{\mbox{\isa{\isacommand{values}}}} \isa{{\isacharbraceleft}n{\isachardot}\ tranclp\ succ\ {\isadigit{1}}{\isadigit{0}}\ n{\isacharbraceright}} loops, as multiple
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   413
modes for the predicate \isa{succ} are possible and here the first mode \isa{o\ {\isasymRightarrow}\ o\ {\isasymRightarrow}\ bool}
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   414
is chosen. To choose another mode for the argument, you can declare the mode for the argument between
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   415
the \hyperlink{command.values}{\mbox{\isa{\isacommand{values}}}} and the number of elements.%
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%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   425
\ {\isacharbrackleft}mode{\isacharcolon}\ i\ {\isacharequal}{\isachargreater}\ o\ {\isacharequal}{\isachargreater}\ bool{\isacharbrackright}\ {\isadigit{2}}{\isadigit{0}}\ {\isachardoublequoteopen}{\isacharbraceleft}n{\isachardot}\ tranclp\ succ\ {\isadigit{1}}{\isadigit{0}}\ n{\isacharbraceright}{\isachardoublequoteclose}\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   426
\isacommand{values}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   427
\ {\isacharbrackleft}mode{\isacharcolon}\ o\ {\isacharequal}{\isachargreater}\ i\ {\isacharequal}{\isachargreater}\ bool{\isacharbrackright}\ {\isadigit{1}}{\isadigit{0}}\ {\isachardoublequoteopen}{\isacharbraceleft}n{\isachardot}\ tranclp\ succ\ n\ {\isadigit{1}}{\isadigit{0}}{\isacharbraceright}{\isachardoublequoteclose}%
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
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   435
\isamarkupsubsubsection{Embedding into functional code within Isabelle/HOL%
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}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   440
To embed the computation of an inductive predicate into functions that are defined in Isabelle/HOL,
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   441
you have a number of options:
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   442
\begin{itemize}
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   443
\item You want to use the first-order predicate with the mode
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   444
  where all arguments are input. Then you can use the predicate directly, e.g.
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   445
\begin{quote}
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   446
  \isa{valid{\isacharunderscore}suffix\ ys\ zs\ {\isacharequal}}\\
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   447
  \isa{{\isacharparenleft}if\ append\ {\isacharbrackleft}Suc\ {\isadigit{0}}{\isacharcomma}\ {\isadigit{2}}{\isacharbrackright}\ ys\ zs\ then\ Some\ ys\ else\ None{\isacharparenright}}
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   448
\end{quote}
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   449
\item If you know that the execution returns only one value (it is deterministic), then you can
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   450
  use the combinator \isa{Predicate{\isachardot}the}, e.g., a functional concatenation of lists
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   451
  is defined with
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   452
\begin{quote}
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   453
  \isa{functional{\isacharunderscore}concat\ xs\ ys\ {\isacharequal}\ Predicate{\isachardot}the\ {\isacharparenleft}append{\isacharunderscore}i{\isacharunderscore}i{\isacharunderscore}o\ xs\ ys{\isacharparenright}}
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   454
\end{quote}
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   455
  Note that if the evaluation does not return a unique value, it raises a run-time error
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   456
  \isa{not{\isacharunderscore}unique}.
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   457
\end{itemize}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   458
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   459
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   460
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   461
\isamarkupsubsubsection{Further Examples%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   462
}
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   463
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   464
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   465
\begin{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   466
Further examples for compiling inductive predicates can be found in
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   467
the \isa{HOL{\isacharslash}ex{\isacharslash}Predicate{\isacharunderscore}Compile{\isacharunderscore}ex} theory file.
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   468
There are also some examples in the Archive of Formal Proofs, notably
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   469
in the \isa{POPLmark{\isacharminus}deBruijn} and the \isa{FeatherweightJava} sessions.%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   470
\end{isamarkuptext}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   471
\isamarkuptrue%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   472
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   473
\isadelimtheory
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   474
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   475
\endisadelimtheory
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   476
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   477
\isatagtheory
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   478
\isacommand{end}\isamarkupfalse%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   479
%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   480
\endisatagtheory
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   481
{\isafoldtheory}%
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
\isadelimtheory
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
\endisadelimtheory
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   486
\isanewline
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   487
\end{isabellebody}%
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   488
%%% Local Variables:
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   489
%%% mode: latex
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   490
%%% TeX-master: "root"
d804c8b9c2dc split off predicate compiler into separate theory
haftmann
parents:
diff changeset
   491
%%% End: