doc-src/TutorialI/CTL/document/CTL.tex
author nipkow
Thu, 29 Nov 2001 14:12:42 +0100
changeset 12328 7c4ec77a8715
parent 11866 fbd097aec213
child 12332 aea72a834c85
permissions -rw-r--r--
*** empty log message ***
nipkow@10123
     1
%
nipkow@10123
     2
\begin{isabellebody}%
nipkow@10123
     3
\def\isabellecontext{CTL}%
wenzelm@11866
     4
\isamarkupfalse%
nipkow@10133
     5
%
nipkow@10971
     6
\isamarkupsubsection{Computation Tree Logic --- CTL%
wenzelm@10395
     7
}
wenzelm@11866
     8
\isamarkuptrue%
nipkow@10149
     9
%
nipkow@10149
    10
\begin{isamarkuptext}%
nipkow@10217
    11
\label{sec:CTL}
paulson@11494
    12
\index{CTL|(}%
paulson@10867
    13
The semantics of PDL only needs reflexive transitive closure.
paulson@10867
    14
Let us be adventurous and introduce a more expressive temporal operator.
paulson@10867
    15
We extend the datatype
nipkow@10149
    16
\isa{formula} by a new constructor%
nipkow@10149
    17
\end{isamarkuptext}%
wenzelm@11866
    18
\isamarkuptrue%
wenzelm@11866
    19
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\isacharbar}\ AF\ formula\isamarkupfalse%
wenzelm@11866
    20
%
nipkow@10149
    21
\begin{isamarkuptext}%
nipkow@10149
    22
\noindent
nipkow@10983
    23
which stands for ``\emph{A}lways in the \emph{F}uture'':
nipkow@10983
    24
on all infinite paths, at some point the formula holds.
nipkow@10983
    25
Formalizing the notion of an infinite path is easy
nipkow@10159
    26
in HOL: it is simply a function from \isa{nat} to \isa{state}.%
nipkow@10149
    27
\end{isamarkuptext}%
wenzelm@11866
    28
\isamarkuptrue%
nipkow@10123
    29
\isacommand{constdefs}\ Paths\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}state\ {\isasymRightarrow}\ {\isacharparenleft}nat\ {\isasymRightarrow}\ state{\isacharparenright}set{\isachardoublequote}\isanewline
wenzelm@11866
    30
\ \ \ \ \ \ \ \ \ {\isachardoublequote}Paths\ s\ {\isasymequiv}\ {\isacharbraceleft}p{\isachardot}\ s\ {\isacharequal}\ p\ {\isadigit{0}}\ {\isasymand}\ {\isacharparenleft}{\isasymforall}i{\isachardot}\ {\isacharparenleft}p\ i{\isacharcomma}\ p{\isacharparenleft}i{\isacharplus}{\isadigit{1}}{\isacharparenright}{\isacharparenright}\ {\isasymin}\ M{\isacharparenright}{\isacharbraceright}{\isachardoublequote}\isamarkupfalse%
wenzelm@11866
    31
%
nipkow@10149
    32
\begin{isamarkuptext}%
nipkow@10149
    33
\noindent
paulson@11494
    34
This definition allows a succinct statement of the semantics of \isa{AF}:
paulson@10867
    35
\footnote{Do not be misled: neither datatypes nor recursive functions can be
nipkow@10149
    36
extended by new constructors or equations. This is just a trick of the
nipkow@10149
    37
presentation. In reality one has to define a new datatype and a new function.}%
nipkow@10149
    38
\end{isamarkuptext}%
wenzelm@11866
    39
\isamarkuptrue%
wenzelm@11866
    40
\isamarkupfalse%
wenzelm@11866
    41
{\isachardoublequote}s\ {\isasymTurnstile}\ AF\ f\ \ \ \ {\isacharequal}\ {\isacharparenleft}{\isasymforall}p\ {\isasymin}\ Paths\ s{\isachardot}\ {\isasymexists}i{\isachardot}\ p\ i\ {\isasymTurnstile}\ f{\isacharparenright}{\isachardoublequote}\isamarkupfalse%
wenzelm@11866
    42
%
nipkow@10149
    43
\begin{isamarkuptext}%
nipkow@10149
    44
\noindent
nipkow@10149
    45
Model checking \isa{AF} involves a function which
nipkow@10159
    46
is just complicated enough to warrant a separate definition:%
nipkow@10149
    47
\end{isamarkuptext}%
wenzelm@11866
    48
\isamarkuptrue%
nipkow@10123
    49
\isacommand{constdefs}\ af\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}state\ set\ {\isasymRightarrow}\ state\ set\ {\isasymRightarrow}\ state\ set{\isachardoublequote}\isanewline
wenzelm@11866
    50
\ \ \ \ \ \ \ \ \ {\isachardoublequote}af\ A\ T\ {\isasymequiv}\ A\ {\isasymunion}\ {\isacharbraceleft}s{\isachardot}\ {\isasymforall}t{\isachardot}\ {\isacharparenleft}s{\isacharcomma}\ t{\isacharparenright}\ {\isasymin}\ M\ {\isasymlongrightarrow}\ t\ {\isasymin}\ T{\isacharbraceright}{\isachardoublequote}\isamarkupfalse%
wenzelm@11866
    51
%
nipkow@10149
    52
\begin{isamarkuptext}%
nipkow@10149
    53
\noindent
paulson@10867
    54
Now we define \isa{mc\ {\isacharparenleft}AF\ f{\isacharparenright}} as the least set \isa{T} that includes
nipkow@10159
    55
\isa{mc\ f} and all states all of whose direct successors are in \isa{T}:%
nipkow@10159
    56
\end{isamarkuptext}%
wenzelm@11866
    57
\isamarkuptrue%
wenzelm@11866
    58
\isamarkupfalse%
wenzelm@11866
    59
{\isachardoublequote}mc{\isacharparenleft}AF\ f{\isacharparenright}\ \ \ \ {\isacharequal}\ lfp{\isacharparenleft}af{\isacharparenleft}mc\ f{\isacharparenright}{\isacharparenright}{\isachardoublequote}\isamarkupfalse%
wenzelm@11866
    60
%
nipkow@10159
    61
\begin{isamarkuptext}%
nipkow@10159
    62
\noindent
nipkow@10159
    63
Because \isa{af} is monotone in its second argument (and also its first, but
nipkow@10983
    64
that is irrelevant), \isa{af\ A} has a least fixed point:%
nipkow@10149
    65
\end{isamarkuptext}%
wenzelm@11866
    66
\isamarkuptrue%
nipkow@10123
    67
\isacommand{lemma}\ mono{\isacharunderscore}af{\isacharcolon}\ {\isachardoublequote}mono{\isacharparenleft}af\ A{\isacharparenright}{\isachardoublequote}\isanewline
wenzelm@11866
    68
