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