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