\isamarkupfalse%
nipkow@10149
    69
\isacommand{apply}{\isacharparenleft}simp\ add{\isacharcolon}\ mono{\isacharunderscore}def\ af{\isacharunderscore}def{\isacharparenright}\isanewline
wenzelm@11866
    70
\isamarkupfalse%
nipkow@10159
    71
\isacommand{apply}\ blast\isanewline
wenzelm@11866
    72
\isamarkupfalse%
wenzelm@11866
    73
\isacommand{done}\isamarkupfalse%
wenzelm@11866
    74
\isamarkupfalse%
wenzelm@11866
    75
\isamarkupfalse%
wenzelm@11866
    76
\isamarkupfalse%
wenzelm@11866
    77
\isamarkupfalse%
wenzelm@11866
    78
\isamarkupfalse%
wenzelm@11866
    79
\isamarkupfalse%
wenzelm@11866
    80
\isamarkupfalse%
wenzelm@11866
    81
\isamarkupfalse%
wenzelm@11866
    82
\isamarkupfalse%
wenzelm@11866
    83
\isamarkupfalse%
wenzelm@11866
    84
\isamarkupfalse%
wenzelm@11866
    85
\isamarkupfalse%
wenzelm@11866
    86
\isamarkupfalse%
wenzelm@11866
    87
\isamarkupfalse%
wenzelm@11866
    88
\isamarkupfalse%
wenzelm@11866
    89
\isamarkupfalse%
wenzelm@11866
    90
\isamarkupfalse%
wenzelm@11866
    91
\isamarkupfalse%
wenzelm@11866
    92
%
nipkow@10149
    93
\begin{isamarkuptext}%
paulson@10867
    94
All we need to prove now is  \isa{mc\ {\isacharparenleft}AF\ f{\isacharparenright}\ {\isacharequal}\ {\isacharbraceleft}s{\isachardot}\ s\ {\isasymTurnstile}\ AF\ f{\isacharbraceright}}, which states
paulson@10867
    95
that \isa{mc} and \isa{{\isasymTurnstile}} agree for \isa{AF}\@.
paulson@10867
    96
This time we prove the two inclusions separately, starting
nipkow@10159
    97
with the easy one:%
nipkow@10159
    98
\end{isamarkuptext}%
wenzelm@11866
    99
\isamarkuptrue%
nipkow@10187
   100
\isacommand{theorem}\ AF{\isacharunderscore}lemma{\isadigit{1}}{\isacharcolon}\isanewline
nipkow@12328
   101
\ \ {\isachardoublequote}lfp{\isacharparenleft}af\ A{\isacharparenright}\ {\isasymsubseteq}\ {\isacharbraceleft}s{\isachardot}\ {\isasymforall}p\ {\isasymin}\ Paths\ s{\isachardot}\ {\isasymexists}i{\isachardot}\ p\ i\ {\isasymin}\ A{\isacharbraceright}{\isachardoublequote}\isamarkupfalse%
wenzelm@11866
   102
%
nipkow@10159
   103
\begin{isamarkuptxt}%
nipkow@10149
   104
\noindent
paulson@11494
   105
In contrast to the analogous proof for \isa{EF}, and just
paulson@11494
   106
for a change, we do not use fixed point induction.  Park-induction,
paulson@11494
   107
named after David Park, is weaker but sufficient for this proof:
nipkow@10995
   108
\begin{center}
nipkow@10995
   109
\isa{f\ S\ {\isasymsubseteq}\ S\ {\isasymLongrightarrow}\ lfp\ f\ {\isasymsubseteq}\ S} \hfill (\isa{lfp{\isacharunderscore}lowerbound})
nipkow@10995
   110
\end{center}
nipkow@10225
   111
The instance of the premise \isa{f\ S\ {\isasymsubseteq}\ S} is proved pointwise,
nipkow@10281
   112
a decision that clarification takes for us:%
nipkow@10159
   113
\end{isamarkuptxt}%
wenzelm@11866
   114
\isamarkuptrue%
nipkow@10225
   115
\isacommand{apply}{\isacharparenleft}rule\ lfp{\isacharunderscore}lowerbound{\isacharparenright}\isanewline
wenzelm@11866
   116
\isamarkupfalse%
wenzelm@11866
   117
\isacommand{apply}{\isacharparenleft}clarsimp\ simp\ add{\isacharcolon}\ af{\isacharunderscore}def\ Paths{\isacharunderscore}def{\isacharparenright}\isamarkupfalse%
wenzelm@11866
   118
%
nipkow@10159
   119
\begin{isamarkuptxt}%
nipkow@10363
   120
\begin{isabelle}%
nipkow@10696
   121
\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}p{\isachardot}\ {\isasymlbrakk}p\ {\isadigit{0}}\ {\isasymin}\ A\ {\isasymor}\isanewline
wenzelm@10950
   122
\isaindent{\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}p{\isachardot}\ {\isasymlbrakk}}{\isacharparenleft}{\isasymforall}t{\isachardot}\ {\isacharparenleft}p\ {\isadigit{0}}{\isacharcomma}\ t{\isacharparenright}\ {\isasymin}\ M\ {\isasymlongrightarrow}\isanewline
wenzelm@10950
   123
\isaindent{\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}p{\isachardot}\ {\isasymlbrakk}{\isacharparenleft}{\isasymforall}t{\isachardot}\ }{\isacharparenleft}{\isasymforall}p{\isachardot}\ t\ {\isacharequal}\ p\ {\isadigit{0}}\ {\isasymand}\ {\isacharparenleft}{\isasymforall}i{\isachardot}\ {\isacharparenleft}p\ i{\isacharcomma}\ p\ {\isacharparenleft}Suc\ i{\isacharparenright}{\isacharparenright}\ {\isasymin}\ M{\isacharparenright}\ {\isasymlongrightarrow}\isanewline
wenzelm@10950
   124
\isaindent{\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}p{\isachardot}\ {\isasymlbrakk}{\isacharparenleft}{\isasymforall}t{\isachardot}\ {\isacharparenleft}{\isasymforall}p{\isachardot}\ }{\isacharparenleft}{\isasymexists}i{\isachardot}\ p\ i\ {\isasymin}\ A{\isacharparenright}{\isacharparenright}{\isacharparenright}{\isacharsemicolon}\isanewline
wenzelm@10950
   125
\isaindent{\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}p{\isachardot}\ \ \ \ }{\isasymforall}i{\isachardot}\ {\isacharparenleft}p\ i{\isacharcomma}\ p\ {\isacharparenleft}Suc\ i{\isacharparenright}{\isacharparenright}\ {\isasymin}\ M{\isasymrbrakk}\isanewline
wenzelm@10950
   126
