doc-src/TutorialI/document/Ifexpr.tex
author wenzelm
Fri, 27 Jul 2012 13:17:12 +0200
changeset 48546 f81cf2fcd3a0
parent 48519 5deda0549f97
permissions -rw-r--r--
tuned messages;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9722
a5f86aed785b *** empty log message ***
nipkow
parents: 9721
diff changeset
     1
%
a5f86aed785b *** empty log message ***
nipkow
parents: 9721
diff changeset
     2
\begin{isabellebody}%
9924
3370f6aa3200 updated;
wenzelm
parents: 9792
diff changeset
     3
\def\isabellecontext{Ifexpr}%
17056
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
     4
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
     5
\isadelimtheory
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
     6
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
     7
\endisadelimtheory
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
     8
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
     9
\isatagtheory
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
    10
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
    11
\endisatagtheory
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
    12
{\isafoldtheory}%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
    13
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
    14
\isadelimtheory
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
    15
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
    16
\endisadelimtheory
8749
2665170f104a Adding generated files
nipkow
parents:
diff changeset
    17
%
10878
b254d5ad6dd4 auto update
paulson
parents: 10795
diff changeset
    18
\isamarkupsubsection{Case Study: Boolean Expressions%
10395
7ef380745743 updated;
wenzelm
parents: 10187
diff changeset
    19
}
11866
fbd097aec213 updated;
wenzelm
parents: 11456
diff changeset
    20
\isamarkuptrue%
9933
9feb1e0c4cb3 *** empty log message ***
nipkow
parents: 9924
diff changeset
    21
%
8749
2665170f104a Adding generated files
nipkow
parents:
diff changeset
    22
\begin{isamarkuptext}%
11456
7eb63f63e6c6 revisions and indexing
paulson
parents: 10978
diff changeset
    23
\label{sec:boolex}\index{boolean expressions example|(}
9933
9feb1e0c4cb3 *** empty log message ***
nipkow
parents: 9924
diff changeset
    24
The aim of this case study is twofold: it shows how to model boolean
9feb1e0c4cb3 *** empty log message ***
nipkow
parents: 9924
diff changeset
    25
expressions and some algorithms for manipulating them, and it demonstrates
9feb1e0c4cb3 *** empty log message ***
nipkow
parents: 9924
diff changeset
    26
the constructs introduced above.%
9feb1e0c4cb3 *** empty log message ***
nipkow
parents: 9924
diff changeset
    27
\end{isamarkuptext}%
11866
fbd097aec213 updated;
wenzelm
parents: 11456
diff changeset
    28
\isamarkuptrue%
9933
9feb1e0c4cb3 *** empty log message ***
nipkow
parents: 9924
diff changeset
    29
%
10978
5eebea8f359f *** empty log message ***
nipkow
parents: 10971
diff changeset
    30
\isamarkupsubsubsection{Modelling Boolean Expressions%
10395
7ef380745743 updated;
wenzelm
parents: 10187
diff changeset
    31
}
11866
fbd097aec213 updated;
wenzelm
parents: 11456
diff changeset
    32
\isamarkuptrue%
9933
9feb1e0c4cb3 *** empty log message ***
nipkow
parents: 9924
diff changeset
    33
%
9feb1e0c4cb3 *** empty log message ***
nipkow
parents: 9924
diff changeset
    34
\begin{isamarkuptext}%
8749
2665170f104a Adding generated files
nipkow
parents:
diff changeset
    35
We want to represent boolean expressions built up from variables and
2665170f104a Adding generated files
nipkow
parents:
diff changeset
    36
constants by negation and conjunction. The following datatype serves exactly
2665170f104a Adding generated files
nipkow
parents:
diff changeset
    37
that purpose:%
2665170f104a Adding generated files
nipkow
parents:
diff changeset
    38
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
    39
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
    40
\isacommand{datatype}\isamarkupfalse%
40406
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
    41
\ boolex\ {\isaliteral{3D}{\isacharequal}}\ Const\ bool\ {\isaliteral{7C}{\isacharbar}}\ Var\ nat\ {\isaliteral{7C}{\isacharbar}}\ Neg\ boolex\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
    42
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\isaliteral{7C}{\isacharbar}}\ And\ boolex\ boolex%
8749
2665170f104a Adding generated files
nipkow
parents:
diff changeset
    43
