Verifying distributed systems with unbounded channels egis Gascon - - PowerPoint PPT Presentation

verifying distributed systems with unbounded channels
SMART_READER_LITE
LIVE PREVIEW

Verifying distributed systems with unbounded channels egis Gascon - - PowerPoint PPT Presentation

Verifying distributed systems with unbounded channels egis Gascon & R Eric Madelaine INRIA Sophia Antipolis SAFA Workshop - September 23rd, 2009 egis Gascon & Verifying distributed systems with unbounded channels R Eric


slide-1
SLIDE 1

Verifying distributed systems with unbounded channels

R´ egis Gascon & ´ Eric Madelaine INRIA Sophia Antipolis SAFA Workshop - September 23rd, 2009

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-2
SLIDE 2

Introduction

VERCORS in a nutshell

Platform for specification of distributed applications. Based on the semantics features of the ProActive library.

http://www-sop.inria.fr/oasis/ProActive/

Generation of intermediate finite model. Various tools can then operate on these models: static analysis, model checking, code generation. . . The aim is to integrate the platform in a development environment, used by non-specialists.

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-3
SLIDE 3

Introduction

Formal verification of pNets

Basically, pNets are made of LTSs synchronized by mean of transducer (synchronization vector). Verifying pNets remains to verify systems:

manipulating unbounded data, having a parameterized topology, using unbounded communication queues.

Numerous sources of infinity ⇔ numerous complications for formal verification. Current platform uses only finite-sate based model-checkers (through finite abstraction). We want to apply infinite state model-checking techniques.

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-4
SLIDE 4

Introduction

Infinite-state system verification

Well studied theory:

counter systems, pushdown systems, parameterized systems, . . .

Few implementations for unbounded queue systems:

LASH (Boigelot et al.), TReX (Bouajjani et al.).

Difficult to find a tool that fits our goals

integration to VERCORS possibility of extensions

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-5
SLIDE 5

Introduction

Outline

1

Introduction

2

Systems with unbounded FIFO queues

3

Reachability and Acceleration

4

Presentation of our prototype

5

Perspectives

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-6
SLIDE 6

Systems with unbounded FIFO queues

Communicating finite state machines

Basically a finite state machine augmented with a set of queues. c?0 c!0 τ · · · · · · read write

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-7
SLIDE 7

Systems with unbounded FIFO queues

Communicating finite state machines

Formally, a communicating finite state machines (CFSM) is a tuple M = (Q, q0, C, Σ, A, δ) such that Q = is a finite set of states, q0 ∈ Q is the initial state, C is a set of communicating channels/queues, Σ is the alphabet of messages, A is a finite set of internal actions, δ ⊂ Q × ((C × {?, !} × Σ) ∪ A) × Q is the transition relation.

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-8
SLIDE 8

Systems with unbounded FIFO queues

Short Example

Execution: Sequence respecting the transition relation.

q0 q1 K?0 K?1 K?1 L!1 K?0 L!0 q0 q1 L?0 L?1 K!0 L?1 K!1 L?0 Channel K → Channel L →

q0, q0, ε, ε

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-9
SLIDE 9

Systems with unbounded FIFO queues

Short Example

Execution: Sequence respecting the transition relation.

q0 q1 K?0 K?1 K?1 L!1 K?0 L!0 q0 q1 L?0 L?1 K!0 L?1 K!1 L?0 Channel K → Channel L →

q0, q0, ε, ε K!0 − → q0, q0, 0, ε

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-10
SLIDE 10

Systems with unbounded FIFO queues

Short Example

Execution: Sequence respecting the transition relation.

q0 q1 K?0 K?1 K?1 L!1 K?0 L!0 q0 q1 L?0 L?1 K!0 L?1 K!1 L?0 Channel K → Channel L →

q0, q0, ε, ε K!0 − → q0, q0, 0, ε K!0 − → · · · K!0 − →

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-11
SLIDE 11

Systems with unbounded FIFO queues

Short Example

Execution: Sequence respecting the transition relation.

q0 q1 K?0 K?1 K?1 L!1 K?0 L!0 q0 q1 L?0 L?1 K!0 L?1 K!1 L?0 Channel K → Channel L →

q0, q0, ε, ε K!0 − → q0, q0, 0, ε K!0 − → · · · K!0 − →

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-12
SLIDE 12

