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