\begin{isamarkuptext}%
2665170f104a Adding generated files
nipkow
parents:
diff changeset
    44
\noindent
9541
d17c0b34d5c8 *** empty log message ***
nipkow
parents: 9458
diff changeset
    45
The two constants are represented by \isa{Const\ True} and
d17c0b34d5c8 *** empty log message ***
nipkow
parents: 9458
diff changeset
    46
\isa{Const\ False}. Variables are represented by terms of the form
9792
bbefb6ce5cb2 *** empty log message ***
nipkow
parents: 9722
diff changeset
    47
\isa{Var\ n}, where \isa{n} is a natural number (type \isa{nat}).
8749
2665170f104a Adding generated files
nipkow
parents:
diff changeset
    48
For example, the formula $P@0 \land \neg P@1$ is represented by the term
40406
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
    49
\isa{And\ {\isaliteral{28}{\isacharparenleft}}Var\ {\isadigit{0}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{28}{\isacharparenleft}}Neg\ {\isaliteral{28}{\isacharparenleft}}Var\ {\isadigit{1}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{29}{\isacharparenright}}}.
8749
2665170f104a Adding generated files
nipkow
parents:
diff changeset
    50
10978
5eebea8f359f *** empty log message ***
nipkow
parents: 10971
diff changeset
    51
\subsubsection{The Value of a Boolean Expression}
8749
2665170f104a Adding generated files
nipkow
parents:
diff changeset
    52
2665170f104a Adding generated files
nipkow
parents:
diff changeset
    53
The value of a boolean expression depends on the value of its variables.
9792
bbefb6ce5cb2 *** empty log message ***
nipkow
parents: 9722
diff changeset
    54
Hence the function \isa{value} takes an additional parameter, an
40406
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
    55
\emph{environment} of type \isa{nat\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ bool}, which maps variables to their
9792
bbefb6ce5cb2 *** empty log message ***
nipkow
parents: 9722
diff changeset
    56
values:%
8749
2665170f104a Adding generated files
nipkow
parents:
diff changeset
    57
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
    58
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
    59
\isacommand{primrec}\isamarkupfalse%
40406
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
    60
\ {\isaliteral{22}{\isachardoublequoteopen}}value{\isaliteral{22}{\isachardoublequoteclose}}\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}boolex\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{28}{\isacharparenleft}}nat\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ bool{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ bool{\isaliteral{22}{\isachardoublequoteclose}}\ \isakeyword{where}\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
    61
{\isaliteral{22}{\isachardoublequoteopen}}value\ {\isaliteral{28}{\isacharparenleft}}Const\ b{\isaliteral{29}{\isacharparenright}}\ env\ {\isaliteral{3D}{\isacharequal}}\ b{\isaliteral{22}{\isachardoublequoteclose}}\ {\isaliteral{7C}{\isacharbar}}\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
    62
{\isaliteral{22}{\isachardoublequoteopen}}value\ {\isaliteral{28}{\isacharparenleft}}Var\ x{\isaliteral{29}{\isacharparenright}}\ \ \ env\ {\isaliteral{3D}{\isacharequal}}\ env\ x{\isaliteral{22}{\isachardoublequoteclose}}\ {\isaliteral{7C}{\isacharbar}}\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
    63
{\isaliteral{22}{\isachardoublequoteopen}}value\ {\isaliteral{28}{\isacharparenleft}}Neg\ b{\isaliteral{29}{\isacharparenright}}\ \ \ env\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6E6F743E}{\isasymnot}}\ value\ b\ env{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}\ {\isaliteral{7C}{\isacharbar}}\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
    64
{\isaliteral{22}{\isachardoublequoteopen}}value\ {\isaliteral{28}{\isacharparenleft}}And\ b\ c{\isaliteral{29}{\isacharparenright}}\ env\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{28}{\isacharparenleft}}value\ b\ env\ {\isaliteral{5C3C616E643E}{\isasymand}}\ value\ c\ env{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}%
8749
2665170f104a Adding generated files
nipkow
parents:
diff changeset
    65
\begin{isamarkuptext}%
2665170f104a Adding generated files
nipkow
parents:
diff changeset
    66
\noindent
10878
b254d5ad6dd4 auto update
paulson
parents: 10795
diff changeset
    67
\subsubsection{If-Expressions}
8749
2665170f104a Adding generated files
nipkow
parents:
diff changeset
    68
2665170f104a Adding generated files
nipkow
parents:
diff changeset
    69
An alternative and often more efficient (because in a certain sense
2665170f104a Adding generated files
nipkow
parents:
diff changeset
    70
canonical) representation are so-called \emph{If-expressions} built up
2665170f104a Adding generated files
nipkow
parents:
diff changeset
    71
from constants (\isa{CIF}), variables (\isa{VIF}) and conditionals
2665170f104a Adding generated files
nipkow
parents:
diff changeset
    72
(\isa{IF}):%
2665170f104a Adding generated files
nipkow
parents:
diff changeset
    73
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
    74
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
    75
\isacommand{datatype}\isamarkupfalse%
40406
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
    76
\ ifex\ {\isaliteral{3D}{\isacharequal}}\ CIF\ bool\ {\isaliteral{7C}{\isacharbar}}\ VIF\ nat\ {\isaliteral{7C}{\isacharbar}}\ IF\ ifex\ ifex\ ifex%
8749
2665170f104a Adding generated files
nipkow
parents:
diff changeset
    77
\begin{isamarkuptext}%
2665170f104a Adding generated files
nipkow
parents:
diff changeset
    78
\noindent
10971
6852682eaf16 *** empty log message ***
nipkow
parents: 10878
diff changeset
    79
The evaluation of If-expressions proceeds as for \isa{boolex}:%
8749
2665170f104a Adding generated files
nipkow
parents:
diff changeset
    80
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
    81
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
    82
\isacommand{primrec}\isamarkupfalse%
40406
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
    83
\ valif\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}ifex\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ {\isaliteral{28}{\isacharparenleft}}nat\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ bool{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ bool{\isaliteral{22}{\isachardoublequoteclose}}\ \isakeyword{where}\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
    84
{\isaliteral{22}{\isachardoublequoteopen}}valif\ {\isaliteral{28}{\isacharparenleft}}CIF\ b{\isaliteral{29}{\isacharparenright}}\ \ \ \ env\ {\isaliteral{3D}{\isacharequal}}\ b{\isaliteral{22}{\isachardoublequoteclose}}\ {\isaliteral{7C}{\isacharbar}}\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
    85
{\isaliteral{22}{\isachardoublequoteopen}}valif\ {\isaliteral{28}{\isacharparenleft}}VIF\ x{\isaliteral{29}{\isacharparenright}}\ \ \ \ env\ {\isaliteral{3D}{\isacharequal}}\ env\ x{\isaliteral{22}{\isachardoublequoteclose}}\ {\isaliteral{7C}{\isacharbar}}\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
    86
{\isaliteral{22}{\isachardoublequoteopen}}valif\ {\isaliteral{28}{\isacharparenleft}}IF\ b\ t\ e{\isaliteral{29}{\isacharparenright}}\ env\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{28}{\isacharparenleft}}if\ valif\ b\ env\ then\ valif\ t\ env\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
    87
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ else\ valif\ e\ env{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}%
8749
2665170f104a Adding generated files
nipkow
parents:
diff changeset
    88
\begin{isamarkuptext}%
10978
5eebea8f359f *** empty log message ***
nipkow
parents: 10971
diff changeset
    89
\subsubsection{Converting Boolean and If-Expressions}
8749
2665170f104a Adding generated files
nipkow
parents:
diff changeset
    90
2665170f104a Adding generated files
nipkow
parents:
diff changeset
    91
The type \isa{boolex} is close to the customary representation of logical
8771
026f37a86ea7 *** empty log message ***
nipkow
parents: 8749
diff changeset
    92
formulae, whereas \isa{ifex} is designed for efficiency. It is easy to
8749
2665170f104a Adding generated files
nipkow
parents:
diff changeset
    93
translate from \isa{boolex} into \isa{ifex}:%
2665170f104a Adding generated files
nipkow
parents:
diff changeset
    94
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
    95
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
    96