\isaindent{\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}p{\isachardot}\ }{\isasymLongrightarrow}\ {\isasymexists}i{\isachardot}\ p\ i\ {\isasymin}\ A%
nipkow@10159
   127
\end{isabelle}
wenzelm@11706
   128
Now we eliminate the disjunction. The case \isa{p\ {\isacharparenleft}{\isadigit{0}}{\isasymColon}{\isacharprime}a{\isacharparenright}\ {\isasymin}\ A} is trivial:%
nipkow@10159
   129
\end{isamarkuptxt}%
wenzelm@11866
   130
\isamarkuptrue%
nipkow@10123
   131
\isacommand{apply}{\isacharparenleft}erule\ disjE{\isacharparenright}\isanewline
wenzelm@11866
   132
\ \isamarkupfalse%
wenzelm@11866
   133
\isacommand{apply}{\isacharparenleft}blast{\isacharparenright}\isamarkupfalse%
wenzelm@11866
   134
%
nipkow@10159
   135
\begin{isamarkuptxt}%
nipkow@10159
   136
\noindent
wenzelm@11706
   137
In the other case we set \isa{t} to \isa{p\ {\isacharparenleft}{\isadigit{1}}{\isasymColon}{\isacharprime}b{\isacharparenright}} and simplify matters:%
nipkow@10159
   138
\end{isamarkuptxt}%
wenzelm@11866
   139
\isamarkuptrue%
nipkow@10187
   140
\isacommand{apply}{\isacharparenleft}erule{\isacharunderscore}tac\ x\ {\isacharequal}\ {\isachardoublequote}p\ {\isadigit{1}}{\isachardoublequote}\ \isakeyword{in}\ allE{\isacharparenright}\isanewline
wenzelm@11866
   141
\isamarkupfalse%
wenzelm@11866
   142
\isacommand{apply}{\isacharparenleft}clarsimp{\isacharparenright}\isamarkupfalse%
wenzelm@11866
   143
%
nipkow@10159
   144
\begin{isamarkuptxt}%
nipkow@10363
   145
\begin{isabelle}%
nipkow@10696
   146
\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}p{\isachardot}\ {\isasymlbrakk}{\isasymforall}i{\isachardot}\ {\isacharparenleft}p\ i{\isacharcomma}\ p\ {\isacharparenleft}Suc\ i{\isacharparenright}{\isacharparenright}\ {\isasymin}\ M{\isacharsemicolon}\isanewline
wenzelm@11706
   147
\isaindent{\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}p{\isachardot}\ \ \ \ }{\isasymforall}pa{\isachardot}\ p\ {\isacharparenleft}Suc\ {\isadigit{0}}{\isacharparenright}\ {\isacharequal}\ pa\ {\isadigit{0}}\ {\isasymand}\ {\isacharparenleft}{\isasymforall}i{\isachardot}\ {\isacharparenleft}pa\ i{\isacharcomma}\ pa\ {\isacharparenleft}Suc\ i{\isacharparenright}{\isacharparenright}\ {\isasymin}\ M{\isacharparenright}\ {\isasymlongrightarrow}\isanewline
wenzelm@10950
   148
\isaindent{\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}p{\isachardot}\ \ \ \ {\isasymforall}pa{\isachardot}\ }{\isacharparenleft}{\isasymexists}i{\isachardot}\ pa\ i\ {\isasymin}\ A{\isacharparenright}{\isasymrbrakk}\isanewline
wenzelm@10950
   149
\isaindent{\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}p{\isachardot}\ }{\isasymLongrightarrow}\ {\isasymexists}i{\isachardot}\ p\ i\ {\isasymin}\ A%
nipkow@10159
   150
\end{isabelle}
wenzelm@11706
   151
It merely remains to set \isa{pa} to \isa{{\isasymlambda}i{\isachardot}\ p\ {\isacharparenleft}i\ {\isacharplus}\ {\isacharparenleft}{\isadigit{1}}{\isasymColon}{\isacharprime}a{\isacharparenright}{\isacharparenright}}, that is, 
paulson@11494
   152
\isa{p} without its first element.  The rest is automatic:%
nipkow@10159
   153
\end{isamarkuptxt}%
wenzelm@11866
   154
\isamarkuptrue%
nipkow@10187
   155
\isacommand{apply}{\isacharparenleft}erule{\isacharunderscore}tac\ x\ {\isacharequal}\ {\isachardoublequote}{\isasymlambda}i{\isachardot}\ p{\isacharparenleft}i{\isacharplus}{\isadigit{1}}{\isacharparenright}{\isachardoublequote}\ \isakeyword{in}\ allE{\isacharparenright}\isanewline
wenzelm@11866
   156
\isamarkupfalse%
paulson@11494
   157
\isacommand{apply}\ force\isanewline
wenzelm@11866
   158
\isamarkupfalse%
wenzelm@11866
   159
\isacommand{done}\isamarkupfalse%
wenzelm@11866
   160
%
nipkow@10123
   161
\begin{isamarkuptext}%
paulson@10867
   162
The opposite inclusion is proved by contradiction: if some state
nipkow@10159
   163
\isa{s} is not in \isa{lfp\ {\isacharparenleft}af\ A{\isacharparenright}}, then we can construct an
paulson@11494
   164
infinite \isa{A}-avoiding path starting from~\isa{s}. The reason is
nipkow@10123
   165
that by unfolding \isa{lfp} we find that if \isa{s} is not in
nipkow@10123
   166
\isa{lfp\ {\isacharparenleft}af\ A{\isacharparenright}}, then \isa{s} is not in \isa{A} and there is a
nipkow@10983
   167
direct successor of \isa{s} that is again not in \mbox{\isa{lfp\ {\isacharparenleft}af\ A{\isacharparenright}}}. Iterating this argument yields the promised infinite
nipkow@10123
   168
\isa{A}-avoiding path. Let us formalize this sketch.
nipkow@10123
   169
paulson@10867
   170
The one-step argument in the sketch above
paulson@10867
   171
is proved by a variant of contraposition:%
nipkow@10123
   172
\end{isamarkuptext}%
wenzelm@11866
   173
\isamarkuptrue%
nipkow@10123
   174
\isacommand{lemma}\ not{\isacharunderscore}in{\isacharunderscore}lfp{\isacharunderscore}afD{\isacharcolon}\isanewline
nipkow@10983
   175
\ {\isachardoublequote}s\ {\isasymnotin}\ lfp{\isacharparenleft}af\ A{\isacharparenright}\ {\isasymLongrightarrow}\ s\ {\isasymnotin}\ A\ {\isasymand}\ {\isacharparenleft}{\isasymexists}\ t{\isachardot}\ {\isacharparenleft}s{\isacharcomma}t{\isacharparenright}\ {\isasymin}\ M\ {\isasymand}\ t\ {\isasymnotin}\ lfp{\isacharparenleft}af\ A{\isacharparenright}{\isacharparenright}{\isachardoublequote}\isanewline
wenzelm@11866
   176