Systems with unbounded FIFO queues

Short Example

Execution: Sequence respecting the transition relation.

q0 q1 K?0 K?1 K?1 L!1 K?0 L!0 q0 q1 L?0 L?1 K!0 L?1 K!1 L?0 Channel K → Channel L →

q0, q0, ε, ε K!0 − → q0, q0, 0, ε K!0 − → · · · K!0 − → q0, q0, 0000, ε

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-13
SLIDE 13

Systems with unbounded FIFO queues

Short Example

Execution: Sequence respecting the transition relation.

q0 q1 K?0 K?1 K?1 L!1 K?0 L!0 q0 q1 L?0 L?1 K!0 L?1 K!1 L?0 Channel K → Channel L →

q0, q0, ε, ε K!0 − → q0, q0, 0, ε K!0 − → · · · K!0 − → q0, q0, 0000, ε K?0 − → q1, q0, 000, ε

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-14
SLIDE 14

Systems with unbounded FIFO queues

Short Example

Execution: Sequence respecting the transition relation.

q0 q1 K?0 K?1 K?1 L!1 K?0 L!0 q0 q1 L?0 L?1 K!0 L?1 K!1 L?0 Channel K → Channel L →

q0, q0, ε, ε K!0 − → q0, q0, 0, ε K!0 − → · · · K!0 − → q0, q0, 0000, ε K?0 − → q1, q0, 000, ε K?0 − → q1, q0, 00, ε

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-15
SLIDE 15

Systems with unbounded FIFO queues

Short Example

Execution: Sequence respecting the transition relation.

q0 q1 K?0 K?1 K?1 L!1 K?0 L!0 q0 q1 L?0 L?1 K!0 L?1 K!1 L?0 Channel K → Channel L →

q0, q0, ε, ε K!0 − → q0, q0, 0, ε K!0 − → · · · K!0 − → q0, q0, 0000, ε K?0 − → q1, q0, 000, ε K?0 − → q1, q0, 00, ε L!0 − → q1, q0, 00, 0

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-16
SLIDE 16

Systems with unbounded FIFO queues

Short Example

Execution: Sequence respecting the transition relation.

q0 q1 K?0 K?1 K?1 L!1 K?0 L!0 q0 q1 L?0 L?1 K!0 L?1 K!1 L?0 Channel K → Channel L →

q0, q0, ε, ε K!0 − → q0, q0, 0, ε K!0 − → · · · K!0 − → q0, q0, 0000, ε K?0 − → q1, q0, 000, ε K?0 − → q1, q0, 00, ε L!0 − → q1, q0, 00, 0 L!0 − → q1, q1, 00, ε

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-17
SLIDE 17

Systems with unbounded FIFO queues

Short Example

Execution: Sequence respecting the transition relation.

q0 q1 K?0 K?1 K?1 L!1 K?0 L!0 q0 q1 L?0 L?1 K!0 L?1 K!1 L?0 Channel K → Channel L →

q0, q0, ε, ε K!0 − → q0, q0, 0, ε K!0 − → · · · K!0 − → q0, q0, 0000, ε K?0 − → q1, q0, 000, ε K?0 − → q1, q0, 00, ε L!0 − → q1, q0, 00, 0 L!0 − → q1, q1, 00, ε − → · · ·

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-18
SLIDE 18

Systems with unbounded FIFO queues

Operational Semantics

We consider unbounded FIFO queues. Consider a set of CFSM sharing a set of queues {K, L}. Configuration: q1, q2, wK, wL (for a pair of CFSM) Global state + Queue contents Operations:

Send (non-blocking). if q1, K!a, q′

1 ∈ δ1 then

q1, q2, wK, wL

K!a

− → q′

1, q2, wK · a, wL

Receive (blocking). Internal Action.

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-19
SLIDE 19

Systems with unbounded FIFO queues

Operational Semantics

We consider unbounded FIFO queues. Consider a set of CFSM sharing a set of queues {K, L}. Configuration: q1, q2, wK, wL (for a pair of CFSM) Global state + Queue contents Operations:

Send (non-blocking). Receive (blocking). if q1, K?a, q′

1 ∈ δ1 then

q1, q2, a · wK, wL

K!a

− → q′

1, q2, wK, wL

Internal Action.

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-20
SLIDE 20

