Docsity

Equational Quotient Abstractions: Method for Verifying Infinite-State Systems - Prof. Jose, Study notes of Computer Science

Partial preview of the text

Download Equational Quotient Abstractions: Method for Verifying Infinite-State Systems - Prof. Jose and more Study notes Computer Science in PDF only on Docsity!

Program Verification:

Lecture 27

Jos´ e Meseguer Computer Science Department University of Illinois at Urbana-Champaign 1

Abstraction Methods To prove that a, possibly infinite-state, Kripke structure

A

and initial state a satisfy an

LT L

− formula ϕ , with, say,

AP

the set of atomic propositions actually appearing in ϕ , it is enough to find an

AP

-simulation

H

A −→ B

and an initial state b

B

such that aHb and:

the set of states reachable from b in

B

is finite, and

  • B , b

ϕ . Then, we can model check the property

B

, b

ϕ to prove A , a

ϕ

. Methods to find such an

H

are called abstraction methods

. This lecture will describe some recent results in joint work with Narciso Mart´ ı-Oliet and Miguel Palomino on abstraction methods for systems specified by rewritetheories. 2

Equational Quotient Abstractions We are of course particularly interested in abstractionmethods for systems specified by rewrite theories. Recallthat, given a rewrite theory

R

, E, φ, R

and a kind k , we can associate to its reachability initial model

T

Reach ( R ) the Kripke structure,

K

R

, k

T

Σ /E,k

,^

1 R

, L

R

where, by definition,

[

t

]^

1 R [t ′

]^

[(

t

t ′

)]

T

Reach ( R ) ,Arrow 1

Typically, we do not need the extremely general labelingfunction

L

R , which associates to each

[

t

]

T

Σ /E,k the set of F OL -definable state predicates holding in

[

t

]

. 4

Equational Quotient Abstractions (II) It is enough to focus on those state predicates actually occurring in a particular formula ϕ , which we may assume have been defined by the general method described whenexplaining the Maude

LT L

model checker. We assume that

R

has been defined as a Maude module, and that we have equationally specified with equations

D

a finite set of (possibly parametric) state predicate symbols Π

. Then our (possibly infinite) set of atomic predicates is the set

AP

Π

θ

p

p

, θ canonical ground substitution

. This defines a labeling function,

L

Π

([

t

]) =

θ

p

AP

Π

E

D

t

θ

p

true

We are then interested in the Kripke structure, K

R

, k

Π

T

Σ /E,k

1 R

, L

Π

. 5

Equational Quotient Abstractions (IV) But can

K

R

, k

Π

E ′^ , which we have just defined in terms of the underlying Kripke structure

K

R

, k

Π , be understood as the Kripke structure associated to another rewrite theory ? Let us take a closer look at, K

R

, k

Π

E ′^

T

Σ /E,k

E ′^

1 R

E ′^

, L

Π / ≡ E ′^

The first obvious observation is that, by definition, we have, T Σ /E,k

E ′^

T

Σ /E ∪ E ′ ,k

. A second, similarly obvious, observation (exercise) is that if

R

is k

deadlock-free , that is, if we have,

1 R

1 R

, then the rewrite theory R

/E

′^

, E

E

′, φ, R

is also k -deadlock-free, and we have, (

1 R /E ′^

1 R /E ′^

1 R

E ′^

7

Equational Quotient Abstractions (V) Therefore, for

R

k -deadlock-free, our obvious candidate for a rewrite theory having

K

R

, k

Π

E ′^ as its underlying Kripke structure is the rewrite theory, R

/E

′^

, E

E

′, φ, R

, that is, we just add to

R

the equations

E

′ , and do not change at all the rules

R

. How restrictive is the requirement that

R

is k -deadlock-free? There is no real loss of generality

. To a theory

R

satisfying the usual executability assumptions and having equational conditions we can always associate a semantically equivalent (from the

LT L

point of view) theory R kd.f. which is k -deadlock-free (see Ex .27.3). Therefore, at a purely mathematical level,

R

/E

′^ seems to be what we want. The problem comes with the followingtwo executability questions : 8

Equational Quotient Abstractions (VII) Likewise, we can try to check whether the rules

R

are ground coherent relative to

E

E

′^ (or to

E

′′ ) and if the check fails we can again try to complete the rules

R

to a semantically equivalent set of rules

R

′^ (no suitable Maude tools exist for this at the moment; they are in their designstage).By this process we can hopefully arrive at an executable theory

R

′^

, E

′′ , φ, R ′

which is semantically equivalent to R

/E

′

. We can then use

R

′^ to try to model check properties about

R

. But we are not finished yet. What about the statepredicates

? 10

Equational Quotient Abstractions (VIII) Recall that these (possibly parameterized) state predicateswill have been defined by means of equations

D

in a Maude module importing the specification of

R

and also the MODEL-CHECKER module. The question is whether the state predicates

are preserved under the equations

E

′. This indeed may be a problem. We need to unpack a littlethe definition of the innocent-looking labeling function, L Π / ≡ E ′^ , which is of course defined by the intersection formula,

L

Π / ≡ E ′^

([

t

]E

∪ E ′^

[x ]E ⊆ [t ]E ∪ E ′

L

Π

([

x

]

E

11

Equational Quotient Abstractions (X) Note that, in that case, and assuming that the equations E

E

′^

D

(or

E

′′

D

) are ground confluent, sort-decreasing, and terminating, we do not need to change the equations

D

to define the state predicates

on

R

/E

′^ (or its semantic equivalent

R

′ ). Therefore, we have an isomorphism (given by a pair ofinvertible bisimulation maps)

K

R

, k

Π

E ′^

K

R

/E

′ , k

Π

or, in case we need the semantically-equivalent

R

′ , an isomorphism,

K

R

, k

Π

E ′^

K

R

′ , k

Π

13

Equational Quotient Abstractions (XI) The crucial point in both isomorphisms is that the labelingfuction of the righthand side Kripke structure is now equationally defined by the same equations

D

as for the extension of

R

. So we can do it all in Maude. Furthermore, the quotient

AP

Π -simulation map, K

R

, k

Π

−→ K

R

/E

′ , k

Π is then by construction strict , and therefore reflects satisfaction of arbitrary

LT L

formulae (cf. Ex .26.1). 14

Equational Quotient Abstractions (XIII) Suppose a k -topmost rewrite theory in which all equations in

E

′^ are of the form, t

t ′ with t and t ′^ of kind k

. Suppose, furthermore, that the equations

E

E

′^

D

are ground confluent, sort-decreasing, and terminating. Then, it is relatively easy to prove as anexercise ( Ex .27.4.) that if for each such equation and each state predicate p we can prove the inductive property, E

D

ind

~x

~y

t

~x

p

~y

true

t ′

~x

p

~y

true

then we have established the preservation of the statepredicates

by the equations

E

′

. We can use a tool like Maude’s ITP to mechanically discharge proof obligations ofthis kind. 16

Equational Quotient Abstractions (XIV) The above method of proving properties based onequational quotient abstractions can be used beyond thecase of purely propositional LTL properties. In some cases we can also prove LTL properties involving free variables asparameters.Let

R

, E, φ, R

be a rewite theory, and let ϕ

LT L

′

, E

D

be a formula with free variables , say x 1

s 1 ,... , x n

s n , defined in a protecting extension of

, E

and involving a finite set of possibly parametric statepredicates

which we assume defined in a computable way by

E

D

ground confluent, sort-decreasing and terminating. 17

Equational Quotient Abstractions (XVI)

likewise, for k the kind of states, and for each 1

j

m , the set of

E

′′ -canonical ground terms t j,l of kind k such that

E

′′

θ j

[

S

t j,l

](

Q

is likewise finite , with

l

q j , and can be effectively determined (that is, on

T

Σ /E ′′

Q

defines a finite set of initial states) Then, we have the following useful result, which is left asan exercise: Theorem : If for each j ,

j

m , and for each l ,

l

q j we can prove by model checking that,

T

Reach ( R ′)

[

t j,l

]

LT L θ j

ϕ

then we have proved,

T

Reach ( R )

LT L

Q

ϕ. 19

A Bakery Protocol Example In the early stages of algebraic specification all formalismswould use a

STACK

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