\isamarkupfalse%
nipkow@10237
   177
\isacommand{apply}{\isacharparenleft}erule\ contrapos{\isacharunderscore}np{\isacharparenright}\isanewline
wenzelm@11866
   178
\isamarkupfalse%
nipkow@11231
   179
\isacommand{apply}{\isacharparenleft}subst\ lfp{\isacharunderscore}unfold{\isacharbrackleft}OF\ mono{\isacharunderscore}af{\isacharbrackright}{\isacharparenright}\isanewline
wenzelm@11866
   180
\isamarkupfalse%
nipkow@10159
   181
\isacommand{apply}{\isacharparenleft}simp\ add{\isacharcolon}af{\isacharunderscore}def{\isacharparenright}\isanewline
wenzelm@11866
   182
\isamarkupfalse%
wenzelm@11866
   183
\isacommand{done}\isamarkupfalse%
wenzelm@11866
   184
%
nipkow@10123
   185
\begin{isamarkuptext}%
nipkow@10123
   186
\noindent
paulson@10867
   187
We assume the negation of the conclusion and prove \isa{s\ {\isasymin}\ lfp\ {\isacharparenleft}af\ A{\isacharparenright}}.
nipkow@10237
   188
Unfolding \isa{lfp} once and
nipkow@10123
   189
simplifying with the definition of \isa{af} finishes the proof.
nipkow@10123
   190
nipkow@10123
   191
Now we iterate this process. The following construction of the desired
nipkow@10895
   192
path is parameterized by a predicate \isa{Q} that should hold along the path:%
nipkow@10123
   193
\end{isamarkuptext}%
wenzelm@11866
   194
\isamarkuptrue%
nipkow@10123
   195
\isacommand{consts}\ path\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}state\ {\isasymRightarrow}\ {\isacharparenleft}state\ {\isasymRightarrow}\ bool{\isacharparenright}\ {\isasymRightarrow}\ {\isacharparenleft}nat\ {\isasymRightarrow}\ state{\isacharparenright}{\isachardoublequote}\isanewline
wenzelm@11866
   196
\isamarkupfalse%
nipkow@10123
   197
\isacommand{primrec}\isanewline
nipkow@10895
   198
{\isachardoublequote}path\ s\ Q\ {\isadigit{0}}\ {\isacharequal}\ s{\isachardoublequote}\isanewline
wenzelm@11866
   199
{\isachardoublequote}path\ s\ Q\ {\isacharparenleft}Suc\ n{\isacharparenright}\ {\isacharequal}\ {\isacharparenleft}SOME\ t{\isachardot}\ {\isacharparenleft}path\ s\ Q\ n{\isacharcomma}t{\isacharparenright}\ {\isasymin}\ M\ {\isasymand}\ Q\ t{\isacharparenright}{\isachardoublequote}\isamarkupfalse%
wenzelm@11866
   200
%
nipkow@10123
   201
\begin{isamarkuptext}%
nipkow@10123
   202
\noindent
wenzelm@11706
   203
Element \isa{n\ {\isacharplus}\ {\isacharparenleft}{\isadigit{1}}{\isasymColon}{\isacharprime}a{\isacharparenright}} on this path is some arbitrary successor
nipkow@10895
   204
\isa{t} of element \isa{n} such that \isa{Q\ t} holds.  Remember that \isa{SOME\ t{\isachardot}\ R\ t}
nipkow@10654
   205
is some arbitrary but fixed \isa{t} such that \isa{R\ t} holds (see \S\ref{sec:SOME}). Of
paulson@10867
   206
course, such a \isa{t} need not exist, but that is of no
paulson@10867
   207
concern to us since we will only use \isa{path} when a
nipkow@10123
   208
suitable \isa{t} does exist.
nipkow@10123
   209
nipkow@10895
   210
Let us show that if each state \isa{s} that satisfies \isa{Q}
nipkow@10895
   211
has a successor that again satisfies \isa{Q}, then there exists an infinite \isa{Q}-path:%
nipkow@10123
   212
\end{isamarkuptext}%
wenzelm@11866
   213
\isamarkuptrue%
nipkow@10159
   214
\isacommand{lemma}\ infinity{\isacharunderscore}lemma{\isacharcolon}\isanewline
nipkow@10895
   215
\ \ {\isachardoublequote}{\isasymlbrakk}\ Q\ s{\isacharsemicolon}\ {\isasymforall}s{\isachardot}\ Q\ s\ {\isasymlongrightarrow}\ {\isacharparenleft}{\isasymexists}\ t{\isachardot}\ {\isacharparenleft}s{\isacharcomma}t{\isacharparenright}\ {\isasymin}\ M\ {\isasymand}\ Q\ t{\isacharparenright}\ {\isasymrbrakk}\ {\isasymLongrightarrow}\isanewline
wenzelm@11866
   216
\ \ \ {\isasymexists}p{\isasymin}Paths\ s{\isachardot}\ {\isasymforall}i{\isachardot}\ Q{\isacharparenleft}p\ i{\isacharparenright}{\isachardoublequote}\isamarkupfalse%
wenzelm@11866
   217
%
nipkow@10123
   218
\begin{isamarkuptxt}%
nipkow@10123
   219
\noindent
nipkow@10983
   220
First we rephrase the conclusion slightly because we need to prove simultaneously
nipkow@10983
   221
both the path property and the fact that \isa{Q} holds:%
nipkow@10123
   222
\end{isamarkuptxt}%
wenzelm@11866
   223
\isamarkuptrue%
wenzelm@11866
   224
\isacommand{apply}{\isacharparenleft}subgoal{\isacharunderscore}tac\ {\isachardoublequote}{\isasymexists}p{\isachardot}\ s\ {\isacharequal}\ p\ {\isacharparenleft}{\isadigit{0}}{\isacharcolon}{\isacharcolon}nat{\isacharparenright}\ {\isasymand}\ {\isacharparenleft}{\isasymforall}i{\isachardot}\ {\isacharparenleft}p\ i{\isacharcomma}\ p{\isacharparenleft}i{\isacharplus}{\isadigit{1}}{\isacharparenright}{\isacharparenright}\ {\isasymin}\ M\ {\isasymand}\ Q{\isacharparenleft}p\ i{\isacharparenright}{\isacharparenright}{\isachardoublequote}{\isacharparenright}\isamarkupfalse%
wenzelm@11866
   225
%
nipkow@10123
   226
\begin{isamarkuptxt}%
nipkow@10123
   227
\noindent
nipkow@10159
   228
From this proposition the original goal follows easily:%
nipkow@10123
   229
\end{isamarkuptxt}%
wenzelm@11866
   230
