|
10123
|
1 |
%
|
|
|
2 |
\begin{isabellebody}%
|
|
|
3 |
\def\isabellecontext{PDL}%
|
|
|
4 |
%
|
|
|
5 |
\isamarkupsubsection{Propositional dynmic logic---PDL}
|
|
10133
|
6 |
%
|
|
|
7 |
\begin{isamarkuptext}%
|
|
|
8 |
The formulae of PDL are built up from atomic propositions via the customary
|
|
|
9 |
propositional connectives of negation and conjunction and the two temporal
|
|
|
10 |
connectives \isa{AX} and \isa{EF}. Since formulae are essentially
|
|
|
11 |
(syntax) trees, they are naturally modelled as a datatype:%
|
|
|
12 |
\end{isamarkuptext}%
|
|
|
13 |
\isacommand{datatype}\ pdl{\isacharunderscore}form\ {\isacharequal}\ Atom\ atom\isanewline
|
|
|
14 |
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\isacharbar}\ NOT\ pdl{\isacharunderscore}form\isanewline
|
|
|
15 |
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\isacharbar}\ And\ pdl{\isacharunderscore}form\ pdl{\isacharunderscore}form\isanewline
|
|
|
16 |
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\isacharbar}\ AX\ pdl{\isacharunderscore}form\isanewline
|
|
|
17 |
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {\isacharbar}\ EF\ pdl{\isacharunderscore}form%
|
|
|
18 |
\begin{isamarkuptext}%
|
|
|
19 |
\noindent
|
|
|
20 |
The meaning of these formulae is given by saying which formula is true in
|
|
|
21 |
which state:%
|
|
|
22 |
\end{isamarkuptext}%
|
|
|
23 |
\isacommand{consts}\ valid\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}state\ {\isasymRightarrow}\ pdl{\isacharunderscore}form\ {\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}\isanewline
|
|
10123
|
24 |
\isanewline
|
|
|
25 |
\isacommand{primrec}\isanewline
|
|
10133
|
26 |
{\isachardoublequote}s\ {\isasymTurnstile}\ Atom\ a\ \ {\isacharequal}\ {\isacharparenleft}a\ {\isasymin}\ L\ s{\isacharparenright}{\isachardoublequote}\isanewline
|
|
10123
|
27 |
{\isachardoublequote}s\ {\isasymTurnstile}\ NOT\ f\ \ \ {\isacharequal}\ {\isacharparenleft}{\isasymnot}{\isacharparenleft}s\ {\isasymTurnstile}\ f{\isacharparenright}{\isacharparenright}{\isachardoublequote}\isanewline
|
|
|
28 |
{\isachardoublequote}s\ {\isasymTurnstile}\ And\ f\ g\ {\isacharequal}\ {\isacharparenleft}s\ {\isasymTurnstile}\ f\ {\isasymand}\ s\ {\isasymTurnstile}\ g{\isacharparenright}{\isachardoublequote}\isanewline
|
|
|
29 |
{\isachardoublequote}s\ {\isasymTurnstile}\ AX\ f\ \ \ \ {\isacharequal}\ {\isacharparenleft}{\isasymforall}t{\isachardot}\ {\isacharparenleft}s{\isacharcomma}t{\isacharparenright}\ {\isasymin}\ M\ {\isasymlongrightarrow}\ t\ {\isasymTurnstile}\ f{\isacharparenright}{\isachardoublequote}\isanewline
|
|
10133
|
30 |
{\isachardoublequote}s\ {\isasymTurnstile}\ EF\ f\ \ \ \ {\isacharequal}\ {\isacharparenleft}{\isasymexists}t{\isachardot}\ {\isacharparenleft}s{\isacharcomma}t{\isacharparenright}\ {\isasymin}\ M{\isacharcircum}{\isacharasterisk}\ {\isasymand}\ t\ {\isasymTurnstile}\ f{\isacharparenright}{\isachardoublequote}%
|
|
|
31 |
\begin{isamarkuptext}%
|
|
|
32 |
Now we come to the model checker itself. It maps a formula into the set of
|
|
|
33 |
states where the formula is true and is defined by recursion over the syntax:%
|
|
|
34 |
\end{isamarkuptext}%
|
|
|
35 |
\isacommand{consts}\ mc\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}pdl{\isacharunderscore}form\ {\isasymRightarrow}\ state\ set{\isachardoublequote}\isanewline
|
|
10123
|
36 |
\isacommand{primrec}\isanewline
|
|
10133
|
37 |
{\isachardoublequote}mc{\isacharparenleft}Atom\ a{\isacharparenright}\ \ {\isacharequal}\ {\isacharbraceleft}s{\isachardot}\ a\ {\isasymin}\ L\ s{\isacharbraceright}{\isachardoublequote}\isanewline
|
|
10123
|
38 |
{\isachardoublequote}mc{\isacharparenleft}NOT\ f{\isacharparenright}\ \ \ {\isacharequal}\ {\isacharminus}mc\ f{\isachardoublequote}\isanewline
|
|
10133
|
39 |
{\isachardoublequote}mc{\isacharparenleft}And\ f\ g{\isacharparenright}\ {\isacharequal}\ mc\ f\ {\isasyminter}\ mc\ g{\isachardoublequote}\isanewline
|
|
10123
|
40 |
{\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
|
|
10133
|
41 |
{\isachardoublequote}mc{\isacharparenleft}EF\ f{\isacharparenright}\ \ \ \ {\isacharequal}\ lfp{\isacharparenleft}{\isasymlambda}T{\isachardot}\ mc\ f\ {\isasymunion}\ M{\isacharcircum}{\isacharminus}\isadigit{1}\ {\isacharcircum}{\isacharcircum}\ T{\isacharparenright}{\isachardoublequote}%
|
|
|
42 |
\begin{isamarkuptext}%
|
|
|
43 |
Only the equation for \isa{EF} deserves a comment: the postfix \isa{{\isacharcircum}{\isacharminus}\isadigit{1}}
|
|
|
44 |
and the infix \isa{{\isacharcircum}{\isacharcircum}} are predefined and denote the converse of a
|
|
|
45 |
relation and the application of a relation to a set. Thus \isa{M{\isacharcircum}{\isacharminus}\isadigit{1}\ {\isacharcircum}{\isacharcircum}\ T}
|
|
|
46 |
is the set of all predecessors of \isa{T} and \isa{mc\ {\isacharparenleft}EF\ f{\isacharparenright}} is the least
|
|
|
47 |
set \isa{T} containing \isa{mc\ f} and all predecessors of \isa{T}.%
|
|
|
48 |
\end{isamarkuptext}%
|
|
|
49 |
\isacommand{lemma}\ mono{\isacharunderscore}lemma{\isacharcolon}\ {\isachardoublequote}mono{\isacharparenleft}{\isasymlambda}T{\isachardot}\ A\ {\isasymunion}\ M{\isacharcircum}{\isacharminus}\isadigit{1}\ {\isacharcircum}{\isacharcircum}\ T{\isacharparenright}{\isachardoublequote}\isanewline
|
|
10123
|
50 |
\isacommand{apply}{\isacharparenleft}rule\ monoI{\isacharparenright}\isanewline
|
|
|
51 |
\isacommand{by}{\isacharparenleft}blast{\isacharparenright}\isanewline
|
|
|
52 |
\isanewline
|
|
|
53 |
\isacommand{lemma}\ lfp{\isacharunderscore}conv{\isacharunderscore}EF{\isacharcolon}\isanewline
|
|
10133
|
54 |
{\isachardoublequote}lfp{\isacharparenleft}{\isasymlambda}T{\isachardot}\ A\ {\isasymunion}\ M{\isacharcircum}{\isacharminus}\isadigit{1}\ {\isacharcircum}{\isacharcircum}\ T{\isacharparenright}\ {\isacharequal}\ {\isacharbraceleft}s{\isachardot}\ {\isasymexists}t{\isachardot}\ {\isacharparenleft}s{\isacharcomma}t{\isacharparenright}\ {\isasymin}\ M{\isacharcircum}{\isacharasterisk}\ {\isasymand}\ t\ {\isasymin}\ A{\isacharbraceright}{\isachardoublequote}\isanewline
|
|
10123
|
55 |
\isacommand{apply}{\isacharparenleft}rule\ equalityI{\isacharparenright}\isanewline
|
|
|
56 |
\ \isacommand{apply}{\isacharparenleft}rule\ subsetI{\isacharparenright}\isanewline
|
|
|
57 |
\ \isacommand{apply}{\isacharparenleft}simp{\isacharparenright}\isanewline
|
|
|
58 |
\ \isacommand{apply}{\isacharparenleft}erule\ Lfp{\isachardot}induct{\isacharparenright}\isanewline
|
|
|
59 |
\ \ \isacommand{apply}{\isacharparenleft}rule\ mono{\isacharunderscore}lemma{\isacharparenright}\isanewline
|
|
|
60 |
\ \isacommand{apply}{\isacharparenleft}simp{\isacharparenright}\isanewline
|
|
|
61 |
\ \isacommand{apply}{\isacharparenleft}blast\ intro{\isacharcolon}\ r{\isacharunderscore}into{\isacharunderscore}rtrancl\ rtrancl{\isacharunderscore}trans{\isacharparenright}\isanewline
|
|
|
62 |
\isacommand{apply}{\isacharparenleft}rule\ subsetI{\isacharparenright}\isanewline
|
|
|
63 |
\isacommand{apply}{\isacharparenleft}simp{\isacharparenright}\isanewline
|
|
|
64 |
\isacommand{apply}{\isacharparenleft}erule\ exE{\isacharparenright}\isanewline
|
|
|
65 |
\isacommand{apply}{\isacharparenleft}erule\ conjE{\isacharparenright}\isanewline
|
|
|
66 |
\isacommand{apply}{\isacharparenleft}erule{\isacharunderscore}tac\ P\ {\isacharequal}\ {\isachardoublequote}t{\isasymin}A{\isachardoublequote}\ \isakeyword{in}\ rev{\isacharunderscore}mp{\isacharparenright}\isanewline
|
|
|
67 |
\isacommand{apply}{\isacharparenleft}erule\ converse{\isacharunderscore}rtrancl{\isacharunderscore}induct{\isacharparenright}\isanewline
|
|
|
68 |
\ \isacommand{apply}{\isacharparenleft}rule\ ssubst{\isacharbrackleft}OF\ lfp{\isacharunderscore}Tarski{\isacharbrackleft}OF\ mono{\isacharunderscore}lemma{\isacharbrackright}{\isacharbrackright}{\isacharparenright}\isanewline
|
|
|
69 |
\ \isacommand{apply}{\isacharparenleft}blast{\isacharparenright}\isanewline
|
|
|
70 |
\isacommand{apply}{\isacharparenleft}rule\ ssubst{\isacharbrackleft}OF\ lfp{\isacharunderscore}Tarski{\isacharbrackleft}OF\ mono{\isacharunderscore}lemma{\isacharbrackright}{\isacharbrackright}{\isacharparenright}\isanewline
|
|
|
71 |
\isacommand{by}{\isacharparenleft}blast{\isacharparenright}\isanewline
|
|
|
72 |
\isanewline
|
|
|
73 |
\isacommand{theorem}\ {\isachardoublequote}mc\ f\ {\isacharequal}\ {\isacharbraceleft}s{\isachardot}\ s\ {\isasymTurnstile}\ f{\isacharbraceright}{\isachardoublequote}\isanewline
|
|
|
74 |
\isacommand{apply}{\isacharparenleft}induct{\isacharunderscore}tac\ f{\isacharparenright}\isanewline
|
|
10133
|
75 |
\isacommand{by}{\isacharparenleft}auto\ simp\ add{\isacharcolon}lfp{\isacharunderscore}conv{\isacharunderscore}EF{\isacharparenright}\end{isabellebody}%
|
|
10123
|
76 |
%%% Local Variables:
|
|
|
77 |
%%% mode: latex
|
|
|
78 |
%%% TeX-master: "root"
|
|
|
79 |
%%% End:
|