regular model checking made simple and efficient p. abdulla, b. jonsson, m. nilsson and j. d’orso...

42
Regular Model Regular Model Checking Made Checking Made Simple and Simple and Efficient Efficient P. Abdulla, B. Jonsson, M. P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Nilsson and J. d’Orso Uppsala University Uppsala University

Upload: janel-wells

Post on 17-Jan-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Regular Model Checking Regular Model Checking Made Simple and Made Simple and

EfficientEfficient

Regular Model Checking Regular Model Checking Made Simple and Made Simple and

EfficientEfficient

P. Abdulla, B. Jonsson, M. Nilsson P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orsoand J. d’Orso

Uppsala UniversityUppsala University

Page 2: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Presentation Overview• Aim

• Regular Model Checking

• Subset Construction

• Construction by Matching

• Conclusions

Page 3: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Aim• Parameterized systems• Counters• Stacks• queues

Can all be represented by regular languagesAnd regular relations.

Page 4: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Regular Model Checking

Represent configurations/transition relationswith finite automata.

(n,n)

(n,t)(t,n)

(n,n)

Example: moving a token to the right

Page 5: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Regular Model Checking

The transitive closure:

(n,n)

(n,t)(t,n)

(n,n)

Example: moving a token arbitrarily to the right

(n,n)

Page 6: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Regular Model Checking (cont.)

• Problem: how do we compute transitive closures ?

• Solution: subset construction ([BJNT00])

• First step: use strings to represent composition (“columns”)

Successiveruns

One column

Page 7: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Regular Model Checking (cont.)

Page 8: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Regular Model Checking (cont.)

Page 9: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Regular Model Checking (cont.)

Page 10: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Subset Construction (cont.)

• Problem: previous automaton is infinite !• Second idea: apply subset construction• With regular sets

Page 11: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Subset Construction (cont.)

q0+

(n,n)

(n,t)(t,n)

(n,n)

Relation R:

Construction:

(n,n)

q0

q1

q2

Page 12: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Subset Construction (cont.)

q0+

(n,n)

(n,t)(t,n)

(n,n)

Relation R:

Construction:

q1 ⋅q0*

q2

(n,n)

(t,n)

(n,t)

(n,n)

Page 13: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Subset Construction (cont.)

q0+

(n,n)

(n,t)(t,n)

(n,n)

Relation R:

Construction:

q1 ⋅q0*

q2

q2 ⋅q1 ⋅q0*

q2 ⋅q2

(n,n)

(n,n) (n,n)

(n,n)(t,n)

(n,t) (n,t)

Page 14: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Subset Construction (cont.)

q0+

(n,n)

(n,t)(t,n)

(n,n)

Relation R:

Construction:

q1 ⋅q0*

q2

q2 ⋅q1 ⋅q0*

q2 ⋅q2

(n,n)

(t,n)

(n,t) (n,t)

(n,n) (n,n)

(n,n)(n,n)

Page 15: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Subset Construction (cont.)

q0+

(n,n)

(n,t)(t,n)

(n,n)

Relation R:

Construction:

q1 ⋅q0*

q2

q2 ⋅q1 ⋅q0*

q2 ⋅q2

(n,n)

(t,n)

(n,t) (n,t)

(n,n) (n,n)

(n,n)(n,n)

Page 16: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Subset Construction (cont.)

• Automaton built is deterministic

• Computing the image of a set is expensive

• For many examples, sets obtained are simple

Practical problems:

Page 17: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Our Contribution

• The algorithm uses only local information, not global reasoning (bisimulations).

Compared with [DLS01]:

Page 18: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Our Contribution

• Construction does not rely on determinism

• No image computation, but simple “matching”

Compared with [BJNT00]:

Page 19: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

An Example

L 1 2 3 R

(e,e) (e,e)

(a,e) (b,a) (d,b) (e,d)

Page 20: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

An Example

L 1 2 3 R

(e,e) (e,e)

(a,e) (b,a) (d,b) (e,d)

Compose automaton twice:

(e,e)(e,e)

(a,e) (b,e) (e,b) (e,d)(d,a)LL

1L

21

32

R3

RR

Page 21: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

An Example

