directed model checking with distance-preserving abstractions · 2019. 11. 26. · directed model...

35
Directed Model Checking with Distance-Preserving Abstractions Bernd Finkbeiner Universität des Saarlandes joint work with Klaus Dräger and Andreas Podelski

Upload: others

Post on 03-Mar-2021

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

Directed Model Checkingwith Distance-Preserving Abstractions

Bernd FinkbeinerUniversität des Saarlandes

joint work withKlaus Dräger and Andreas Podelski

Page 2: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

2

Model Checking

Verification by exhaustive state space explorationFundamental complexity-theoretic barrierState space is exponential in number of components

Error detection by searchHope despite state space explosionA good search strategy is likely to explore onlya small portion of the state space

Page 3: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

3

Search Strategies

Standard Model Checking Depth-first search Breadth-first search

Directed Model CheckingBest-first search A*

h h

g

Page 4: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

4

Heuristics

User-provided hintsPattern databasesProperty-specific heuristics

Structural heuristicsHamming DistanceFSM heuristic

interactive

automatic

Page 5: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

5

User-Provided Hints

Example: Biphase Mark Protocol in UPPAAL

in 1 0 0 0 1

mark subcell

code subcell

sampling distance

G. Behrmann, A. Fehnker. Th. Hune, K. Larsen, P. Pettersson, J. RomijnEfficient Guiding Towards Cost-Optimality in UPPAAL, 2005

User-provided hint „in=1“: UPPAAL explores 50% fewer states.

Page 6: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

6

Abstraction-based Heuristics

Model checker performs two separate state space traversals:

Exhaustively traverse the state space of the abstract system→ generate pattern database

Selectively traverse the state space of the concrete systembased on pattern database

Example: ArbitertreeAbstraction by ignoring irrelevant variables (as determined by user)NuSMV without heuristic: tree with 15 nodesNuSMV with heuristic: tree with 19 nodes

Estimate of error distance in concrete system =Actual error distance in abstract system

K. Quian, A. NymeyerGuided Invariant Model Checking Based on Abstraction and Symbolic Pattern Databases, 2004

Page 7: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

7

The FSM Heuristic

SPIN without heuristic: 14 philosophersHSF-SPIN with heuristic: 254 philosophers

f1?, f2?

f1! f2!

f2? f1?

f2! f1!p1

p2 p3

f2?, f3?

f2! f3!

f3? f2?

f3! f2!p1

p2 p3

h(p1,p1,p1,p1,p1)=5,h(p2,p1,p1,p1,p1)=4, …

A. Lluch Lafuente,Directed Search for the Verification of Communication Protocols, 2003

1 1

0000

Estimate = sum of local error distances

Example: Dining Philosophers

Page 8: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

8

FSM Heuristic applied to Controllers

Explored states (best-first) Error trace length

a? a? a? a? a? a?b!

b?

2 1 1 1 1 1 1

21

1

FSM heuristic ignores synchronization.

Page 9: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

9

Spectrum

User-provided estimate functions + highly accurate - require user knowledge about system and error

Automatic heuristics like FSM + automatic - not very accurate

Can we automatically compute a good estimate?

Page 10: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

10

Trade-Off

If the estimate is to be very accurate,then its computation is expensivestate space explosionduring computation of the heuristic

If the estimate is very inaccurate,then the search based on the estimate is expensive

state space explosionduring search

Is there a sweet spot in this trade-off?

Page 11: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

11

Approach

Pattern Database obtained by abstractionWe construct the abstract state space by mergingstates into equivalence classes.

Incremental bounded abstractionWe fix a bound N on the abstract state space.Every composition of two components is followed byan abstraction step that ensures that the size staysbelow the bound.

Approach can be scaledto any any desired degree of accuracy.

Page 12: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

12

PerformanceBest-first search

A*

Page 13: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

13

Parameters

AbstractionWhich states should be merged?

Composition strategyIn which order should the components becomposed?

Abstraction bound NHow large may the state space grow before statesneed to be merged?

Page 14: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

14

Language-Preserving Abstraction

Ideally, the abstraction would belanguage-preserving.

?a ?a ?a

?b ?b ?c

!a

!c

Page 15: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

15

Distance-Preserving Abstraction

?a ?a ?a

?b ?b ?c

!a

!b,!c

At least, the abstraction should bedistance-preserving.

?a

?a

Page 16: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

16

Bounded Abstraction

Distance-preservingabstraction

+ linear cost in # processes- ignores synchronization

Language-preservingabstraction

- exponential cost in # processes+ 100% accurate

We refine the abstraction untilthe fixed bound N is reached.

linear cost in # processes, accuracy depends on N

Page 17: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

17

Refining the Abstraction

?d ?a ?a

?b ?b ?c

!a

!c

!

!

!

!

Page 18: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

18

Refining abstraction forstates with high error distance

?d ?a ?a

?b ?b ?c

!a

!c

!

!

!

!

Page 19: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

19

Refining the Abstraction

?d ?a ?a

?b ?b ?c

!a

!c

!

!

!

!

Page 20: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

20

Refining abstraction forstates with low error distance

Refinement is most helpful for stateswith low error distance.

?d ?a ?a

?b ?b ?c

!a

!c

! !

Page 21: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

21

Parameter 1: Abstraction

Data based on modelchecking runs on the„Towers of Hanoi“benchmark.

Page 22: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

22

Parameter 2: Composition Strategy

Composition strategy determines the order in whichthe components are composed.

Page 23: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

23

Default Composition Strategy

Default Composition strategycomposes components in syntactic order

Page 24: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

24

Ranking-based Composition Strategy

Ranking-based Composition strategy composescomponents according to synchronization

in the proximity of the error

Page 25: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

25

Ranking-based Composition Strategy

Ranking-based Composition strategy composescomponents according to synchronization

in the proximity of the error

Page 26: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

26

Ranking-based Composition Strategy

Ranking-based Composition strategy composescomponents according to synchronization

in the proximity of the error

Page 27: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

27

Ranking-based Composition Strategy

Ranking-based Composition strategy composescomponents according to synchronization

in the proximity of the error

Page 28: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

28

Ranking-based Composition Strategy

Ranking-based Composition strategy composescomponents according to synchronization

in the proximity of the error

Page 29: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

29

Ranking-based Composition Strategy

Ranking-based Composition strategy composescomponents according to synchronization

in the proximity of the error

Page 30: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

30

Ranking-based Composition Strategy

Ranking-based Composition strategy composescomponents according to synchronization

in the proximity of the error

Page 31: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

31

Ranking-based Composition Strategy

Ranking-based Composition strategy composescomponents according to synchronization

in the proximity of the error

Page 32: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

32

Ranking-based Composition Strategy

Ranking-based Composition strategy composescomponents according to synchronization

in the proximity of the error

Page 33: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

33

Parameter 2: Composition Strategy

Data based on modelchecking runs on the„Arbiter Tree“benchmark with 8processes.

Page 34: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

34

Parameter 3: Abstraction Bound

Data based on modelchecking runs withrandomly generatedsystems with 8processes

State-spaceexplosionduring search

State-spaceexplosionduringcomputationof estimate

Sweet spot

Page 35: Directed Model Checking with Distance-Preserving Abstractions · 2019. 11. 26. · Directed model checking can dramatically speed up model checking There is a trade-off between abstraction

35

Conclusions

Directed model checking can dramatically speed upmodel checkingThere is a trade-off between abstraction and searchSimple heuristics like FSM represent one choice,but not necessarily a good oneThe trade-off appears to have a sweet spot

Open question:How can we systematically find the sweet spot?