


































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



































Jos´
e Meseguer
Computer Science Department
University of Illinois at Urbana-Champaign
1
Simulations
Given two Kripke structures
A
A
, and
B
B
, both having the same set
of atomic
propositions, an
simulation
of
by
is a
binary relation
such that, denoting pairs
a, b
by
aHb
, we have:
if
a
A
a
′
and
aHb
, then there is a
b
′
such that
b
B
b
′
and
a
′
Hb
′
, and
a
b
aHb
B
b
A
a
.
If the relation
is a
function
, then we call
an
simulation map
. If both
and
−
1
are
-simulations,
then we call
a
bisimulation
.
2
Simulations Reflect Satisfaction of
Formulae
We say that an
-simulation
reflects
the
satisfaction of an
formula
ϕ
iff
, b
ϕ
and
aHb
imply
, a
ϕ
.
A fundamental result, allowing us to prove the satisfactionof an
formula
ϕ
in an infinite-state system
by
proving the same satisfaction in a finite-state system
that
simulates it is the following, Theorem
:
-simulations always reflect satisfaction of
formulae.
4
Simulations Reflect Satisfaction of
Formulae (II)
Proof:
First of all, note that we can extend
to a binary
relation
P ath
P ath
, where,
π
Hρ
n
π
n
Hρ
n
Lemma
: If
aHb
, than for each
π
P ath
such that
π
a
there is a
ρ
P ath
such that
ρ
b
and
π
Hρ
.
Proof of Lemma1:
The proof amounts to an inductive
argument that, if we have built the first
n
stages of
ρ
, then
we can always build the
n
stage. So, assume that we
have
ρ
defined for
i
n
with
ρ
b
, and with:
5
Simulations Reflect Satisfaction of
Formulae (IV)
Proof of Lemma
: The proof is by structural induction on
the structure of
formulae. We prove the base case and
the case
ϕ
ψ
, and leave the rest as an exercise.
For
p
we have,
, b, ρ
p
iff
p
B
b
, which by
simulation and
aHb
is equivalent to
p
A
a
, which is itself
equivalent to,
, a, π
ϕ
.
Assume that the result holds for
ψ
. Let us then show that
it holds for
ϕ
ψ
. We have,
, b, ρ
ψ
iff
, ρ
, s
ρ
ψ
. But note that if
π
Hρ
, then for any
n
we
have,
s
n
π
Hs
n
ρ
. Therefore, by the induction hypothesis we
can conclude that,
, π
, s
π
ψ
, which is equivalent to,
, a, π
ψ
. q.e.d.
7
Simulations Reflect Satisfaction of
Formulae (V)
We are now essentially done. Suppose
, b
ϕ
and
aHb
.
Then we have,
, b, ρ
ϕ
for any
ρ
P ath
such that
ρ
b
. To prove
, a
ϕ
, we have to show that for each
π
P ath
with
π
a
we have,
, a, π
ϕ
. But, by
Lemma1, for each such
π
we have a
ρ
such that,
ρ
b
,
and
π
Hρ
. Then, by Lemma2, we have,
, a, π
ϕ
. q.e.d.
We say that an
-simulation
preserves
the
satisfaction of an
formula
ϕ
iff
, a
ϕ
and
aHb
imply
, b
ϕ
.
Corollary
:
-bisimulations always reflect and preserve
satisfaction of
formulae.
8
Quotient Abstractions
Let
A
A
be a Kripke structure on
. We call
an equivalence relation
on
label-preserving
if
a
a
′
A
a
A
a
′
. We can use a label-preserving
equivalence relation
to define a new Kripke structure,
A
/
≡
A
/
≡
, where:
a
1
A
/
≡
a
2
iff
a
′ 1
a
1
a
′ 2
a
2
s.t.
a
′ 1
A
a
′ 2
.
A
/
≡
a
A
a
It is then trivial to check that the projection map toequivalence classes
q
≡
a
a
is an
-simulation map
q
≡
, which we call the
quotient abstraction
defined by
.
10
Equational Quotient Abstractions
We are of course particularly interested in abstractionmethods for systems specified by rewrite theories. Recallthat, given a rewrite theory
, E, φ, R
plus equations
defining state predicates
in a kind
k
of states, we have
associated to it the Kripke structure,
, k
Π
Σ
/E,k
1 R
Π
This Kripke structure may be infinite-state, so that wecannot use an
model checker to verify its properties; or
it can have a finite state space too big to make modelchecking feasible. We are therefore interested in definingquotient abstractions of Kripke structures of this kind.
11
Equational Quotient Abstractions (III)
Then, a quite general method for defining quotientabstractions of the Kripke structure K
, k
Π
Σ
/E,k
1 R
Π
is adapting to Kripke
structures the method followed in Lecture 23 to defineequational abstractions for invariants. That is, we can addto
a set
of equations such that
′
also
protects
, and consider the rewrite theory
G, φ, R
, which has an associated Kripke
structure
/G, k
Π
Σ
/E
∪
G,k
1 R
/G
Π
/G
, with
Π
/G
t
E
∪
G
θ
p
Π
t
θ
p
true
Note that we have an equivalence relation
G
on
Σ
/E,k
,
namely,
t
E
G
t
′
E
t
t
′
t
E
∪
G
t
′
E
∪
G
13
Equational Quotient Abstractions (IV)
And of course we have a bijection
Σ
/E,k
G
Σ
/E
∪
G,k
.
The key question now is: under what conditions is the map q
≡
G
t
E
t
E
∪
G
a quotient abstraction of Kripke structures
q
≡
G
, k
Π
/G, k
Π
If it is so, we will call
/G, k
Π
Σ
/E
∪
G,k
1 R
/G
Π
/G
the
equational quotient abstraction
of
, k
Π
defined by
.
Of course, to use
as a system module in Maude to
model check
properties of
, we will also need to
require that
satisfies the usual executability conditions.
14
Equational Quotient Abstractions (V)
Theorem 2
. Let
, E, φ, R
be a
k
-deadlock free
rewrite theory, and let
be equations defining (possibly
parametric) state predicates
fully defined for all states of
kind
k
as either
true
or
false
, and assume that
′
protects
. Let then
be a set of
-equations such that
′
also protects
. Then the map
q
≡
G
t
E
t
E
∪
G
is a quotient abstraction of Kripke
structures
q
≡
G
, k
Π
/G, k
Π
Proof:
Since
is
k
-deadlock free, it is trivial to check that
is also
k
-deadlock free and that therefore we have
1 R
/G
1 R
/G
1 R
G
16
Equational Quotient Abstractions (VI)
The only remaining thing to check is that
G
is
label-preserving. This is equivalent to proving the followingequivalences for each
p
and ground substitution
θ
:
t
θ
p
true
t
θ
p
true
t
θ
p
false
t
θ
p
false
The
follow by monotonicity of equational reasoning.
The
follow from the protecting
assumption, since
we can reason by contradiction. Suppose, for example, that E
t
θ
p
true
but
t
θ
p
true
. By the
protecting
assumption this forces
t
θ
p
false
, which implies
t
θ
p
false
, contradicting the protection of
. q.e.d.
17
Executability of Equational Quotient Abstractions (II)
The checks for executability may be positive or negative.But if, say, the equations
are not ground confluent,
we may be able to complete them to get a semanticallyequivalent set of equations, say
′
which is ground
confluent, sort-decreasing, and terminating. Similarly, if therules
are not ground coherent, we may be able to
complete them to get an equivalent set
′
of rules that is
ground coherent. In this way we would obtain a rewritetheory
′
′
, φ, R
′
semantically equivalent to
.
Therefore we would have an isomorphism of a Kripkestructures
′
, k
Π
/G, k
Π
, but now with the crucial
propety that
′
is
executable
, so we can use
′
to verify our
desired
properties about
.
19
A Bakery Protocol Example
In the early stages of algebraic specification all formalismswould use a
data type as an example. In the relatively
early stages of abstraction techniques it is likewise
de
rigueur
to show how the technique in question handles
Lamport’s bakery protocol.This is an infinite-state protocol that achieves mutualexclusion between processes by the usual method commonin bakeries and deli shops: there is a number dispenser, andcustomers are served in sequential order according to thenumber that they hold.A simple Maude specification for the case of two processesis as follows,
20