\ \isamarkuptrue%
wenzelm@11866
   231
\isacommand{apply}{\isacharparenleft}simp\ add{\isacharcolon}Paths{\isacharunderscore}def{\isacharcomma}\ blast{\isacharparenright}\isamarkupfalse%
wenzelm@11866
   232
%
nipkow@10159
   233
\begin{isamarkuptxt}%
nipkow@10159
   234
\noindent
nipkow@10895
   235
The new subgoal is proved by providing the witness \isa{path\ s\ Q} for \isa{p}:%
nipkow@10159
   236
\end{isamarkuptxt}%
wenzelm@11866
   237
\isamarkuptrue%
nipkow@10895
   238
\isacommand{apply}{\isacharparenleft}rule{\isacharunderscore}tac\ x\ {\isacharequal}\ {\isachardoublequote}path\ s\ Q{\isachardoublequote}\ \isakeyword{in}\ exI{\isacharparenright}\isanewline
wenzelm@11866
   239
\isamarkupfalse%
wenzelm@11866
   240
\isacommand{apply}{\isacharparenleft}clarsimp{\isacharparenright}\isamarkupfalse%
wenzelm@11866
   241
%
nipkow@10159
   242
\begin{isamarkuptxt}%
nipkow@10159
   243
\noindent
paulson@11494
   244
After simplification and clarification, the subgoal has the following form:
nipkow@10363
   245
\begin{isabelle}%
nipkow@10895
   246
\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}i{\isachardot}\ {\isasymlbrakk}Q\ s{\isacharsemicolon}\ {\isasymforall}s{\isachardot}\ Q\ s\ {\isasymlongrightarrow}\ {\isacharparenleft}{\isasymexists}t{\isachardot}\ {\isacharparenleft}s{\isacharcomma}\ t{\isacharparenright}\ {\isasymin}\ M\ {\isasymand}\ Q\ t{\isacharparenright}{\isasymrbrakk}\isanewline
wenzelm@10950
   247
\isaindent{\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}i{\isachardot}\ }{\isasymLongrightarrow}\ {\isacharparenleft}path\ s\ Q\ i{\isacharcomma}\ SOME\ t{\isachardot}\ {\isacharparenleft}path\ s\ Q\ i{\isacharcomma}\ t{\isacharparenright}\ {\isasymin}\ M\ {\isasymand}\ Q\ t{\isacharparenright}\ {\isasymin}\ M\ {\isasymand}\isanewline
wenzelm@10950
   248
\isaindent{\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}i{\isachardot}\ {\isasymLongrightarrow}\ }Q\ {\isacharparenleft}path\ s\ Q\ i{\isacharparenright}%
nipkow@10159
   249
\end{isabelle}
paulson@11494
   250
It invites a proof by induction on \isa{i}:%
nipkow@10159
   251
\end{isamarkuptxt}%
wenzelm@11866
   252
\isamarkuptrue%
nipkow@10123
   253
\isacommand{apply}{\isacharparenleft}induct{\isacharunderscore}tac\ i{\isacharparenright}\isanewline
wenzelm@11866
   254
\ \isamarkupfalse%
wenzelm@11866
   255
\isacommand{apply}{\isacharparenleft}simp{\isacharparenright}\isamarkupfalse%
wenzelm@11866
   256
%
nipkow@10159
   257
\begin{isamarkuptxt}%
nipkow@10159
   258
\noindent
nipkow@10983
   259
After simplification, the base case boils down to
nipkow@10363
   260
\begin{isabelle}%
nipkow@10895
   261
\ {\isadigit{1}}{\isachardot}\ {\isasymlbrakk}Q\ s{\isacharsemicolon}\ {\isasymforall}s{\isachardot}\ Q\ s\ {\isasymlongrightarrow}\ {\isacharparenleft}{\isasymexists}t{\isachardot}\ {\isacharparenleft}s{\isacharcomma}\ t{\isacharparenright}\ {\isasymin}\ M\ {\isasymand}\ Q\ t{\isacharparenright}{\isasymrbrakk}\isanewline
wenzelm@10950
   262
\isaindent{\ {\isadigit{1}}{\isachardot}\ }{\isasymLongrightarrow}\ {\isacharparenleft}s{\isacharcomma}\ SOME\ t{\isachardot}\ {\isacharparenleft}s{\isacharcomma}\ t{\isacharparenright}\ {\isasymin}\ M\ {\isasymand}\ Q\ t{\isacharparenright}\ {\isasymin}\ M%
nipkow@10159
   263
\end{isabelle}
nipkow@10159
   264
The conclusion looks exceedingly trivial: after all, \isa{t} is chosen such that \isa{{\isacharparenleft}s{\isacharcomma}\ t{\isacharparenright}\ {\isasymin}\ M}
nipkow@10159
   265
holds. However, we first have to show that such a \isa{t} actually exists! This reasoning
nipkow@10187
   266
is embodied in the theorem \isa{someI{\isadigit{2}}{\isacharunderscore}ex}:
nipkow@10159
   267
\begin{isabelle}%
nipkow@10696
   268
\ \ \ \ \ {\isasymlbrakk}{\isasymexists}a{\isachardot}\ {\isacharquery}P\ a{\isacharsemicolon}\ {\isasymAnd}x{\isachardot}\ {\isacharquery}P\ x\ {\isasymLongrightarrow}\ {\isacharquery}Q\ x{\isasymrbrakk}\ {\isasymLongrightarrow}\ {\isacharquery}Q\ {\isacharparenleft}SOME\ x{\isachardot}\ {\isacharquery}P\ x{\isacharparenright}%
nipkow@10159
   269
\end{isabelle}
nipkow@10159
   270
When we apply this theorem as an introduction rule, \isa{{\isacharquery}P\ x} becomes
nipkow@10895
   271
\isa{{\isacharparenleft}s{\isacharcomma}\ x{\isacharparenright}\ {\isasymin}\ M\ {\isasymand}\ Q\ x} and \isa{{\isacharquery}Q\ x} becomes \isa{{\isacharparenleft}s{\isacharcomma}\ x{\isacharparenright}\ {\isasymin}\ M} and we have to prove
nipkow@10895
   272
two subgoals: \isa{{\isasymexists}a{\isachardot}\ {\isacharparenleft}s{\isacharcomma}\ a{\isacharparenright}\ {\isasymin}\ M\ {\isasymand}\ Q\ a}, which follows from the assumptions, and
nipkow@10895
   273
\isa{{\isacharparenleft}s{\isacharcomma}\ x{\isacharparenright}\ {\isasymin}\ M\ {\isasymand}\ Q\ x\ {\isasymLongrightarrow}\ {\isacharparenleft}s{\isacharcomma}\ x{\isacharparenright}\ {\isasymin}\ M}, which is trivial. Thus it is not surprising that
nipkow@10159
   274