Systems with unbounded FIFO queues

Operational Semantics

We consider unbounded FIFO queues. Consider a set of CFSM sharing a set of queues {K, L}. Configuration: q1, q2, wK, wL (for a pair of CFSM) Global state + Queue contents Operations:

Send (non-blocking). Receive (blocking). Internal Action. if q1, τ, q′

1 ∈ δ1 with τ ∈ A then

q1, q2, wK, wL

τ

− → q′

1, q2, wK, wL

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-21
SLIDE 21

Reachability and Acceleration

Outline

1

Introduction

2

Systems with unbounded FIFO queues

3

Reachability and Acceleration

4

Presentation of our prototype

5

Perspectives

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-22
SLIDE 22

Reachability and Acceleration

Reachability Problem

We consider the following problem: Bad Init

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-23
SLIDE 23

Reachability and Acceleration

Reachability Problem

We consider the following problem: Bad Init We note: Post(X) = {x | ∃x′ ∈ X s.t. x − → x′}.

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-24
SLIDE 24

Reachability and Acceleration

Reachability Problem

We consider the following problem: Bad Init We note: Post(X) = {x | ∃x′ ∈ X s.t. x − → x′}. Posti(X) = Post(Post(· · · Post(X))).

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-25
SLIDE 25

Reachability and Acceleration

Reachability Problem

We consider the following problem: Bad ? Init We note: Post(X) = {x | ∃x′ ∈ X s.t. x − → x′}. Posti(X) = Post(Post(· · · Post(X))). Post∗(X) =

i≥0 Posti(X).

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-26
SLIDE 26

Reachability and Acceleration

Reachability Problem

We consider the following problem: Bad ? Init We note: Post(X) = {x | ∃x′ ∈ X s.t. x − → x′}. Posti(X) = Post(Post(· · · Post(X))). Post∗(X) =

i≥0 Posti(X).

UNDECIDABLE (semi-algorithm)

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-27
SLIDE 27

Reachability and Acceleration

Representing Sets of Configurations

We need to represent possibly infinite sets of configurations. We associate to each tuple of states of the CFSM a set of finite state automata (FUDFA) over Σ. The set of configurations corresponds to the (regular) language associated to each state. Ex: q1, q2 +   

a b

×

a a

   represents the set of configurations q1, q2, a∗b, a.

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-28
SLIDE 28

Reachability and Acceleration

Improving convergence

FUDFA allows to compute directly the result of infinitely iterating some cycles: q c!a · · ·

  • q, a∗

Pb: Cycles can induce non-regular sets of queue contents: q q c!a c′!b · · ·

  • q, an, bn

Need for characterization of accelerable loops.

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-29
SLIDE 29

Reachability and Acceleration

Algorithm with accelerations

F[s] is the FUDFA associated to global state s. We apply a depth-first exploration method. While S = ∅ do Choose and remove some s ∈ S Acceleration: For all cycle θ from s If θ can be accelerated then Compute the effect of θ∗ on F[s] OneStep successors: For all possible transition s

  • p

− → s′ Compute the effect of op on F[s] Add new reached configurations to F[s′].

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-30
SLIDE 30

Reachability and Acceleration

Complete example

q0 q1 c1!a c2?b q0 q1 q2 c1?a c2?b c1?a c2!b q0, q0 × q0, q1 × q0, q2

a

×

b

q1, q0

a

× q1, q1 × q1, q2

a

×

b

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-31
SLIDE 31

Reachability and Acceleration

Important issues for the implementation

1 Data structure, 2 Adaptability/Modularity (cannot use LASH has a blackbox), 3 Selection of cycles for acceleration,

global cycles or local cycles, heuristics.

4 Exploration strategy, 5 Using the result of the computation. Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-32
SLIDE 32

Presentation of our prototype

Outline

1

Introduction

2

Systems with unbounded FIFO queues

3

Reachability and Acceleration

4

Presentation of our prototype

5

Perspectives

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-33
SLIDE 33

Presentation of our prototype

Implementation

Algorithm implemented in JAVA. Input: A set of CFSMs sharing a set of channels: text format or graphical editor (eclipse plugin). Computes successively the set of reachable states step by step + acceleration (at each iteration). A FUDFA is associated to each global state and the main loop

  • f the algorithm can be executed.

The algorithm follows strictly the method described.

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-34
SLIDE 34

