10267
|
1 |
%
|
|
2 |
\begin{isabellebody}%
|
|
3 |
\def\isabellecontext{CTLind}%
|
11866
|
4 |
\isamarkupfalse%
|
10267
|
5 |
%
|
10878
|
6 |
\isamarkupsubsection{CTL Revisited%
|
10395
|
7 |
}
|
11866
|
8 |
\isamarkuptrue%
|
10267
|
9 |
%
|
|
10 |
\begin{isamarkuptext}%
|
|
11 |
\label{sec:CTL-revisited}
|
11494
|
12 |
\index{CTL|(}%
|
|
13 |
The purpose of this section is twofold: to demonstrate
|
|
14 |
some of the induction principles and heuristics discussed above and to
|
10283
|
15 |
show how inductive definitions can simplify proofs.
|
10267
|
16 |
In \S\ref{sec:CTL} we gave a fairly involved proof of the correctness of a
|
10795
|
17 |
model checker for CTL\@. In particular the proof of the
|
10267
|
18 |
\isa{infinity{\isacharunderscore}lemma} on the way to \isa{AF{\isacharunderscore}lemma{\isadigit{2}}} is not as
|
11494
|
19 |
simple as one might expect, due to the \isa{SOME} operator
|
10283
|
20 |
involved. Below we give a simpler proof of \isa{AF{\isacharunderscore}lemma{\isadigit{2}}}
|
|
21 |
based on an auxiliary inductive definition.
|
10267
|
22 |
|
|
23 |
Let us call a (finite or infinite) path \emph{\isa{A}-avoiding} if it does
|
|
24 |
not touch any node in the set \isa{A}. Then \isa{AF{\isacharunderscore}lemma{\isadigit{2}}} says
|
|
25 |
that if no infinite path from some state \isa{s} is \isa{A}-avoiding,
|
|
26 |
then \isa{s\ {\isasymin}\ lfp\ {\isacharparenleft}af\ A{\isacharparenright}}. We prove this by inductively defining the set
|
|
27 |
\isa{Avoid\ s\ A} of states reachable from \isa{s} by a finite \isa{A}-avoiding path:
|
|
28 |
% Second proof of opposite direction, directly by well-founded induction
|
|
29 |
% on the initial segment of M that avoids A.%
|
|
30 |
\end{isamarkuptext}%
|
11866
|
31 |
\isamarkuptrue%
|
10267
|
32 |
\isacommand{consts}\ Avoid\ {\isacharcolon}{\isacharcolon}\ {\isachardoublequote}state\ {\isasymRightarrow}\ state\ set\ {\isasymRightarrow}\ state\ set{\isachardoublequote}\isanewline
|
11866
|
33 |
\isamarkupfalse%
|
10267
|
34 |
\isacommand{inductive}\ {\isachardoublequote}Avoid\ s\ A{\isachardoublequote}\isanewline
|
|
35 |
\isakeyword{intros}\ {\isachardoublequote}s\ {\isasymin}\ Avoid\ s\ A{\isachardoublequote}\isanewline
|
11866
|
36 |
\ \ \ \ \ \ \ {\isachardoublequote}{\isasymlbrakk}\ t\ {\isasymin}\ Avoid\ s\ A{\isacharsemicolon}\ t\ {\isasymnotin}\ A{\isacharsemicolon}\ {\isacharparenleft}t{\isacharcomma}u{\isacharparenright}\ {\isasymin}\ M\ {\isasymrbrakk}\ {\isasymLongrightarrow}\ u\ {\isasymin}\ Avoid\ s\ A{\isachardoublequote}\isamarkupfalse%
|
|
37 |
%
|
10267
|
38 |
\begin{isamarkuptext}%
|
|
39 |
It is easy to see that for any infinite \isa{A}-avoiding path \isa{f}
|
12492
|
40 |
with \isa{f\ {\isadigit{0}}\ {\isasymin}\ Avoid\ s\ A} there is an infinite \isa{A}-avoiding path
|
10267
|
41 |
starting with \isa{s} because (by definition of \isa{Avoid}) there is a
|
12492
|
42 |
finite \isa{A}-avoiding path from \isa{s} to \isa{f\ {\isadigit{0}}}.
|
|
43 |
The proof is by induction on \isa{f\ {\isadigit{0}}\ {\isasymin}\ Avoid\ s\ A}. However,
|
10267
|
44 |
this requires the following
|
|
45 |
reformulation, as explained in \S\ref{sec:ind-var-in-prems} above;
|
|
46 |
the \isa{rule{\isacharunderscore}format} directive undoes the reformulation after the proof.%
|
|
47 |
\end{isamarkuptext}%
|
11866
|
48 |
\isamarkuptrue%
|
10267
|
49 |
\isacommand{lemma}\ ex{\isacharunderscore}infinite{\isacharunderscore}path{\isacharbrackleft}rule{\isacharunderscore}format{\isacharbrackright}{\isacharcolon}\isanewline
|
|
50 |
\ \ {\isachardoublequote}t\ {\isasymin}\ Avoid\ s\ A\ \ {\isasymLongrightarrow}\isanewline
|
|
51 |
\ \ \ {\isasymforall}f{\isasymin}Paths\ t{\isachardot}\ {\isacharparenleft}{\isasymforall}i{\isachardot}\ f\ i\ {\isasymnotin}\ A{\isacharparenright}\ {\isasymlongrightarrow}\ {\isacharparenleft}{\isasymexists}p{\isasymin}Paths\ s{\isachardot}\ {\isasymforall}i{\isachardot}\ p\ i\ {\isasymnotin}\ A{\isacharparenright}{\isachardoublequote}\isanewline
|
11866
|
52 |
\isamarkupfalse%
|
|
53 |
\isamarkupfalse%
|
15488
|
54 |
\isamarkupfalse%
|
11866
|
55 |
\isamarkupfalse%
|
15488
|
56 |
\isamarkupfalse%
|
11866
|
57 |
\isamarkupfalse%
|
|
58 |
\isamarkupfalse%
|
|
59 |
%
|
10267
|
60 |
\begin{isamarkuptext}%
|
|
61 |
\noindent
|
11494
|
62 |
The base case (\isa{t\ {\isacharequal}\ s}) is trivial and proved by \isa{blast}.
|
10267
|
63 |
In the induction step, we have an infinite \isa{A}-avoiding path \isa{f}
|
|
64 |
starting from \isa{u}, a successor of \isa{t}. Now we simply instantiate
|
|
65 |
the \isa{{\isasymforall}f{\isasymin}Paths\ t} in the induction hypothesis by the path starting with
|
|
66 |
\isa{t} and continuing with \isa{f}. That is what the above $\lambda$-term
|
10878
|
67 |
expresses. Simplification shows that this is a path starting with \isa{t}
|
|
68 |
and that the instantiated induction hypothesis implies the conclusion.
|
10267
|
69 |
|
11196
|
70 |
Now we come to the key lemma. Assuming that no infinite \isa{A}-avoiding
|
11277
|
71 |
path starts from \isa{s}, we want to show \isa{s\ {\isasymin}\ lfp\ {\isacharparenleft}af\ A{\isacharparenright}}. For the
|
|
72 |
inductive proof this must be generalized to the statement that every point \isa{t}
|
11494
|
73 |
``between'' \isa{s} and \isa{A}, in other words all of \isa{Avoid\ s\ A},
|
11196
|
74 |
is contained in \isa{lfp\ {\isacharparenleft}af\ A{\isacharparenright}}:%
|
10267
|
75 |
\end{isamarkuptext}%
|
11866
|
76 |
\isamarkuptrue%
|
10267
|
77 |
\isacommand{lemma}\ Avoid{\isacharunderscore}in{\isacharunderscore}lfp{\isacharbrackleft}rule{\isacharunderscore}format{\isacharparenleft}no{\isacharunderscore}asm{\isacharparenright}{\isacharbrackright}{\isacharcolon}\isanewline
|
11866
|
78 |
\ \ {\isachardoublequote}{\isasymforall}p{\isasymin}Paths\ s{\isachardot}\ {\isasymexists}i{\isachardot}\ p\ i\ {\isasymin}\ A\ {\isasymLongrightarrow}\ t\ {\isasymin}\ Avoid\ s\ A\ {\isasymlongrightarrow}\ t\ {\isasymin}\ lfp{\isacharparenleft}af\ A{\isacharparenright}{\isachardoublequote}\isamarkupfalse%
|
|
79 |
\isamarkuptrue%
|
15488
|
80 |
\isamarkupfalse%
|
|
81 |
\isamarkupfalse%
|
|
82 |
\isamarkupfalse%
|
|
83 |
\isamarkupfalse%
|
|
84 |
\isamarkuptrue%
|
|
85 |
\isamarkupfalse%
|
11866
|
86 |
\isamarkupfalse%
|
15488
|
87 |
\isamarkupfalse%
|
11866
|
88 |
\isamarkuptrue%
|
|
89 |
\isamarkupfalse%
|
|
90 |
\isamarkupfalse%
|
|
91 |
\isamarkupfalse%
|
15488
|
92 |
\isamarkupfalse%
|
11866
|
93 |
\isamarkupfalse%
|
|
94 |
\isamarkupfalse%
|
|
95 |
%
|
10267
|
96 |
\begin{isamarkuptext}%
|
11196
|
97 |
The \isa{{\isacharparenleft}no{\isacharunderscore}asm{\isacharparenright}} modifier of the \isa{rule{\isacharunderscore}format} directive in the
|
|
98 |
statement of the lemma means
|
11494
|
99 |
that the assumption is left unchanged; otherwise the \isa{{\isasymforall}p}
|
|
100 |
would be turned
|
10267
|
101 |
into a \isa{{\isasymAnd}p}, which would complicate matters below. As it is,
|
|
102 |
\isa{Avoid{\isacharunderscore}in{\isacharunderscore}lfp} is now
|
|
103 |
\begin{isabelle}%
|
10696
|
104 |
\ \ \ \ \ {\isasymlbrakk}{\isasymforall}p{\isasymin}Paths\ s{\isachardot}\ {\isasymexists}i{\isachardot}\ p\ i\ {\isasymin}\ A{\isacharsemicolon}\ t\ {\isasymin}\ Avoid\ s\ A{\isasymrbrakk}\ {\isasymLongrightarrow}\ t\ {\isasymin}\ lfp\ {\isacharparenleft}af\ A{\isacharparenright}%
|
10267
|
105 |
\end{isabelle}
|
|
106 |
The main theorem is simply the corollary where \isa{t\ {\isacharequal}\ s},
|
11494
|
107 |
when the assumption \isa{t\ {\isasymin}\ Avoid\ s\ A} is trivially true
|
10845
|
108 |
by the first \isa{Avoid}-rule. Isabelle confirms this:%
|
11494
|
109 |
\index{CTL|)}%
|
10267
|
110 |
\end{isamarkuptext}%
|
11866
|
111 |
\isamarkuptrue%
|
10855
|
112 |
\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}\isanewline
|
11866
|
113 |
\isamarkupfalse%
|
15488
|
114 |
\isanewline
|
11866
|
115 |
\isamarkupfalse%
|
|
116 |
\isamarkupfalse%
|
10267
|
117 |
\end{isabellebody}%
|
|
118 |
%%% Local Variables:
|
|
119 |
%%% mode: latex
|
|
120 |
%%% TeX-master: "root"
|
|
121 |
%%% End:
|