on specification and verification of location- based fault tolerant mobile systems alexei iliasov,...

35
On Specification and Verification of Location-Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky Supported by IST 2004-511599 project (RODIN)

Upload: whitney-england

Post on 01-Apr-2015

215 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

On Specification and Verification of Location-

Based Fault Tolerant Mobile Systems

Alexei Iliasov, Victor Khomenko, Maciej Koutny and

Alexander Romanovsky

Supported by IST 2004-511599 project

(RODIN)

Page 2: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

2

Introduction and motivation• Verification of concurrent systems specified in B

• Combine theorem proving with model checking: They have complementary strengths , e.g.

cumbersome theorems/invariants can be verified by a model-checker

B machines are not very convenient for modelling sequential activity (need ‘program counter’) – it would be good to combine B and some process algebra

• Combining theorem proving and model checking is proven efficient in industry, e.g. Intel’s verification of Pentium 4 floating point unit

Page 3: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

3

CAMA Architecture

• Agent – global structuring unit of the system

• Scope – structuring unit of coordination space and agent activity

• Role – structuring unit of agent functionality and also the basis for formal specification of functionality

• Location – structuring unit of agent context

Page 4: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

4

CAMA OperationsLocation operations: Scope Operations:

Engage@l CreateScope(n,s)@l.s

Disengage@l [email protected]

JoinScope(r)@l.s

[email protected]

GetScopes(d)@l.s

Linda operations:

in, rd, inp, rdp, ina, rd, inpa, rdpa

Page 5: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

5

Approach

PNKlaim

B

B

Code

Prefix

Properties

MC

Page 6: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

6

KLAIM• A process algebra related to pi-calculus:

• A network of nodes, identified by localities (names)

• Each node has an associated tuple space

• A node runs a set of processes

• Processes can create new nodes

• Processes can input/output tuples from/to tuple spaces of nodes they know

• Processes can start new processes on the nodes they know (e.g. move)

Page 7: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

7

CAMA KLAIM

• Just a simple syntactic translation

• Can combine the system described in CAMA with one described in KLAIM

Page 8: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

8

KLAIM PN

• Compositional translation is possible

• Example: a simple mobile robot (SMR)

Intended behaviour of the system:

input a start-up message

FOREVER DO

input locality uoutput your previous locality

move to u

Page 9: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

9

KLAIM PNPossible KLAIM model:

a :: in(s)@self . eval(SMR(self))@self . nil | <s> | <c>

||

b :: <c>

||

c :: <b>

where

SMR(w) = in(!u)@self . out(w)@self . eval(SMR(self))@u . nil

Page 10: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

10

Example: SMR

b

a

c

SYS

<c>

<c>

<b>

<s>

Page 11: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

11

Example: SMR

b

a

c

SMR

<c>

<c>

<b>

Page 12: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

12

Example: SMR

b

a

c

<c>

<b>SMR

<a>

Page 13: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

13

Example: SMR

b

a

c

<c>

<a>

SMR

<a>

Page 14: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

14

Example: SMR

b

a

c

<a>

<a>

<c>

SMR

Page 15: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

15

Example: SMR

Possible (compositional) translation to HL Petri nets:

in

eval

x

z

xλx

λ

λx

x.z

a.s

a.c

b.c c.b

λ is the empty string

net of SMR

a

s

Page 16: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

16

Example: SMR

in

eval

x

z

xλx

λ

λx

x.z

a.s

a.c

b.c c.b

a

s

in can be fired with

z = s

x = a

leading to

Page 17: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

17

Example: SMR

in

eval

x

z

xλx

λ

λx

x.z

a.c

b.c c.b

a

s

Page 18: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

18

Example: SMR

in

eval

x

z

xλx

λ

λx

x.z

a.c

b.c c.b

a

s

eval can be fired with

x = a

leading to

Page 19: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

19

Example: SMR

in

eval

x

z

xλx

λ

λx

x.z

a.c

b.c c.b

a

s

λa

λ

λa

Page 20: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

20

Example: SMR

evalσtz

a.c

b.c c.b

λa

λ

λa

σt

x.z

t

σx

σx

x.z

σx

σtxσ

σ

σ

σ

σ

out

in

σz

σz

σz

Page 21: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

21

Example: SMR

evalσtz

a.c

b.c c.b

λa

λ

λa

σt

x.z

t

σx

σx

x.z

σx

σtxσ

σ

σ

