Docsity

Associating Kripke Structures to Rewrite Theories in Propositional Temporal Logic - Prof. , Study notes of Computer Science

Partial preview of the text

Download Associating Kripke Structures to Rewrite Theories in Propositional Temporal Logic - Prof. and more Study notes Computer Science in PDF only on Docsity!

Program Verification:

Lecture 24

Jos´e Meseguer Computer Science DepartmentUniversity of Illinois at Urbana-Champaign

LTL Verification of Declarative Concurrent Programs Proving that a Maude

system module

satisfies a property

ϕ

means proving that the corresponding initial model does:

T|=^ ϕ.R^

We have seen how to do this for invariants. But propertiesthat talk about

infinite

behavior (e.g., fairness) require a

richer logic, such as Linear Temporal Logic (LTL). Becausein LTL we have a “next” operator

©^ which talks not just

about what is reachable in general, but what is reachable

in

one step

, we will need a tighter notion of model than

T.R

This is provided by the

Kripke structure

K(R, k)

associatedΠ

to the rewrite theory

R^ with state predicates

Π. So our

satisfaction problem will be recast as:

K(R, k)Π

,^ [t]^ |=^ ϕ.

The Syntax of

LT L(AP

)^ (II)

Other LTL connectives can be defined in terms of theabove minimal set of connectives as follows:^ •^ Other Boolean connectives:^ ◦^

False:^

⊥^ =^ ¬⊤

◦^ Conjunction

:^ ϕ^ ∧^ ψ

=^ ¬((¬ϕ

)^ ∨^ (¬ψ))

◦^ Implication

:^ ϕ^ →^ ψ

= (¬ϕ)^

∨^ ψ.

-^ Other temporal operators:^ ◦^ Eventually

:^3 ϕ^ = ⊤ U^ ϕ ◦^ Henceforth

:^2 ϕ^ =^

¬^3 ¬ϕ ◦^ Release

:^ ϕ^ R^ ψ

=^ ¬((¬ϕ

)^ U^ (¬ψ))

◦^ Unless

:^ ϕ^ W^ ψ

= (ϕ^ U^

ψ)^ ∨^ (^2 ϕ

◦^ Leads-to

:^ ϕ^ ;^ ψ

=^2 (ϕ^ →

(^3 ψ))

◦^ Strong implication

:^ ϕ^ ⇒^ ψ

=^2 (ϕ^ →

ψ)

◦^ Strong equivalence

:^ ϕ^ ⇔^ ψ

=^2 (ϕ^ ↔

ψ).

Kripke Structures (II)

A^ Kripke structure

is a triple

A^ = (A,

→, L)^ A

such that

A^ is a

set, called the set of

states,^

→is a total binary relation onA^

A, called the

transition relation

, and^ L^

:^ A^ −→ P

(AP^ )^ is a

function, called the

labeling function

, associating to each

state^ a^ ∈

A^ the set

L(a)^ of those

atomic propositions

in^ AP

that^ hold

in the state

a. How can we associate a Kripke structure to a rewrite theory R^ = (Σ, E, φ, R

)? We just need to make explicit two things: (1) the intended

kind^ k^

of states in the signature

Σ; and (2)

the relevant

state predicates

, that is, the relevant set

AP^ of

atomic propositions. Having fixed

k, our associated Kripke

structure has as set of states those of kind

k^ in the initial

model, that is,

T.Σ/E^

Kripke Structures (III)

The corresponding transition relation will the totalization^1 •^ (→)of the^ R

one-step

rewrite relation

(^1) →on R^ T, where,Σ/E,k

by definition,

(^1) [t] →[ R^ ′t]^ iff there are terms

u^ ∈^ [t]^ and

′^ ′ u∈^ [t]

and a proof

′^ R ⊢u^ → 1 ′^ u(see Lecture 21). R^ If^ R^ satisfies the usual executability requirements we havean isomorphism

∼ TC=^ R R

and our desired Kripke structure

has a much more intiuitive equivalent representation: its setof states is the set of canonical terms

C, and itsΣ/E,k

transition relation is the totalization

1 • (→) CR^

of the one-step

transition relation

(^1) →defined in Lecture 21. CR^ We will explain later in this lecture how the remaining partof the Kripke structure, namely the labeling functionspecifying the state predicates, can also be defined.

The Semantics of

LT L(AP

)^ (II)

We can define the path satisfaction relation (for any path,beginning at any state) inductively as follows:^ •^ We always have

A, π^ |=LT L

-^ For^ p^

∈^ AP^ ,^ A

, π^ |=LT L

p^ ⇔^

p^ ∈^ L(π(0))

-^ For^ ©

ϕ^ ∈^ LT L

(A), A, π |=©LT L^

ϕ^ ⇔^

A, s;^ π^ |=

ϕ,LT L

where^ s

: IN^ −→

IN^ is the successor function.

-^ For^ ϕ

U^ ψ^ ∈^ LT L

(A),^ A, π^ |=

ϕ^ U^ LT L ψ^ ⇔

(∃n^ ∈^ IN) ((

nA, s;^ π^ | =ψ)LT L^

∧((∀m^ ∈

IN)^ m < n

m ⇒ A, s ;^ π^ |=LT L

ϕ)).

-^ For^ ¬

ϕ^ ∈^ LT L

(AP^ ), A, π^ |=LT L

¬ϕ^ ⇔

A, π^6 |=

ϕ.LT L

-^ For^ ϕ

∨^ ψ^ ∈^ LT L

(AP^ ),^ A, π^ |=

ϕ^ ∨^ LT L ψ^ ⇔ A, π^ |=LT L

ϕ^ or^ A

, π^ |=LT L

ψ.

11

op O_ : Formula -> Formula [ctor prec 53 format (r o d)] .op U : Formula Formula -> Formula [ctor prec 63 format (d r o d)] .op R : Formula Formula -> Formula [ctor prec 63 format (d r o d)] .*** defined LTL operatorsop -> : Formula Formula -> Formula [gather (e E) prec 65

format (d r o d)].

op <-> : Formula Formula -> Formula [prec 65 format (d r o d)] .op <>_ : Formula -> Formula [prec 53 format (r o d)] .op []_ : Formula -> Formula [prec 53 format (r d o d)] .op W : Formula Formula -> Formula [prec 63 format (d r o d)] .op |-> : Formula Formula -> Formula [prec 63 format (d r o d)].

*** leads-to

op => : Formula Formula -> Formula [gather (e E) prec 65

format (d r o d)].

op <=> : Formula Formula -> Formula [prec 65 format (d r o d)] .vars f g : Formula .eq f -> g = ~ f / g .eq f <-> g = (f -> g) /\ (g -> f).

eq <> f = True U f .eq [] f = False R f .eq f W g = (f U g) / [] f .eq f |-> g = [](f -> (<> g)) .eq f => g = [] (f -> g) .eq f <=> g = [] (f <-> g) .*** negative normal formeq ~ True = False .eq ~ False = True .eq ~ ~ f = f .eq ~ (f / g) = ~ f /\ ~ g .eq ~ (f /\ g) = ~ f / ~ g .eq ~ O f = O ~ f .eq ~(f U g) = (~ f) R (~ g) .eq ~(f R g) = (~ f) U (~ g) .endfm

Associating Kripke structures to Rewrite Theories Since the models of temporal logic are Kripke structures, weneed to explain how we can associate a Kripke structure tothe rewrite theory specified by a Maude system module

M.

Indeed, we associate a Kripke structure to the rewrite theory R^ = (Σ, E, φ, R

)^ specified by a Maude system module

M^ by

making explicit two things: (1) the intended

kind^ k^

of states

in the signature

Σ; and (2) the relevant

state predicates

,

that is, the relevant set

AP^ of atomic propositions.

In general, the state predicates need not be part of the system specification

and therefore they need not be specified in our system module

M. They are typically part of

the^ property specification

.

Associating Kripke structures to Rewrite Theories (II) This is because the state predicates need not be related tothe operational semantics of

M: they are just certain

predicates

about the states of the system specified by

M

that are needed to specify some

properties

.

Therefore, after choosing a given kind, say

[Foo], in

M^ as

our kind for states we can specify the relevant statepredicates in a module

M-PREDS

which is a

protecting

extension of

M^ according to the following general pattern: mod M-PREDS is protecting M .including SATISFACTION .subsort Foo < State ....endm

Associating Kripke structures to Rewrite Theories (IV)^ subsort Foo < State. all terms of sort

Foo^ in^ M

are also made terms of sort

State.

Note that we then have the kind identity,

[Foo]=

[State] .

The operator^ op |= : State Prop -> Bool [frozen]. is crucial to define the semantics of the relevant statepredicates in

M-PREDS

. Each such state predicate is declared as an operator of sort

Prop. In standard LTL propositional logic the set

AP^ of atomic

propositions is assumed to be a set of

constants

.

19

Associating Kripke structures to Rewrite Theories (V) In Maude we can define

parametric

state predicates, that is,

operators of sort

Prop^ which need not be constants, but may have one or more sorts as parameter arguments. Wethen define the

semantics

of such state predicates (when

the predicate holds) by appropriate equations.We can illustrate all this by means of a simple mutualexclusion example. Suppose that our original systemmodule^

M^ is the following module

MUTEX, in which two

processes, one named

a^ and another named

b, can be either

waiting or in their critical section, and take turns accessingtheir critical section by passing each other a different

token

(either^ $

or^ *).