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