σ

σ

out

in

σz

σz

σzin can be fired with

σ = λ

x = a

z = c

leading to

Page 22: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

22

Example: SMR

evalσtz

b.c c.b

λa

λλa

σt

x.z

t

σx

σx

x.z

σx

σtxσ

σ

σ

σ

σ

out

in

σz

σz

σz

λc

Page 23: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

23

Example: SMR

evalσtz

b.c c.b

λa

λλa

σt

x.z

t

σx

σx

x.z

σx

σtxσ

σ

σ

σ

σ

out

in

σz

σz

σzout can be fired with

σ = λ

x = a

z = a

leading to

λc

Page 24: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

24

Example: SMR

evalσtz

b.c c.b

λa

λ

λa

σt

x.z

t

σx

σx

x.z

σx

σtxσ

σ

σ

σ

σ

out

in

σz

σz

σz

λc

a.a

Page 25: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

25

Example: SMR

evalσtz

b.c c.b

λa

λ

λa

σt

x.z

t

σx

σx

x.z

σx

σtxσ

σ

σ

σ

σ

out

in

σz

σz

σz

λc

a.a

eval can be fired with

σ = λ

x = a

z = c

leading to

Page 26: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

26

Example: SMR

evalσtz

b.c c.b

λa

λa

σt

x.z

t

σx

σx

x.z

σx

σtxσ

σ

σ

σ

σ

out

in

σz

σz

σz

λc

a.a

t

ta

tc

which is in fact

Page 27: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

27

Example: SMR

evalσtz

b.c c.b

λa

λa

σt

x.z

t

σx

σx

x.z

σx

σtxσ

σ

σ

σ

σ

out

in

σz

σz

σz

λc

a.a

t

ta

tc

Page 28: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

28

Example: SMR

evalσtz

b.c c.b

λa

λa

σt

x.z

t

σx

σx

x.z

σx

σtxσ

σ

σ

σ

σ

out

in

σz

σz

σz

λc

a.a

t

ta

tc

in can be fired with

σ = t

x = c

z = b

leading to

Page 29: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

29

Example: SMR

evalσtz

b.c

λa

λa

σt

x.z

t

σx

σx

x.z

σx

σtxσ

σ

σ

σ

σ

out

in

σz

σz

σz

λc

a.a

t

ta

tc tb

Page 30: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

30

Example: SMR

evalσtz

b.c

λa

λa

σt

x.z

t

σx

σx

x.z

σx

σtxσ

σ

σ

σ

σ

out

in

σz

σz

σz

λc

a.a

t

ta

tc tb

... and so on ...

Page 31: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

31

Petri net unfolding prefixes

• Partial-order semantics of PNs

• Concurrency represented explicitly, using an acyclic PN

• Alleviate the state space explosion problem

• Efficient model checking algorithms

• Can be used for coloured PNs

Page 32: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

32

Example: Dining Philosophers

P5 P13

T1

P3 T3

P2 T2

P1 T5 P6 T4

P4

P7

P8

P9

P11

P10

P14

P12

T9

T7

T10 T6

T8

T1P1

T2

T3

P2

P3

P4

P5

T4 P6 T5

P1

P7

P8P7

P8

P9T6

T7P10

P11

T8 P13

P12

T9 P14 T10P9

P7

P8

Page 33: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

33

Model checking on PN unfoldings

• A Boolean expression is built using the prefix, such that: is unsatisfiable iff the property holds Every satisfiable assignment of

gives a violation trace has a form CONFVIOL

• Some of the variables of are associated with the events of the prefix

Page 34: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

34

Shortest violation traces

• In the workshop’s proceedings:

V. Khomenko: “Computing Shortest Violation Traces in Model Checking Based on Petri Net Unfoldings and SAT”

• The structure of the prefix can be exploited to compute the shortest violation traces efficiently

• They can be much shorter than the first computed trace

• Do not contain incidental system activity unrelated to the found error

• Facilitate debugging, saving the designer’s time

Page 35: On Specification and Verification of Location- Based Fault Tolerant Mobile Systems Alexei Iliasov, Victor Khomenko, Maciej Koutny and Alexander Romanovsky

35

Future work

• Checking the properties related to fault tolerance, e.g.:

correctness of scoping structure handling all exceptions absence of deadlocks absence of information smuggling

between scopes involving (if necessary) all agents in a a

scope in cooperative handling etc.

• Translation of B properties to PN