L 1 2 3 R

(e,e) (e,e)

(a,e) (b,a) (d,b) (e,d)

(e,e) (e,e)

(a,e) (b,e) (e,b) (e,d)(d,a)LL

1L

21

32

R3

RR

Page 22: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

An Example

L 1 2 3 R

(e,e) (e,e)

(a,e) (b,a) (d,b) (e,d)

(b,e)

(d,a)

(e,b)

Page 23: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

An Example

L 1 2 3 R

(e,e) (e,e)

(a,e) (b,a) (d,b) (e,d)

(b,e)

(d,a)

(e,b)

(d,e) (e,a)

Page 24: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

An Example

L 1 2 3 R

(e,e) (e,e)

(a,e) (b,a) (d,b) (e,d)

(b,e)

(d,a)

(e,b)

(d,e) (e,a)

(e,e)

Page 25: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Construction by Matching

Use sets of form:

e1 ⋅e2 ⋅L ⋅epWith each sub-expression being one of:

q{ }(1)

(2)

L+

(3)

R+

Page 26: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Construction by Matching (cont.)

(e,e)(e,e)

(a,e) (b,e) (e,b) (e,d)(d,a)LL

1L

21

32

R3

RR

Examples of sets:

L+

2{ } 1{ }

R+ 3{ }

Page 27: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Construction by Matching (cont.)

Properties of such sets:(1) Can be made canonical representation (2) Closed under an operation similar to concatenation(3) Induce equivalence relation

Page 28: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Property (1)

Canonicity: always take the largest set !

q ⋅q∈ q+ ⋅q+ ⊂q+

Page 29: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Property (2)

Define operator * as follows:

e1∗e2 =e1e1 ⋅e2

⎧ ⎨ ⎩ otherwise

if

e1 = e2 = q+

Page 30: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Property (2)

Using the * operator:

L+ 1 L+ L+

L+

L+ * L+ 1 * L+

1 * L+

(a,e) (e,e)

(a,e)

(a,e)

Page 31: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Property (3)

When can we merge states ?

w1

w2

w2

w1

1

2

1/2

Page 32: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Property (3) (cont.)

Does our equivalence relation satisfy this ?Yes !

w1

w2

w2

w1

≈ LL

L

LL

q

q1q2

q1q2q

q

Page 33: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Property (3) (cont.)

w1

w2

w2

w1

≈LL

L

L

q1

q2

q1

q2q1

Property needs to be symmetric !

Page 34: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

The Algorithm

• Initialization: replace copying states “q” with “q+”, leave the rest;

• Step k+1: for a transition of step k and a transition of step 0, if “match” then add the combined transition;

• Stop: when reach fixed point.

Page 35: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Example

L 1 2 3 R

(e,e) (e,e)

(a,e) (b,a) (d,b) (e,d)

Run the initialization step.

Page 36: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Example

L+ 1 2 3 R+

(e,e) (e,e)

(a,e) (b,a) (d,b) (e,d)

Page 37: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Example

L+ 1 2 3 R+

(e,e) (e,e)

(a,e) (b,a) (d,b) (e,d)

Match transitions in red.

Page 38: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Example

L+ 1 2 3 R+

(e,e) (e,e)

(a,e) (b,a) (d,b) (e,d)

1 L+

(a,e)

Page 39: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Example

L+ 1 2 3 R+

(e,e) (e,e)

(a,e) (b,a) (d,b) (e,d)

1 L+

(a,e)

Page 40: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Example

L+ 1 2 3 R+

(e,e) (e,e)

(a,e) (b,a) (d,b) (e,d)

1 L+

(a,e)

2 1(b,e)

Page 41: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

ResultsAlgorithm Subset

ConstructionMatching Speedup

Dijkstra 435s 39s 11.2

Szymanski 278s 178s 1.5

Termination detection

47s 22s 2.1

Ticket 17s 20s 0.85

Page 42: Regular Model Checking Made Simple and Efficient P. Abdulla, B. Jonsson, M. Nilsson and J. d’Orso Uppsala University

Future Work

• Extend to other systems e.g. trees, push-down systems, graphs, etc…

• Experiment underlying data structure Graphical interface for this tool