\isacommand{primrec}\isamarkupfalse%
40406
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
    97
\ bool{\isadigit{2}}if\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}boolex\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ ifex{\isaliteral{22}{\isachardoublequoteclose}}\ \isakeyword{where}\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
    98
{\isaliteral{22}{\isachardoublequoteopen}}bool{\isadigit{2}}if\ {\isaliteral{28}{\isacharparenleft}}Const\ b{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ CIF\ b{\isaliteral{22}{\isachardoublequoteclose}}\ {\isaliteral{7C}{\isacharbar}}\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
    99
{\isaliteral{22}{\isachardoublequoteopen}}bool{\isadigit{2}}if\ {\isaliteral{28}{\isacharparenleft}}Var\ x{\isaliteral{29}{\isacharparenright}}\ \ \ {\isaliteral{3D}{\isacharequal}}\ VIF\ x{\isaliteral{22}{\isachardoublequoteclose}}\ {\isaliteral{7C}{\isacharbar}}\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
   100
{\isaliteral{22}{\isachardoublequoteopen}}bool{\isadigit{2}}if\ {\isaliteral{28}{\isacharparenleft}}Neg\ b{\isaliteral{29}{\isacharparenright}}\ \ \ {\isaliteral{3D}{\isacharequal}}\ IF\ {\isaliteral{28}{\isacharparenleft}}bool{\isadigit{2}}if\ b{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{28}{\isacharparenleft}}CIF\ False{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{28}{\isacharparenleft}}CIF\ True{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}\ {\isaliteral{7C}{\isacharbar}}\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
   101
{\isaliteral{22}{\isachardoublequoteopen}}bool{\isadigit{2}}if\ {\isaliteral{28}{\isacharparenleft}}And\ b\ c{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ IF\ {\isaliteral{28}{\isacharparenleft}}bool{\isadigit{2}}if\ b{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{28}{\isacharparenleft}}bool{\isadigit{2}}if\ c{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{28}{\isacharparenleft}}CIF\ False{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}%
8749
2665170f104a Adding generated files
nipkow
parents:
diff changeset
   102
\begin{isamarkuptext}%
2665170f104a Adding generated files
nipkow
parents:
diff changeset
   103
\noindent
10187
0376cccd9118 *** empty log message ***
nipkow
parents: 10171
diff changeset
   104
At last, we have something we can verify: that \isa{bool{\isadigit{2}}if} preserves the
8749
2665170f104a Adding generated files
nipkow
parents:
diff changeset
   105
value of its argument:%
2665170f104a Adding generated files
nipkow
parents:
diff changeset
   106
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   107
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   108
\isacommand{lemma}\isamarkupfalse%
40406
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
   109
\ {\isaliteral{22}{\isachardoublequoteopen}}valif\ {\isaliteral{28}{\isacharparenleft}}bool{\isadigit{2}}if\ b{\isaliteral{29}{\isacharparenright}}\ env\ {\isaliteral{3D}{\isacharequal}}\ value\ b\ env{\isaliteral{22}{\isachardoublequoteclose}}%
17056
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   110
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   111
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   112
\endisadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   113
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   114
\isatagproof
16069
3f2a9f400168 *** empty log message ***
nipkow
parents: 15614
diff changeset
   115
%
3f2a9f400168 *** empty log message ***
nipkow
parents: 15614
diff changeset
   116
\begin{isamarkuptxt}%
3f2a9f400168 *** empty log message ***
nipkow
parents: 15614
diff changeset
   117
\noindent
3f2a9f400168 *** empty log message ***
nipkow
parents: 15614
diff changeset
   118
The proof is canonical:%
3f2a9f400168 *** empty log message ***
nipkow
parents: 15614
diff changeset
   119
\end{isamarkuptxt}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   120
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   121
\isacommand{apply}\isamarkupfalse%
40406
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
   122
{\isaliteral{28}{\isacharparenleft}}induct{\isaliteral{5F}{\isacharunderscore}}tac\ b{\isaliteral{29}{\isacharparenright}}\isanewline
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   123
\isacommand{apply}\isamarkupfalse%
40406
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
   124
{\isaliteral{28}{\isacharparenleft}}auto{\isaliteral{29}{\isacharparenright}}\isanewline
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   125
\isacommand{done}\isamarkupfalse%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   126
%
17056
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   127
\endisatagproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   128
{\isafoldproof}%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   129
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   130
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   131
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   132
\endisadelimproof
11866
fbd097aec213 updated;
wenzelm
parents: 11456
diff changeset
   133
%
8749
2665170f104a Adding generated files
nipkow
parents:
diff changeset
   134
\begin{isamarkuptext}%
2665170f104a Adding generated files
nipkow
parents:
diff changeset
   135
\noindent
2665170f104a Adding generated files
nipkow
parents:
diff changeset
   136
In fact, all proofs in this case study look exactly like this. Hence we do
2665170f104a Adding generated files
nipkow
parents:
diff changeset
   137
not show them below.
2665170f104a Adding generated files
nipkow
parents:
diff changeset
   138
2665170f104a Adding generated files
nipkow
parents:
diff changeset
   139
More interesting is the transformation of If-expressions into a normal form
2665170f104a Adding generated files
nipkow
parents:
diff changeset
   140
where the first argument of \isa{IF} cannot be another \isa{IF} but
2665170f104a Adding generated files
nipkow
parents:
diff changeset
   141
must be a constant or variable. Such a normal form can be computed by
40406
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
   142
repeatedly replacing a subterm of the form \isa{IF\ {\isaliteral{28}{\isacharparenleft}}IF\ b\ x\ y{\isaliteral{29}{\isacharparenright}}\ z\ u} by
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
   143
\isa{IF\ b\ {\isaliteral{28}{\isacharparenleft}}IF\ x\ z\ u{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{28}{\isacharparenleft}}IF\ y\ z\ u{\isaliteral{29}{\isacharparenright}}}, which has the same value. The following
8749
2665170f104a Adding generated files
nipkow
parents:
diff changeset
   144
primitive recursive functions perform this task:%
2665170f104a Adding generated files
nipkow
parents:
diff changeset
   145
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   146
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   147
\isacommand{primrec}\isamarkupfalse%
40406
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
   148
\ normif\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}ifex\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ ifex\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ ifex\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ ifex{\isaliteral{22}{\isachardoublequoteclose}}\ \isakeyword{where}\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
   149
{\isaliteral{22}{\isachardoublequoteopen}}normif\ {\isaliteral{28}{\isacharparenleft}}CIF\ b{\isaliteral{29}{\isacharparenright}}\ \ \ \ t\ e\ {\isaliteral{3D}{\isacharequal}}\ IF\ {\isaliteral{28}{\isacharparenleft}}CIF\ b{\isaliteral{29}{\isacharparenright}}\ t\ e{\isaliteral{22}{\isachardoublequoteclose}}\ {\isaliteral{7C}{\isacharbar}}\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
   150
{\isaliteral{22}{\isachardoublequoteopen}}normif\ {\isaliteral{28}{\isacharparenleft}}VIF\ x{\isaliteral{29}{\isacharparenright}}\ \ \ \ t\ e\ {\isaliteral{3D}{\isacharequal}}\ IF\ {\isaliteral{28}{\isacharparenleft}}VIF\ x{\isaliteral{29}{\isacharparenright}}\ t\ e{\isaliteral{22}{\isachardoublequoteclose}}\ {\isaliteral{7C}{\isacharbar}}\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
   151
{\isaliteral{22}{\isachardoublequoteopen}}normif\ {\isaliteral{28}{\isacharparenleft}}IF\ b\ t\ e{\isaliteral{29}{\isacharparenright}}\ u\ f\ {\isaliteral{3D}{\isacharequal}}\ normif\ b\ {\isaliteral{28}{\isacharparenleft}}normif\ t\ u\ f{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{28}{\isacharparenleft}}normif\ e\ u\ f{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   152
\isanewline
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   153
\isacommand{primrec}\isamarkupfalse%
40406
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
   154
\ norm\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}ifex\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ ifex{\isaliteral{22}{\isachardoublequoteclose}}\ \isakeyword{where}\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
   155
{\isaliteral{22}{\isachardoublequoteopen}}norm\ {\isaliteral{28}{\isacharparenleft}}CIF\ b{\isaliteral{29}{\isacharparenright}}\ \ \ \ {\isaliteral{3D}{\isacharequal}}\ CIF\ b{\isaliteral{22}{\isachardoublequoteclose}}\ {\isaliteral{7C}{\isacharbar}}\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
   156
{\isaliteral{22}{\isachardoublequoteopen}}norm\ {\isaliteral{28}{\isacharparenleft}}VIF\ x{\isaliteral{29}{\isacharparenright}}\ \ \ \ {\isaliteral{3D}{\isacharequal}}\ VIF\ x{\isaliteral{22}{\isachardoublequoteclose}}\ {\isaliteral{7C}{\isacharbar}}\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
   157
{\isaliteral{22}{\isachardoublequoteopen}}norm\ {\isaliteral{28}{\isacharparenleft}}IF\ b\ t\ e{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ normif\ b\ {\isaliteral{28}{\isacharparenleft}}norm\ t{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{28}{\isacharparenleft}}norm\ e{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}%
8749
2665170f104a Adding generated files
nipkow
parents:
diff changeset
   158
\begin{isamarkuptext}%
2665170f104a Adding generated files
nipkow
parents:
diff changeset
   159
\noindent
11456
7eb63f63e6c6 revisions and indexing
paulson
parents: 10978
diff changeset
   160
Their interplay is tricky; we leave it to you to develop an
8749
2665170f104a Adding generated files
nipkow
parents:
diff changeset
   161
intuitive understanding. Fortunately, Isabelle can help us to verify that the
2665170f104a Adding generated files
nipkow
parents:
diff changeset
   162
transformation preserves the value of the expression:%
2665170f104a Adding generated files
nipkow
parents:
diff changeset
   163
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   164
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   165
\isacommand{theorem}\isamarkupfalse%
40406
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
   166
\ {\isaliteral{22}{\isachardoublequoteopen}}valif\ {\isaliteral{28}{\isacharparenleft}}norm\ b{\isaliteral{29}{\isacharparenright}}\ env\ {\isaliteral{3D}{\isacharequal}}\ valif\ b\ env{\isaliteral{22}{\isachardoublequoteclose}}%
17056
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   167
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   168
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   169
\endisadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   170
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   171
\isatagproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   172
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   173
\endisatagproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   174
{\isafoldproof}%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   175
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   176
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   177
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   178
\endisadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   179
%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   180
\begin{isamarkuptext}%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   181
\noindent
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   182
The proof is canonical, provided we first show the following simplification
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   183
lemma, which also helps to understand what \isa{normif} does:%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   184
\end{isamarkuptext}%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   185
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   186
\isacommand{lemma}\isamarkupfalse%
40406
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
   187
\ {\isaliteral{5B}{\isacharbrackleft}}simp{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{3A}{\isacharcolon}}\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
   188
\ \ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}t\ e{\isaliteral{2E}{\isachardot}}\ valif\ {\isaliteral{28}{\isacharparenleft}}normif\ b\ t\ e{\isaliteral{29}{\isacharparenright}}\ env\ {\isaliteral{3D}{\isacharequal}}\ valif\ {\isaliteral{28}{\isacharparenleft}}IF\ b\ t\ e{\isaliteral{29}{\isacharparenright}}\ env{\isaliteral{22}{\isachardoublequoteclose}}%
17056
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   189
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   190
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   191
\endisadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   192
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   193
\isatagproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   194
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   195
\endisatagproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   196
{\isafoldproof}%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   197
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   198
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   199
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   200
\endisadelimproof
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   201
%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   202
\isadelimproof
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   203
%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   204
\endisadelimproof
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   205
%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   206
\isatagproof
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   207
%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   208
\endisatagproof
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   209
{\isafoldproof}%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   210
%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   211
\isadelimproof
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   212
%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   213
\endisadelimproof
11866
fbd097aec213 updated;
wenzelm
parents: 11456
diff changeset
   214
%
8749
2665170f104a Adding generated files
nipkow
parents:
diff changeset
   215
\begin{isamarkuptext}%
2665170f104a Adding generated files
nipkow
parents:
diff changeset
   216
\noindent
2665170f104a Adding generated files
nipkow
parents:
diff changeset
   217
Note that the lemma does not have a name, but is implicitly used in the proof
40406
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
   218
of the theorem shown above because of the \isa{{\isaliteral{5B}{\isacharbrackleft}}simp{\isaliteral{5D}{\isacharbrackright}}} attribute.
8749
2665170f104a Adding generated files
nipkow
parents:
diff changeset
   219
2665170f104a Adding generated files
nipkow
parents:
diff changeset
   220
But how can we be sure that \isa{norm} really produces a normal form in
11456
7eb63f63e6c6 revisions and indexing
paulson
parents: 10978
diff changeset
   221
the above sense? We define a function that tests If-expressions for normality:%
8749
2665170f104a Adding generated files
nipkow
parents:
diff changeset
   222
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   223
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   224
\isacommand{primrec}\isamarkupfalse%
40406
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
   225
\ normal\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}ifex\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ bool{\isaliteral{22}{\isachardoublequoteclose}}\ \isakeyword{where}\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
   226
{\isaliteral{22}{\isachardoublequoteopen}}normal{\isaliteral{28}{\isacharparenleft}}CIF\ b{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ True{\isaliteral{22}{\isachardoublequoteclose}}\ {\isaliteral{7C}{\isacharbar}}\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
   227
{\isaliteral{22}{\isachardoublequoteopen}}normal{\isaliteral{28}{\isacharparenleft}}VIF\ x{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ True{\isaliteral{22}{\isachardoublequoteclose}}\ {\isaliteral{7C}{\isacharbar}}\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
   228
{\isaliteral{22}{\isachardoublequoteopen}}normal{\isaliteral{28}{\isacharparenleft}}IF\ b\ t\ e{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{28}{\isacharparenleft}}normal\ t\ {\isaliteral{5C3C616E643E}{\isasymand}}\ normal\ e\ {\isaliteral{5C3C616E643E}{\isasymand}}\isanewline
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
   229
\ \ \ \ \ {\isaliteral{28}{\isacharparenleft}}case\ b\ of\ CIF\ b\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ True\ {\isaliteral{7C}{\isacharbar}}\ VIF\ x\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ True\ {\isaliteral{7C}{\isacharbar}}\ IF\ x\ y\ z\ {\isaliteral{5C3C52696768746172726F773E}{\isasymRightarrow}}\ False{\isaliteral{29}{\isacharparenright}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}%
8749
2665170f104a Adding generated files
nipkow
parents:
diff changeset
   230
\begin{isamarkuptext}%
2665170f104a Adding generated files
nipkow
parents:
diff changeset
   231
\noindent
40406
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
   232
Now we prove \isa{normal\ {\isaliteral{28}{\isacharparenleft}}norm\ b{\isaliteral{29}{\isacharparenright}}}. Of course, this requires a lemma about
8749
2665170f104a Adding generated files
nipkow
parents:
diff changeset
   233
normality of \isa{normif}:%
2665170f104a Adding generated files
nipkow
parents:
diff changeset
   234
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   235
\isamarkuptrue%
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   236
\isacommand{lemma}\isamarkupfalse%
40406
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
   237
\ {\isaliteral{5B}{\isacharbrackleft}}simp{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}t\ e{\isaliteral{2E}{\isachardot}}\ normal{\isaliteral{28}{\isacharparenleft}}normif\ b\ t\ e{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{28}{\isacharparenleft}}normal\ t\ {\isaliteral{5C3C616E643E}{\isasymand}}\ normal\ e{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}%
17056
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   238
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   239
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   240
\endisadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   241
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   242
\isatagproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   243
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   244
\endisatagproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   245
{\isafoldproof}%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   246
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   247
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   248
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   249
\endisadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   250
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   251
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   252
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   253
\endisadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   254
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   255
\isatagproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   256
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   257
\endisatagproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   258
{\isafoldproof}%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   259
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   260
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   261
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   262
\endisadelimproof
11866
fbd097aec213 updated;
wenzelm
parents: 11456
diff changeset
   263
%
9933
9feb1e0c4cb3 *** empty log message ***
nipkow
parents: 9924
diff changeset
   264
\begin{isamarkuptext}%
9feb1e0c4cb3 *** empty log message ***
nipkow
parents: 9924
diff changeset
   265
\medskip
10795
9e888d60d3e5 minor edits to Chapters 1-3
paulson
parents: 10395
diff changeset
   266
How do we come up with the required lemmas? Try to prove the main theorems
9e888d60d3e5 minor edits to Chapters 1-3
paulson
parents: 10395
diff changeset
   267
without them and study carefully what \isa{auto} leaves unproved. This 
9e888d60d3e5 minor edits to Chapters 1-3
paulson
parents: 10395
diff changeset
   268
can provide the clue.  The necessity of universal quantification
40406
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
   269
(\isa{{\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}t\ e}) in the two lemmas is explained in
9933
9feb1e0c4cb3 *** empty log message ***
nipkow
parents: 9924
diff changeset
   270
\S\ref{sec:InductionHeuristics}
9feb1e0c4cb3 *** empty log message ***
nipkow
parents: 9924
diff changeset
   271
9feb1e0c4cb3 *** empty log message ***
nipkow
parents: 9924
diff changeset
   272
\begin{exercise}
9feb1e0c4cb3 *** empty log message ***
nipkow
parents: 9924
diff changeset
   273
  We strengthen the definition of a \isa{normal} If-expression as follows:
9feb1e0c4cb3 *** empty log message ***
nipkow
parents: 9924
diff changeset
   274
  the first argument of all \isa{IF}s must be a variable. Adapt the above
9feb1e0c4cb3 *** empty log message ***
nipkow
parents: 9924
diff changeset
   275
  development to this changed requirement. (Hint: you may need to formulate
40406
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
   276
  some of the goals as implications (\isa{{\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}}) rather than
313a24b66a8d updated generated files;
wenzelm
parents: 27015
diff changeset
   277
  equalities (\isa{{\isaliteral{3D}{\isacharequal}}}).)
11456
7eb63f63e6c6 revisions and indexing
paulson
parents: 10978
diff changeset
   278
\end{exercise}
7eb63f63e6c6 revisions and indexing
paulson
parents: 10978
diff changeset
   279
\index{boolean expressions example|)}%
9933
9feb1e0c4cb3 *** empty log message ***
nipkow
parents: 9924
diff changeset
   280
\end{isamarkuptext}%
17175
1eced27ee0e1 updated;
wenzelm
parents: 17056
diff changeset
   281
\isamarkuptrue%
17056
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   282
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   283
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   284
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   285
\endisadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   286
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   287
\isatagproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   288
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   289
\endisatagproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   290
{\isafoldproof}%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   291
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   292
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   293
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   294
\endisadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   295
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   296
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   297
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   298
\endisadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   299
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   300
\isatagproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   301
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   302
\endisatagproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   303
{\isafoldproof}%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   304
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   305
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   306
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   307
\endisadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   308
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   309
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   310
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   311
\endisadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   312
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   313
\isatagproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   314
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   315
\endisatagproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   316
{\isafoldproof}%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   317
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   318
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   319
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   320
\endisadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   321
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   322
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   323
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   324
\endisadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   325
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   326
\isatagproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   327
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   328
\endisatagproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   329
{\isafoldproof}%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   330
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   331
\isadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   332
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   333
\endisadelimproof
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   334
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   335
\isadelimtheory
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   336
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   337
\endisadelimtheory
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   338
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   339
\isatagtheory
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   340
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   341
\endisatagtheory
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   342
{\isafoldtheory}%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   343
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   344
\isadelimtheory
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   345
%
05fc32a23b8b updated;
wenzelm
parents: 16069
diff changeset
   346
\endisadelimtheory
9933
9feb1e0c4cb3 *** empty log message ***
nipkow
parents: 9924
diff changeset
   347
\end{isabellebody}%
9145
9f7b8de5bfaf updated;
wenzelm
parents: 8771
diff changeset
   348
%%% Local Variables:
9f7b8de5bfaf updated;
wenzelm
parents: 8771
diff changeset
   349
%%% mode: latex
9f7b8de5bfaf updated;
wenzelm
parents: 8771
diff changeset
   350
%%% TeX-master: "root"
9f7b8de5bfaf updated;
wenzelm
parents: 8771
diff changeset
   351
%%% End: