liveness with counter abstraction

41
Liveness Liveness with Counter Counter Abstraction Abstraction Amir Pnueli, Jessie Xu and Lenore Zuck

Upload: solada

Post on 05-Feb-2016

36 views

Category:

Documents


3 download

DESCRIPTION

Liveness with Counter Abstraction. A mir P nueli, J essie X u and L enore Z uck. where. ?. The Problem. The Parameterized Verification Problem Given a system and a property f , Does S(N) satisfy f for every N ?. Lesson from Experience …. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Liveness with Counter Abstraction

LivenessLiveness with Counter AbstractionCounter Abstraction

Amir Pnueli, Jessie Xu and Lenore Zuck

Page 2: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

The Parameterized Verification Problem

Given a system and a property f ,

Does S(N) satisfy f for every N ?

?

The Problem

where

Page 3: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

Lesson from Experience…

In order to verify a reactive system:If it is finite state – model check itIf it is infinite – verify it deductively

But abstraction makes it all simpler!

Page 4: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

Data Abstraction

Verifying that an infinite-state system S satisfies a property f using abstraction:

abstract system into a simpler finite-state system that admits more behaviorsabstract the property tomodel check abstract system with respect to abstract propertyconclude that concrete system satisfies concrete property

Page 5: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

Counter Abstraction

Assumptions on the concrete system :the control variable of processes ranges over 0,…the shared variables are y1,…,ybthere are no local variables

The variables of the counter abstractedcounter abstracted system are K_0,…,k_L : {0,1,2}Y_1,…,Y_b

Where if no process is in control location lif there is exactly one process in control

location lif there are at least two processes in control

location l

Page 6: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

Counter Abstraction

Assumptions on the concrete system :the control variable of processes ranges over 0,…the shared variables are y1,…,ybthere are no local variables

The variables of the counter abstractedcounter abstracted system are K_0,…,k_L : {0,1,2}Y_1,…,Y_b

Where if no process is in control location lif there is exactly one process in control

location lif there are at least two processes in control

location l

Page 7: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

A Toy Example: Mutex

where

Fairness Fairness requirements:requirements:Justice:Compassion:

Page 8: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

A Toy Example: Mutex

Safety property - mutual exclusion:

Liveness property –individual accessibility:(true only with fairness)

where

Page 9: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

A Toy Example: Mutex

Page 10: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

A Toy Example: Mutex

Concrete Safety property-

mutual exclusion:

Abstract Safety property-

mutual exclusion:

Page 11: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

Safety follows trivially!

Mutex after Counter Abstraction (graphical representation)

Page 12: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

Abstracting JusticeJustice requirement

since if process is not in control location 2it is either in control location 0 or 1.

form the concrete justice requirementjustice requirement

we can obtain the

abstract requirementabstract requirement

Page 13: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

unfortunately the abstract justice requirement abstract justice requirement doesn’t discard any states, so any liveness propertyliveness propertythat is not valid for Mutex without justicejustice cannot be proven in this abstract system

verifying LivenessLiveness in Mutex

Page 14: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

Strengthening JusticeJustice Requirements

How?

We provide 4 guidelines (in two slides…)

Conclusion:

we need to derive more/stronger fairnessfairness requirementsrequirements

Page 15: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

If the concreteconcrete system contains the justicejustice

Then we can safelysafely add the abstract abstract justicejustice

Strengthening JusticeJustice Requirements

Why?

Page 16: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

• suppose a state satisfies

• then there exists exactly one process, say I, in location

• the process I violates its justice requirement

• to fulfill it, it must exit location l sometime in the future

• when it exits it , must hold since another process cannot enter location (execute a transition) at the same step

If the concreteconcrete system contains the justicejustice

Then we can safelysafely add the abstract abstract justicejusticeWhy?

Strengthening JusticeJustice Requirements

Page 17: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

Strengthening JusticeJustice Requirements

Page 18: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

Strengthening JusticeJustice Requirements

is a condition on shared variables

leads only to

Emerges from

Page 19: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

From the concrete justice and the concrete compassion we can conclude the concrete justiceconcrete justice