Presentation of our prototype

Exploring the statespace

We have concentrated on useful functionalities (exploration, utilisation of the result). If the computation converge OK Otherwise, the user can specify:

a set of final configurations, a timeout (number of iterations), a bound on the size of representations (= bounding the size of the queues).

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-35
SLIDE 35

Presentation of our prototype

Performance scale

On the other hand, there is no fine tunning of the implementation for the moment:

data structure quite big (naive implementation of DFAs), possible improvements in data manipulation.

In this context, we have checked the implementation w.r.t. the utilisation of the computation. no evaluation in terms of computation performance. Objective: giving a readable diagnosis of the analysis.

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-36
SLIDE 36

Presentation of our prototype

Example: Integrated toolkit

Hierarchical component example. Arrows represents dependencies.

IT TA TS JM FM FIP FTM

Each box has an associated CFSM and queue.

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-37
SLIDE 37

Presentation of our prototype

Example: Integrated toolkit

IT (stop procedure)

q1 q2 q3 q4 q5 q6 q′

2

q′

3

q4 q5 q′

6

q7 q8 q9

ta!stop ts!stop ts!stop it?TAStopped it?TAStopped it?TAStoppedit?TAStopped it?TAStopped it?TSStopped it?TSStopped jm!stop jm!stop it?JMStopped it?JMStopped fm!stop it?FMStopped ITStopped

TA

q0 q1 q2 q3 q4

ta?endT ta?endReg ts?newT noExecT ta?newT fm!regFiles ta?stop it!TAStopped

What does happen when the system is stopped?

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-38
SLIDE 38

Presentation of our prototype

Experimental scenario

When trying to compute the set configuration where IT is stopped, computation does not converge. 15 iterations 2460 DFAs and 19096 states + Size Limit 78 DFAs and 275 states Result: ta = (NewT∗ · EndReg∗ · EndT∗)∗ Then one can check that a configuration where ta is not empty can be reached. So TA can left requests unsatisfied.

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-39
SLIDE 39

Perspectives

Future Work

Improvements of exploration techniques. Comparisons with existing tools (LASH, TReX,. . . ). Extension of the representation:

representation of non-regular sets of queues, addition of datas (ex: queues + counters)

Combination with other techniques (parametrized sytems)

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-40
SLIDE 40

Perspectives

QUESTIONS ???

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-41
SLIDE 41

Perspectives

Basic Operations

Add a letter (!a): Remove a letter (?a):

b a

Nothing to do with internal actions. Generalisation to sequences: just iterate!

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-42
SLIDE 42

Perspectives

Basic Operations

Add a letter (!a): Remove a letter (?a):

b a

Nothing to do with internal actions. Generalisation to sequences: just iterate!

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-43
SLIDE 43

Perspectives

Basic Operations

Add a letter (!a):

a a

Remove a letter (?a):

b a

Nothing to do with internal actions. Generalisation to sequences: just iterate!

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-44
SLIDE 44

Perspectives

Basic Operations

Add a letter (!a):

a a

Remove a letter (?a):

b a

Nothing to do with internal actions. Generalisation to sequences: just iterate!

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-45
SLIDE 45

Perspectives

Cycle selection and acceleration

All the material needed can be adapted from Boigelot’s thesis.

exact characterisation of accelerable cycles, computation of the acceleration.

For every sequence of operations σ,

♯!(σ) is the number of send operations, ♯?(σ) is the number of receive operations.

A sequence involving only one queue is counting iff

|Σ| = 1 and ♯!(θ) > ♯?(θ), |Σ| > 1 and ♯!(θ) > 0.

Given a system with queues {c1, . . . , cn} and a cycle θ, θ|i is the sub-sequence of transitions manipulating ci.

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine

slide-46
SLIDE 46

Perspectives

Fundamental Results for acceleration

For systems with only one queue, the result is the following. Theorem (Single-queue systems) For every set of configurations X and cycle θ, the set Post∗

θ(X) is

FUDFA representable. The result for systems with several queues is more restrictive. Theorem (Multi-queue systems) For every set of configurations X and cycle θ, the set Post∗

θ(X) is

FUDFA representable iff there do not exist i and j s.t θ|i and θ|j are counting.

Verifying distributed systems with unbounded channels R´ egis Gascon & ´ Eric Madelaine