\isa{fast} can prove the base case quickly:%
nipkow@10159
   275
\end{isamarkuptxt}%
wenzelm@11866
   276
\ \isamarkuptrue%
wenzelm@11866
   277
\isacommand{apply}{\isacharparenleft}fast\ intro{\isacharcolon}someI{\isadigit{2}}{\isacharunderscore}ex{\isacharparenright}\isamarkupfalse%
wenzelm@11866
   278
%
nipkow@10159
   279
\begin{isamarkuptxt}%
nipkow@10159
   280
\noindent
paulson@11494
   281
What is worth noting here is that we have used \methdx{fast} rather than
nipkow@10212
   282
\isa{blast}.  The reason is that \isa{blast} would fail because it cannot
nipkow@10212
   283
cope with \isa{someI{\isadigit{2}}{\isacharunderscore}ex}: unifying its conclusion with the current
nipkow@11149
   284
subgoal is non-trivial because of the nested schematic variables. For
nipkow@10212
   285
efficiency reasons \isa{blast} does not even attempt such unifications.
nipkow@10212
   286
Although \isa{fast} can in principle cope with complicated unification
nipkow@10212
   287
problems, in practice the number of unifiers arising is often prohibitive and
nipkow@10212
   288
the offending rule may need to be applied explicitly rather than
nipkow@10212
   289
automatically. This is what happens in the step case.
nipkow@10159
   290
nipkow@10212
   291
The induction step is similar, but more involved, because now we face nested
nipkow@10212
   292
occurrences of \isa{SOME}. As a result, \isa{fast} is no longer able to
nipkow@10212
   293
solve the subgoal and we apply \isa{someI{\isadigit{2}}{\isacharunderscore}ex} by hand.  We merely
nipkow@10212
   294
show the proof commands but do not describe the details:%
nipkow@10159
   295
\end{isamarkuptxt}%
wenzelm@11866
   296
\isamarkuptrue%
nipkow@10123
   297
\isacommand{apply}{\isacharparenleft}simp{\isacharparenright}\isanewline
wenzelm@11866
   298
\isamarkupfalse%
nipkow@10187
   299
\isacommand{apply}{\isacharparenleft}rule\ someI{\isadigit{2}}{\isacharunderscore}ex{\isacharparenright}\isanewline
wenzelm@11866
   300
\ \isamarkupfalse%
wenzelm@11866
   301
\isacommand{apply}{\isacharparenleft}blast{\isacharparenright}\isanewline
wenzelm@11866
   302
\isamarkupfalse%
nipkow@10187
   303
\isacommand{apply}{\isacharparenleft}rule\ someI{\isadigit{2}}{\isacharunderscore}ex{\isacharparenright}\isanewline
wenzelm@11866
   304
\ \isamarkupfalse%
nipkow@10159
   305
\isacommand{apply}{\isacharparenleft}blast{\isacharparenright}\isanewline
wenzelm@11866
   306
\isamarkupfalse%
wenzelm@11866
   307
\isacommand{apply}{\isacharparenleft}blast{\isacharparenright}\isanewline
wenzelm@11866
   308
\isamarkupfalse%
wenzelm@11866
   309
\isacommand{done}\isamarkupfalse%
wenzelm@11866
   310
%
nipkow@10159
   311
\begin{isamarkuptext}%
paulson@10867
   312
Function \isa{path} has fulfilled its purpose now and can be forgotten.
paulson@10867
   313
It was merely defined to provide the witness in the proof of the
nipkow@10171
   314
\isa{infinity{\isacharunderscore}lemma}. Aficionados of minimal proofs might like to know
nipkow@10159
   315
that we could have given the witness without having to define a new function:
nipkow@10159
   316
the term
nipkow@10159
   317
\begin{isabelle}%
nipkow@10895
   318
\ \ \ \ \ nat{\isacharunderscore}rec\ s\ {\isacharparenleft}{\isasymlambda}n\ t{\isachardot}\ SOME\ u{\isachardot}\ {\isacharparenleft}t{\isacharcomma}\ u{\isacharparenright}\ {\isasymin}\ M\ {\isasymand}\ Q\ u{\isacharparenright}%
nipkow@10159
   319
\end{isabelle}
nipkow@10895
   320
is extensionally equal to \isa{path\ s\ Q},
paulson@10867
   321
where \isa{nat{\isacharunderscore}rec} is the predefined primitive recursor on \isa{nat}.%
nipkow@10159
   322
\end{isamarkuptext}%
wenzelm@11866
   323
\isamarkuptrue%
wenzelm@11866
   324
\isamarkupfalse%
wenzelm@11866
   325
\isamarkupfalse%
wenzelm@11866
   326
\isamarkupfalse%
wenzelm@11866
   327
\isamarkupfalse%
wenzelm@11866
   328
\isamarkupfalse%
wenzelm@11866
   329
\isamarkupfalse%
wenzelm@11866
   330
\isamarkupfalse%
wenzelm@11866
   331
\isamarkupfalse%
wenzelm@11866
   332
\isamarkupfalse%
wenzelm@11866
   333
\isamarkupfalse%
wenzelm@11866
   334
\isamarkupfalse%
wenzelm@11866
   335
\isamarkupfalse%
wenzelm@11866
   336
\isamarkupfalse%
wenzelm@11866
   337
\isamarkupfalse%
wenzelm@11866
   338
\isamarkupfalse%
wenzelm@11866
   339
\isamarkupfalse%
nipkow@10159
   340
%
nipkow@10159
   341
\begin{isamarkuptext}%
nipkow@10187
   342
At last we can prove the opposite direction of \isa{AF{\isacharunderscore}lemma{\isadigit{1}}}:%
nipkow@10159
   343
\end{isamarkuptext}%
wenzelm@11866
   344
\isamarkuptrue%
nipkow@12328
   345
\isacommand{theorem}\ AF{\isacharunderscore}lemma{\isadigit{2}}{\isacharcolon}\ {\isachardoublequote}{\isacharbraceleft}s{\isachardot}\ {\isasymforall}p\ {\isasymin}\ Paths\ s{\isachardot}\ {\isasymexists}i{\isachardot}\ p\ i\ {\isasymin}\ A{\isacharbraceright}\ {\isasymsubseteq}\ lfp{\isacharparenleft}af\ A{\isacharparenright}{\isachardoublequote}\isamarkupfalse%
wenzelm@11866
   346
%
nipkow@10159
   347
\begin{isamarkuptxt}%
nipkow@10159
   348
\noindent
nipkow@10237
   349
The proof is again pointwise and then by contraposition:%
nipkow@10159
   350
\end{isamarkuptxt}%
wenzelm@11866
   351
\isamarkuptrue%
nipkow@10123
   352
\isacommand{apply}{\isacharparenleft}rule\ subsetI{\isacharparenright}\isanewline
wenzelm@11866
   353
