1.1 --- a/doc-src/TutorialI/CTL/document/PDL.tex Sun Oct 21 19:48:19 2001 +0200
1.2 +++ b/doc-src/TutorialI/CTL/document/PDL.tex Sun Oct 21 19:49:29 2001 +0200
1.3 @@ -1,9 +1,11 @@
1.4 %
1.5 \begin{isabellebody}%
1.6 \def\isabellecontext{PDL}%
1.7 +\isamarkupfalse%
1.8 %
1.9 \isamarkupsubsection{Propositional Dynamic Logic --- PDL%
1.10 }
1.11 +\isamarkuptrue%
1.12 %
1.13 \begin{isamarkuptext}%
1.14 \index{PDL|(}
1.15 @@ -15,11 +17,13 @@
1.16 \cite{HarelKT-DL} looks quite different from ours, but the two are easily
1.17 shown to be equivalent.}%
1.18 \end{isamarkuptext}%
1.19 +\isamarkuptrue%
1.20 \isacommand{datatype}\ formula\ {\isacharequal}\ Atom\ atom\isanewline
1.21 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\isacharbar}\ Neg\ formula\isanewline
1.22 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\isacharbar}\ And\ formula\ formula\isanewline
1.23 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\isacharbar}\ AX\ formula\isanewline
1.24 -\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\isacharbar}\ EF\ formula%
1.25 +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\isacharbar}\ EF\ formula\isamarkupfalse%
1.26 +%
1.27 \begin{isamarkuptext}%
1.28 \noindent
1.29 This resembles the boolean expression case study in
1.30 @@ -27,19 +31,23 @@
1.31 A validity relation between
1.32 states and formulae specifies the semantics:%
1.33 \end{isamarkuptext}%
1.34 -\isacommand{consts}\ valid\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}state\ {\isasymRightarrow}\ formula\ {\isasymRightarrow}\ bool{\isachardoublequote}\ \ \ {\isacharparenleft}{\isachardoublequote}{\isacharparenleft}{\isacharunderscore}\ {\isasymTurnstile}\ {\isacharunderscore}{\isacharparenright}{\isachardoublequote}\ {\isacharbrackleft}{\isadigit{8}}{\isadigit{0}}{\isacharcomma}{\isadigit{8}}{\isadigit{0}}{\isacharbrackright}\ {\isadigit{8}}{\isadigit{0}}{\isacharparenright}%
1.35 +\isamarkuptrue%
1.36 +\isacommand{consts}\ valid\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}state\ {\isasymRightarrow}\ formula\ {\isasymRightarrow}\ bool{\isachardoublequote}\ \ \ {\isacharparenleft}{\isachardoublequote}{\isacharparenleft}{\isacharunderscore}\ {\isasymTurnstile}\ {\isacharunderscore}{\isacharparenright}{\isachardoublequote}\ {\isacharbrackleft}{\isadigit{8}}{\isadigit{0}}{\isacharcomma}{\isadigit{8}}{\isadigit{0}}{\isacharbrackright}\ {\isadigit{8}}{\isadigit{0}}{\isacharparenright}\isamarkupfalse%
1.37 +%
1.38 \begin{isamarkuptext}%
1.39 \noindent
1.40 The syntax annotation allows us to write \isa{s\ {\isasymTurnstile}\ f} instead of
1.41 \hbox{\isa{valid\ s\ f}}.
1.42 The definition of \isa{{\isasymTurnstile}} is by recursion over the syntax:%
1.43 \end{isamarkuptext}%
1.44 +\isamarkuptrue%
1.45 \isacommand{primrec}\isanewline
1.46 {\isachardoublequote}s\ {\isasymTurnstile}\ Atom\ a\ \ {\isacharequal}\ {\isacharparenleft}a\ {\isasymin}\ L\ s{\isacharparenright}{\isachardoublequote}\isanewline
1.47 {\isachardoublequote}s\ {\isasymTurnstile}\ Neg\ f\ \ \ {\isacharequal}\ {\isacharparenleft}{\isasymnot}{\isacharparenleft}s\ {\isasymTurnstile}\ f{\isacharparenright}{\isacharparenright}{\isachardoublequote}\isanewline
1.48 {\isachardoublequote}s\ {\isasymTurnstile}\ And\ f\ g\ {\isacharequal}\ {\isacharparenleft}s\ {\isasymTurnstile}\ f\ {\isasymand}\ s\ {\isasymTurnstile}\ g{\isacharparenright}{\isachardoublequote}\isanewline
1.49 {\isachardoublequote}s\ {\isasymTurnstile}\ AX\ f\ \ \ \ {\isacharequal}\ {\isacharparenleft}{\isasymforall}t{\isachardot}\ {\isacharparenleft}s{\isacharcomma}t{\isacharparenright}\ {\isasymin}\ M\ {\isasymlongrightarrow}\ t\ {\isasymTurnstile}\ f{\isacharparenright}{\isachardoublequote}\isanewline
1.50 -{\isachardoublequote}s\ {\isasymTurnstile}\ EF\ f\ \ \ \ {\isacharequal}\ {\isacharparenleft}{\isasymexists}t{\isachardot}\ {\isacharparenleft}s{\isacharcomma}t{\isacharparenright}\ {\isasymin}\ M\isactrlsup {\isacharasterisk}\ {\isasymand}\ t\ {\isasymTurnstile}\ f{\isacharparenright}{\isachardoublequote}%
1.51 +{\isachardoublequote}s\ {\isasymTurnstile}\ EF\ f\ \ \ \ {\isacharequal}\ {\isacharparenleft}{\isasymexists}t{\isachardot}\ {\isacharparenleft}s{\isacharcomma}t{\isacharparenright}\ {\isasymin}\ M\isactrlsup {\isacharasterisk}\ {\isasymand}\ t\ {\isasymTurnstile}\ f{\isacharparenright}{\isachardoublequote}\isamarkupfalse%
1.52 +%
1.53 \begin{isamarkuptext}%
1.54 \noindent
1.55 The first three equations should be self-explanatory. The temporal formula
1.56 @@ -51,13 +59,16 @@
1.57 Now we come to the model checker itself. It maps a formula into the set of
1.58 states where the formula is true. It too is defined by recursion over the syntax:%
1.59 \end{isamarkuptext}%
1.60 +\isamarkuptrue%
1.61 \isacommand{consts}\ mc\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}formula\ {\isasymRightarrow}\ state\ set{\isachardoublequote}\isanewline
1.62 +\isamarkupfalse%
1.63 \isacommand{primrec}\isanewline
1.64 {\isachardoublequote}mc{\isacharparenleft}Atom\ a{\isacharparenright}\ \ {\isacharequal}\ {\isacharbraceleft}s{\isachardot}\ a\ {\isasymin}\ L\ s{\isacharbraceright}{\isachardoublequote}\isanewline
1.65 {\isachardoublequote}mc{\isacharparenleft}Neg\ f{\isacharparenright}\ \ \ {\isacharequal}\ {\isacharminus}mc\ f{\isachardoublequote}\isanewline
1.66 {\isachardoublequote}mc{\isacharparenleft}And\ f\ g{\isacharparenright}\ {\isacharequal}\ mc\ f\ {\isasyminter}\ mc\ g{\isachardoublequote}\isanewline
1.67 {\isachardoublequote}mc{\isacharparenleft}AX\ f{\isacharparenright}\ \ \ \ {\isacharequal}\ {\isacharbraceleft}s{\isachardot}\ {\isasymforall}t{\isachardot}\ {\isacharparenleft}s{\isacharcomma}t{\isacharparenright}\ {\isasymin}\ M\ \ {\isasymlongrightarrow}\ t\ {\isasymin}\ mc\ f{\isacharbraceright}{\isachardoublequote}\isanewline
1.68 -{\isachardoublequote}mc{\isacharparenleft}EF\ f{\isacharparenright}\ \ \ \ {\isacharequal}\ lfp{\isacharparenleft}{\isasymlambda}T{\isachardot}\ mc\ f\ {\isasymunion}\ {\isacharparenleft}M{\isasyminverse}\ {\isacharbackquote}{\isacharbackquote}\ T{\isacharparenright}{\isacharparenright}{\isachardoublequote}%
1.69 +{\isachardoublequote}mc{\isacharparenleft}EF\ f{\isacharparenright}\ \ \ \ {\isacharequal}\ lfp{\isacharparenleft}{\isasymlambda}T{\isachardot}\ mc\ f\ {\isasymunion}\ {\isacharparenleft}M{\isasyminverse}\ {\isacharbackquote}{\isacharbackquote}\ T{\isacharparenright}{\isacharparenright}{\isachardoublequote}\isamarkupfalse%
1.70 +%
1.71 \begin{isamarkuptext}%
1.72 \noindent
1.73 Only the equation for \isa{EF} deserves some comments. Remember that the
1.74 @@ -73,25 +84,37 @@
1.75 First we prove monotonicity of the function inside \isa{lfp}
1.76 in order to make sure it really has a least fixed point.%
1.77 \end{isamarkuptext}%
1.78 +\isamarkuptrue%
1.79 \isacommand{lemma}\ mono{\isacharunderscore}ef{\isacharcolon}\ {\isachardoublequote}mono{\isacharparenleft}{\isasymlambda}T{\isachardot}\ A\ {\isasymunion}\ {\isacharparenleft}M{\isasyminverse}\ {\isacharbackquote}{\isacharbackquote}\ T{\isacharparenright}{\isacharparenright}{\isachardoublequote}\isanewline
1.80 +\isamarkupfalse%
1.81 \isacommand{apply}{\isacharparenleft}rule\ monoI{\isacharparenright}\isanewline
1.82 +\isamarkupfalse%
1.83 \isacommand{apply}\ blast\isanewline
1.84 -\isacommand{done}%
1.85 +\isamarkupfalse%
1.86 +\isacommand{done}\isamarkupfalse%
1.87 +%
1.88 \begin{isamarkuptext}%
1.89 \noindent
1.90 Now we can relate model checking and semantics. For the \isa{EF} case we need
1.91 a separate lemma:%
1.92 \end{isamarkuptext}%
1.93 +\isamarkuptrue%
1.94 \isacommand{lemma}\ EF{\isacharunderscore}lemma{\isacharcolon}\isanewline
1.95 -\ \ {\isachardoublequote}lfp{\isacharparenleft}{\isasymlambda}T{\isachardot}\ A\ {\isasymunion}\ {\isacharparenleft}M{\isasyminverse}\ {\isacharbackquote}{\isacharbackquote}\ T{\isacharparenright}{\isacharparenright}\ {\isacharequal}\ {\isacharbraceleft}s{\isachardot}\ {\isasymexists}t{\isachardot}\ {\isacharparenleft}s{\isacharcomma}t{\isacharparenright}\ {\isasymin}\ M\isactrlsup {\isacharasterisk}\ {\isasymand}\ t\ {\isasymin}\ A{\isacharbraceright}{\isachardoublequote}%
1.96 +\ \ {\isachardoublequote}lfp{\isacharparenleft}{\isasymlambda}T{\isachardot}\ A\ {\isasymunion}\ {\isacharparenleft}M{\isasyminverse}\ {\isacharbackquote}{\isacharbackquote}\ T{\isacharparenright}{\isacharparenright}\ {\isacharequal}\ {\isacharbraceleft}s{\isachardot}\ {\isasymexists}t{\isachardot}\ {\isacharparenleft}s{\isacharcomma}t{\isacharparenright}\ {\isasymin}\ M\isactrlsup {\isacharasterisk}\ {\isasymand}\ t\ {\isasymin}\ A{\isacharbraceright}{\isachardoublequote}\isamarkupfalse%
1.97 +%
1.98 \begin{isamarkuptxt}%
1.99 \noindent
1.100 The equality is proved in the canonical fashion by proving that each set
1.101 includes the other; the inclusion is shown pointwise:%
1.102 \end{isamarkuptxt}%
1.103 +\isamarkuptrue%
1.104 \isacommand{apply}{\isacharparenleft}rule\ equalityI{\isacharparenright}\isanewline
1.105 -\ \isacommand{apply}{\isacharparenleft}rule\ subsetI{\isacharparenright}\isanewline
1.106 -\ \isacommand{apply}{\isacharparenleft}simp{\isacharparenright}%
1.107 +\ \isamarkupfalse%
1.108 +\isacommand{apply}{\isacharparenleft}rule\ subsetI{\isacharparenright}\isanewline
1.109 +\ \isamarkupfalse%
1.110 +\isacommand{apply}{\isacharparenleft}simp{\isacharparenright}\isamarkupfalse%
1.111 +\isamarkupfalse%
1.112 +%
1.113 \begin{isamarkuptxt}%
1.114 \noindent
1.115 Simplification leaves us with the following first subgoal
1.116 @@ -100,9 +123,13 @@
1.117 \end{isabelle}
1.118 which is proved by \isa{lfp}-induction:%
1.119 \end{isamarkuptxt}%
1.120 -\ \isacommand{apply}{\isacharparenleft}erule\ lfp{\isacharunderscore}induct{\isacharparenright}\isanewline
1.121 -\ \ \isacommand{apply}{\isacharparenleft}rule\ mono{\isacharunderscore}ef{\isacharparenright}\isanewline
1.122 -\ \isacommand{apply}{\isacharparenleft}simp{\isacharparenright}%
1.123 +\ \isamarkuptrue%
1.124 +\isacommand{apply}{\isacharparenleft}erule\ lfp{\isacharunderscore}induct{\isacharparenright}\isanewline
1.125 +\ \ \isamarkupfalse%
1.126 +\isacommand{apply}{\isacharparenleft}rule\ mono{\isacharunderscore}ef{\isacharparenright}\isanewline
1.127 +\ \isamarkupfalse%
1.128 +\isacommand{apply}{\isacharparenleft}simp{\isacharparenright}\isamarkupfalse%
1.129 +%
1.130 \begin{isamarkuptxt}%
1.131 \noindent
1.132 Having disposed of the monotonicity subgoal,
1.133 @@ -115,13 +142,18 @@
1.134 It is proved by \isa{blast}, using the transitivity of
1.135 \isa{M\isactrlsup {\isacharasterisk}}.%
1.136 \end{isamarkuptxt}%
1.137 -\ \isacommand{apply}{\isacharparenleft}blast\ intro{\isacharcolon}\ rtrancl{\isacharunderscore}trans{\isacharparenright}%
1.138 +\ \isamarkuptrue%
1.139 +\isacommand{apply}{\isacharparenleft}blast\ intro{\isacharcolon}\ rtrancl{\isacharunderscore}trans{\isacharparenright}\isamarkupfalse%
1.140 +%
1.141 \begin{isamarkuptxt}%
1.142 We now return to the second set inclusion subgoal, which is again proved
1.143 pointwise:%
1.144 \end{isamarkuptxt}%
1.145 +\isamarkuptrue%
1.146 \isacommand{apply}{\isacharparenleft}rule\ subsetI{\isacharparenright}\isanewline
1.147 -\isacommand{apply}{\isacharparenleft}simp{\isacharcomma}\ clarify{\isacharparenright}%
1.148 +\isamarkupfalse%
1.149 +\isacommand{apply}{\isacharparenleft}simp{\isacharcomma}\ clarify{\isacharparenright}\isamarkupfalse%
1.150 +%
1.151 \begin{isamarkuptxt}%
1.152 \noindent
1.153 After simplification and clarification we are left with
1.154 @@ -142,7 +174,9 @@
1.155 \isa{P\ a} provided each step backwards from a predecessor \isa{z} of
1.156 \isa{b} preserves \isa{P}.%
1.157 \end{isamarkuptxt}%
1.158 -\isacommand{apply}{\isacharparenleft}erule\ converse{\isacharunderscore}rtrancl{\isacharunderscore}induct{\isacharparenright}%
1.159 +\isamarkuptrue%
1.160 +\isacommand{apply}{\isacharparenleft}erule\ converse{\isacharunderscore}rtrancl{\isacharunderscore}induct{\isacharparenright}\isamarkupfalse%
1.161 +%
1.162 \begin{isamarkuptxt}%
1.163 \noindent
1.164 The base case
1.165 @@ -151,29 +185,42 @@
1.166 \end{isabelle}
1.167 is solved by unrolling \isa{lfp} once%
1.168 \end{isamarkuptxt}%
1.169 -\ \isacommand{apply}{\isacharparenleft}subst\ lfp{\isacharunderscore}unfold{\isacharbrackleft}OF\ mono{\isacharunderscore}ef{\isacharbrackright}{\isacharparenright}%
1.170 +\ \isamarkuptrue%
1.171 +\isacommand{apply}{\isacharparenleft}subst\ lfp{\isacharunderscore}unfold{\isacharbrackleft}OF\ mono{\isacharunderscore}ef{\isacharbrackright}{\isacharparenright}\isamarkupfalse%
1.172 +%
1.173 \begin{isamarkuptxt}%
1.174 \begin{isabelle}%
1.175 \ {\isadigit{1}}{\isachardot}\ {\isasymAnd}x\ t{\isachardot}\ t\ {\isasymin}\ A\ {\isasymLongrightarrow}\ t\ {\isasymin}\ A\ {\isasymunion}\ M{\isasyminverse}\ {\isacharbackquote}{\isacharbackquote}\ lfp\ {\isacharparenleft}{\isasymlambda}T{\isachardot}\ A\ {\isasymunion}\ M{\isasyminverse}\ {\isacharbackquote}{\isacharbackquote}\ T{\isacharparenright}%
1.176 \end{isabelle}
1.177 and disposing of the resulting trivial subgoal automatically:%
1.178 \end{isamarkuptxt}%
1.179 -\ \isacommand{apply}{\isacharparenleft}blast{\isacharparenright}%
1.180 +\ \isamarkuptrue%
1.181 +\isacommand{apply}{\isacharparenleft}blast{\isacharparenright}\isamarkupfalse%
1.182 +%
1.183 \begin{isamarkuptxt}%
1.184 \noindent
1.185 The proof of the induction step is identical to the one for the base case:%
1.186 \end{isamarkuptxt}%
1.187 +\isamarkuptrue%
1.188 \isacommand{apply}{\isacharparenleft}subst\ lfp{\isacharunderscore}unfold{\isacharbrackleft}OF\ mono{\isacharunderscore}ef{\isacharbrackright}{\isacharparenright}\isanewline
1.189 +\isamarkupfalse%
1.190 \isacommand{apply}{\isacharparenleft}blast{\isacharparenright}\isanewline
1.191 -\isacommand{done}%
1.192 +\isamarkupfalse%
1.193 +\isacommand{done}\isamarkupfalse%
1.194 +%
1.195 \begin{isamarkuptext}%
1.196 The main theorem is proved in the familiar manner: induction followed by
1.197 \isa{auto} augmented with the lemma as a simplification rule.%
1.198 \end{isamarkuptext}%
1.199 +\isamarkuptrue%
1.200 \isacommand{theorem}\ {\isachardoublequote}mc\ f\ {\isacharequal}\ {\isacharbraceleft}s{\isachardot}\ s\ {\isasymTurnstile}\ f{\isacharbraceright}{\isachardoublequote}\isanewline
1.201 +\isamarkupfalse%
1.202 \isacommand{apply}{\isacharparenleft}induct{\isacharunderscore}tac\ f{\isacharparenright}\isanewline
1.203 +\isamarkupfalse%
1.204 \isacommand{apply}{\isacharparenleft}auto\ simp\ add{\isacharcolon}EF{\isacharunderscore}lemma{\isacharparenright}\isanewline
1.205 -\isacommand{done}%
1.206 +\isamarkupfalse%
1.207 +\isacommand{done}\isamarkupfalse%
1.208 +%
1.209 \begin{isamarkuptext}%
1.210 \begin{exercise}
1.211 \isa{AX} has a dual operator \isa{EN}
1.212 @@ -193,6 +240,20 @@
1.213 \end{exercise}
1.214 \index{PDL|)}%
1.215 \end{isamarkuptext}%
1.216 +\isamarkuptrue%
1.217 +\isamarkupfalse%
1.218 +\isamarkupfalse%
1.219 +\isamarkupfalse%
1.220 +\isamarkupfalse%
1.221 +\isamarkupfalse%
1.222 +\isamarkupfalse%
1.223 +\isamarkupfalse%
1.224 +\isamarkupfalse%
1.225 +\isamarkupfalse%
1.226 +\isamarkupfalse%
1.227 +\isamarkupfalse%
1.228 +\isamarkupfalse%
1.229 +\isamarkupfalse%
1.230 \end{isabellebody}%
1.231 %%% Local Variables:
1.232 %%% mode: latex