Strengthening JusticeJustice for Mutex

Page 20: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

Strengthening JusticeJustice for Mutex

Automatically

obtained

Page 21: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

Verifying LivenessLiveness using Counter Abstraction

which is abstracted to

Counter abstraction does not allow to observe the

behavior of an individualindividual process, thus we cannot

verify the liveness property of individual accessibilityindividual accessibility

we can, however, verify the liveness property of

communal accessibilitycommunal accessibility ( (livelock freedomlivelock freedom))

Page 22: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

Verifying LivenessLiveness

Model Checking [LP85]

Page 23: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

Verifying LivenessLiveness

Extract from the state-transition graph the sub-graph of pending states

A pending state is any state which is not reachable from a p-state by a q-free path

Show that the extracted sub-graph contains no infinite fair path

Decompose the sub-graph into maximal SCCs

Show that each of them violates some fairness requirement

Model Checking [LP85]

Page 24: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

Verifying LivenessLiveness

Model Checking [LP85]

Extract from the state-transition graph the sub-graph of pending states

A pending state is any state which is reachable

from a p-state by a q-free path

Show that the extracted sub-graph contains no infinite fair path

Decompose the sub-graph into maximal SCCs

Show that each of them violates some fairness requirement

Page 25: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

Verifying LivenessLiveness

Model Checking [LP85]

Extract from the state-transition graph the sub-graph of pending states

A pending state is any state which is reachable from a p-state by a q-free path

Show that the extracted sub-graph contains no infinite fair path

Decompose the sub-graph into maximal SCCs

Show that each of them violates some fairness requirement

Page 26: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

Verifying communal accessibilitycommunal accessibility forfor MutexMutex

To establish we have to remove all

states that are not in a q-free path reachable from a p-state

Page 27: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

Verifying communal accessibilitycommunal accessibility forfor MutexMutex

Page 28: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

Each maximal SCC (each node) violates the abstract justice Hence communal accessibility holds!

Verifying communal accessibilitycommunal accessibility forfor MutexMutex

Page 29: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

Counter Abstraction Save OneSave One

To prove individual accessibility

Counter abstractCounter abstract all the processes

except one,except one,

Model checkModel check that the abstract systemabstract system composed with one concrete processone concrete process satisfies the liveness property for the concrete process

Page 30: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

Graphical representation of Mutex under counter abstraction save one

Counter Abstraction Save OneSave One - Mutex

Page 31: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

Considering the compassion requirementcompassion requirementand the fact that no state satisfieswe can remove all states satisfying

Counter Abstraction Save OneSave One - Mutex

Page 32: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

Counter Abstraction Save OneSave One - Mutex

Page 33: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

Each maximal SCC (each node) violates the abstract justice Hence individual accessibility holds!

Counter Abstraction Save OneSave One - Mutex

Page 34: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

Adding CompassionCompassion requirements

Consider program TERMINATE

and the liveness property

The abstracted liveness property is

The counter abstraction of the program is

Page 35: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

Adding CompassionCompassion requirements

The abstracted liveness property is

The counter abstraction of the program is

From the concrete justice

We obtain the abstract justice

The computation can stay forever inwhich violates the liveness

property !

Page 36: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

Adding CompassionCompassion requirements

Page 37: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

Augment the system with two auxiliary variables and

Adding CompassionCompassion requirements

Page 38: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

Augment the system with two auxiliary variables and

Adding CompassionCompassion requirements

For each transition

If set

Else set

Add to the concrete compassion

Counter abstract the augmented system

For every justice requirement

include the abstract requirement

Page 39: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

The transition graph for augmented TERMINATE

Verifying LivenessLiveness for TERMINATE

Abstract Compassion

obtained from Abstract Justice using

Hence the liveness property holds !

Page 40: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck

Success with Counter Abstraction

Szymanski’s mutual exclusion algorithmThe Bakery Algorithm (shared variables are unbounded)Probabilistic mutual exclusion protocol

Page 41: Liveness with Counter Abstraction

Liveness with Counter Abstraction

Pnueli, Xu, Zuck