\isamarkupfalse%
nipkow@10237
   354
\isacommand{apply}{\isacharparenleft}erule\ contrapos{\isacharunderscore}pp{\isacharparenright}\isanewline
wenzelm@11866
   355
\isamarkupfalse%
wenzelm@11866
   356
\isacommand{apply}\ simp\isamarkupfalse%
wenzelm@11866
   357
%
nipkow@10159
   358
\begin{isamarkuptxt}%
nipkow@10363
   359
\begin{isabelle}%
nipkow@10363
   360
\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}x{\isachardot}\ x\ {\isasymnotin}\ lfp\ {\isacharparenleft}af\ A{\isacharparenright}\ {\isasymLongrightarrow}\ {\isasymexists}p{\isasymin}Paths\ x{\isachardot}\ {\isasymforall}i{\isachardot}\ p\ i\ {\isasymnotin}\ A%
nipkow@10159
   361
\end{isabelle}
nipkow@10159
   362
Applying the \isa{infinity{\isacharunderscore}lemma} as a destruction rule leaves two subgoals, the second
nipkow@10159
   363
premise of \isa{infinity{\isacharunderscore}lemma} and the original subgoal:%
nipkow@10159
   364
\end{isamarkuptxt}%
wenzelm@11866
   365
\isamarkuptrue%
wenzelm@11866
   366
\isacommand{apply}{\isacharparenleft}drule\ infinity{\isacharunderscore}lemma{\isacharparenright}\isamarkupfalse%
wenzelm@11866
   367
%
nipkow@10159
   368
\begin{isamarkuptxt}%
nipkow@10363
   369
\begin{isabelle}%
nipkow@10363
   370
\ {\isadigit{1}}{\isachardot}\ {\isasymAnd}x{\isachardot}\ {\isasymforall}s{\isachardot}\ s\ {\isasymnotin}\ lfp\ {\isacharparenleft}af\ A{\isacharparenright}\ {\isasymlongrightarrow}\ {\isacharparenleft}{\isasymexists}t{\isachardot}\ {\isacharparenleft}s{\isacharcomma}\ t{\isacharparenright}\ {\isasymin}\ M\ {\isasymand}\ t\ {\isasymnotin}\ lfp\ {\isacharparenleft}af\ A{\isacharparenright}{\isacharparenright}\isanewline
nipkow@10363
   371
\ {\isadigit{2}}{\isachardot}\ {\isasymAnd}x{\isachardot}\ {\isasymexists}p{\isasymin}Paths\ x{\isachardot}\ {\isasymforall}i{\isachardot}\ p\ i\ {\isasymnotin}\ lfp\ {\isacharparenleft}af\ A{\isacharparenright}\ {\isasymLongrightarrow}\isanewline
wenzelm@10950
   372
\isaindent{\ {\isadigit{2}}{\isachardot}\ {\isasymAnd}x{\isachardot}\ }{\isasymexists}p{\isasymin}Paths\ x{\isachardot}\ {\isasymforall}i{\isachardot}\ p\ i\ {\isasymnotin}\ A%
nipkow@10159
   373
\end{isabelle}
nipkow@10159
   374
Both are solved automatically:%
nipkow@10159
   375
\end{isamarkuptxt}%
wenzelm@11866
   376
\ \isamarkuptrue%
wenzelm@11866
   377
\isacommand{apply}{\isacharparenleft}auto\ dest{\isacharcolon}not{\isacharunderscore}in{\isacharunderscore}lfp{\isacharunderscore}afD{\isacharparenright}\isanewline
wenzelm@11866
   378
\isamarkupfalse%
wenzelm@11866
   379
\isacommand{done}\isamarkupfalse%
wenzelm@11866
   380
%
nipkow@10159
   381
\begin{isamarkuptext}%
paulson@10867
   382
If you find these proofs too complicated, we recommend that you read
paulson@10867
   383
\S\ref{sec:CTL-revisited}, where we show how inductive definitions lead to
nipkow@10217
   384
simpler arguments.
nipkow@10217
   385
nipkow@10217
   386
The main theorem is proved as for PDL, except that we also derive the
nipkow@10217
   387
necessary equality \isa{lfp{\isacharparenleft}af\ A{\isacharparenright}\ {\isacharequal}\ {\isachardot}{\isachardot}{\isachardot}} by combining
nipkow@10217
   388
\isa{AF{\isacharunderscore}lemma{\isadigit{1}}} and \isa{AF{\isacharunderscore}lemma{\isadigit{2}}} on the spot:%
nipkow@10159
   389
\end{isamarkuptext}%
wenzelm@11866
   390
\isamarkuptrue%
nipkow@10123
   391
\isacommand{theorem}\ {\isachardoublequote}mc\ f\ {\isacharequal}\ {\isacharbraceleft}s{\isachardot}\ s\ {\isasymTurnstile}\ f{\isacharbraceright}{\isachardoublequote}\isanewline
wenzelm@11866
   392
\isamarkupfalse%
nipkow@10123
   393
\isacommand{apply}{\isacharparenleft}induct{\isacharunderscore}tac\ f{\isacharparenright}\isanewline
wenzelm@11866
   394
\isamarkupfalse%
nipkow@10187
   395
\isacommand{apply}{\isacharparenleft}auto\ simp\ add{\isacharcolon}\ EF{\isacharunderscore}lemma\ equalityI{\isacharbrackleft}OF\ AF{\isacharunderscore}lemma{\isadigit{1}}\ AF{\isacharunderscore}lemma{\isadigit{2}}{\isacharbrackright}{\isacharparenright}\isanewline
wenzelm@11866
   396
\isamarkupfalse%
wenzelm@11866
   397
\isacommand{done}\isamarkupfalse%
wenzelm@11866
   398
%
nipkow@10159
   399
\begin{isamarkuptext}%
paulson@10867
   400
The language defined above is not quite CTL\@. The latter also includes an
nipkow@10983
   401
until-operator \isa{EU\ f\ g} with semantics ``there \emph{E}xists a path
paulson@11494
   402
where \isa{f} is true \emph{U}ntil \isa{g} becomes true''.  We need
paulson@11494
   403
an auxiliary function:%
nipkow@10281
   404
\end{isamarkuptext}%
wenzelm@11866
   405
\isamarkuptrue%
nipkow@10281
   406
\isacommand{consts}\ until{\isacharcolon}{\isacharcolon}\ {\isachardoublequote}state\ set\ {\isasymRightarrow}\ state\ set\ {\isasymRightarrow}\ state\ {\isasymRightarrow}\ state\ list\ {\isasymRightarrow}\ bool{\isachardoublequote}\isanewline
wenzelm@11866
   407
\isamarkupfalse%
nipkow@10281
   408
\isacommand{primrec}\isanewline
nipkow@10281
   409
{\isachardoublequote}until\ A\ B\ s\ {\isacharbrackleft}{\isacharbrackright}\ \ \ \ {\isacharequal}\ {\isacharparenleft}s\ {\isasymin}\ B{\isacharparenright}{\isachardoublequote}\isanewline
wenzelm@11866
   410
{\isachardoublequote}until\ A\ B\ s\ {\isacharparenleft}t{\isacharhash}p{\isacharparenright}\ {\isacharequal}\ {\isacharparenleft}s\ {\isasymin}\ A\ {\isasymand}\ {\isacharparenleft}s{\isacharcomma}t{\isacharparenright}\ {\isasymin}\ M\ {\isasymand}\ until\ A\ B\ t\ p{\isacharparenright}{\isachardoublequote}\isamarkupfalse%
wenzelm@11866
   411
\isamarkupfalse%
wenzelm@11866
   412
%
nipkow@10281
   413
\begin{isamarkuptext}%
nipkow@10281
   414
\noindent
paulson@11494
   415
Expressing the semantics of \isa{EU} is now straightforward:
nipkow@10171
   416
\begin{isabelle}%
nipkow@10983
   417
\ \ \ \ \ s\ {\isasymTurnstile}\ EU\ f\ g\ {\isacharequal}\ {\isacharparenleft}{\isasymexists}p{\isachardot}\ until\ {\isacharbraceleft}t{\isachardot}\ t\ {\isasymTurnstile}\ f{\isacharbraceright}\ {\isacharbraceleft}t{\isachardot}\ t\ {\isasymTurnstile}\ g{\isacharbraceright}\ s\ p{\isacharparenright}%
nipkow@10171
   418
\end{isabelle}
nipkow@10281
   419
Note that \isa{EU} is not definable in terms of the other operators!
nipkow@10281
   420
nipkow@10281
   421
Model checking \isa{EU} is again a least fixed point construction:
nipkow@10171
   422
\begin{isabelle}%
nipkow@10839
   423
\ \ \ \ \ mc{\isacharparenleft}EU\ f\ g{\isacharparenright}\ {\isacharequal}\ lfp{\isacharparenleft}{\isasymlambda}T{\isachardot}\ mc\ g\ {\isasymunion}\ mc\ f\ {\isasyminter}\ {\isacharparenleft}M{\isasyminverse}\ {\isacharbackquote}{\isacharbackquote}\ T{\isacharparenright}{\isacharparenright}%
nipkow@10171
   424
\end{isabelle}
nipkow@10281
   425
nipkow@10281
   426
\begin{exercise}
nipkow@10281
   427
Extend the datatype of formulae by the above until operator
nipkow@10281
   428
and prove the equivalence between semantics and model checking, i.e.\ that
nipkow@10186
   429
\begin{isabelle}%
nipkow@10186
   430
\ \ \ \ \ mc\ {\isacharparenleft}EU\ f\ g{\isacharparenright}\ {\isacharequal}\ {\isacharbraceleft}s{\isachardot}\ s\ {\isasymTurnstile}\ EU\ f\ g{\isacharbraceright}%
nipkow@10186
   431
\end{isabelle}
nipkow@10186
   432
%For readability you may want to annotate {term EU} with its customary syntax
nipkow@10186
   433
%{text[display]"| EU formula formula    E[_ U _]"}
nipkow@10186
   434
%which enables you to read and write {text"E[f U g]"} instead of {term"EU f g"}.
nipkow@10186
   435
\end{exercise}
paulson@10867
   436
For more CTL exercises see, for example, Huth and Ryan \cite{Huth-Ryan-book}.%
nipkow@10281
   437
\end{isamarkuptext}%
wenzelm@11866
   438
\isamarkuptrue%
wenzelm@11866
   439
\isamarkupfalse%
wenzelm@11866
   440
\isamarkupfalse%
wenzelm@11866
   441
\isamarkupfalse%
wenzelm@11866
   442
\isamarkupfalse%
wenzelm@11866
   443
\isamarkupfalse%
wenzelm@11866
   444
\isamarkupfalse%
wenzelm@11866
   445
\isamarkupfalse%
wenzelm@11866
   446
\isamarkupfalse%
wenzelm@11866
   447
\isamarkupfalse%
wenzelm@11866
   448
\isamarkupfalse%
wenzelm@11866
   449
\isamarkupfalse%
wenzelm@11866
   450
\isamarkupfalse%
wenzelm@11866
   451
\isamarkupfalse%
wenzelm@11866
   452
\isamarkupfalse%
wenzelm@11866
   453
\isamarkupfalse%
wenzelm@11866
   454
\isamarkupfalse%
wenzelm@11866
   455
\isamarkupfalse%
wenzelm@11866
   456
\isamarkupfalse%
wenzelm@11866
   457
\isamarkupfalse%
wenzelm@11866
   458
\isamarkupfalse%
wenzelm@11866
   459
\isamarkupfalse%
wenzelm@11866
   460
\isamarkupfalse%
wenzelm@11866
   461
\isamarkupfalse%
wenzelm@11866
   462
\isamarkupfalse%
wenzelm@11866
   463
\isamarkupfalse%
wenzelm@11866
   464
\isamarkupfalse%
wenzelm@11866
   465
\isamarkupfalse%
nipkow@10281
   466
%
nipkow@10281
   467
\begin{isamarkuptext}%
nipkow@10186
   468
Let us close this section with a few words about the executability of our model checkers.
nipkow@10159
   469
It is clear that if all sets are finite, they can be represented as lists and the usual
nipkow@10159
   470
set operations are easily implemented. Only \isa{lfp} requires a little thought.
paulson@10878
   471
Fortunately, the HOL Library%
nipkow@10983
   472
\footnote{See theory \isa{While_Combinator}.}
paulson@10878
   473
provides a theorem stating that 
paulson@10878
   474
in the case of finite sets and a monotone function~\isa{F},
nipkow@10983
   475
the value of \mbox{\isa{lfp\ F}} can be computed by iterated application of \isa{F} to~\isa{{\isacharbraceleft}{\isacharbraceright}} until
nipkow@10242
   476
a fixed point is reached. It is actually possible to generate executable functional programs
nipkow@10159
   477
from HOL definitions, but that is beyond the scope of the tutorial.%
paulson@11494
   478
\index{CTL|)}%
nipkow@10159
   479
\end{isamarkuptext}%
wenzelm@11866
   480
\isamarkuptrue%
wenzelm@11866
   481
\isamarkupfalse%
nipkow@10123
   482
\end{isabellebody}%
nipkow@10123
   483
%%% Local Variables:
nipkow@10123
   484
%%% mode: latex
nipkow@10123
   485
%%% TeX-master: "root"
nipkow@10123
   486
%%% End: