30
Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste

Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste

Embed Size (px)

Citation preview

Page 1: Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste

Syntax-driven partitioning for model-checking of Esterel

programs

Eric Vecchié - INRIA Aoste

Page 2: Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste

Motivation

• Build the Reachable State Space…

• …following the syntaxabort P when S;Q

• Reachable State Space allows– Model-checking– Code optimization– Test sequence generation– …

Page 3: Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste

R ← INITnew ← Rwhile ( new ≠ ø ) do new ← Image(new) \ R R ← R U newend while

Reachable State Space

• Breadth First Search algorithm

• Symbolic methods (BDDs)

Page 4: Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste

What is done

Page 5: Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste

Size of Computations

Solution : Rely on program structural syntax

BDDsize

states reached

non-saturatedstates set

Page 6: Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste

What we do

Page 7: Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste

Example : Wristwatch

display

watch

time_setalarm_set

stopwatch

Page 8: Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste

Example : Wristwatch

Page 9: Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste

Example : Wristwatch

Page 10: Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste

How to partition ?

• According to program blocks

– Separated by frontiers– Synthesized from signal receptions

• Build a control flow graph

– Encoding frontiers– Guiding the RSS computation

Page 11: Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste

Preemption / if-then-else

P

Q

P1 P2

Q

S

S

Page 12: Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste

abort

Pwhen S;present T then

Q1else

Q2end;

R

P

Q2

R

Q1

Partitioning Example

Page 13: Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste

Parallel Constructs

• Avoid cartesian product

– {P1, P2} {Q1, Q2}

• Use signal information

||

P1 Q1

P2 Q2

Page 14: Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste

Parallel and signals||

P1 Q1

R1

P2

Q2

Q3 R2

S1

S2

Page 15: Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste

• Only increasing

Avoid the cross product

• Can be not satisfying on loops– …but on rare cases

Parallel and signals

Page 16: Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste

Loops

PQ

Page 17: Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste

pause

pause

loop end||

abort

when S

present T then

else

end

;

Control Flow Graph construction

|| pausepausepause pause;

Page 18: Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste

Symbolic methods

• Boolean functions

• Sets (in a finite universe)

• Partitioned Transition Relations

Binary Decision Diagrams (BDDs) allow to represent :

Page 19: Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste

Cofactoring

Given a domain D, reduce the BDD of a function f :f↑D(x) = f(x) if x belongs to D

• Cofactoring is used 2 ways

– Reduce the domain according to our frontiers

– Transition function applied on new states

Page 20: Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste

Experiments

• A medium-sized design : sequencer

• A big design : cabin

Page 21: Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste

BDD sizes in “sequencer”

Page 22: Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste

A big design : “cabin”

Default method Partitioning

534 states 135 441 875 states

3 steps (11.85s) 123 steps (35h40)

Page 23: Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste

Conclusion

Program verification following program syntax

• Preemptions, if-then-else

• Signals in parallels

Smaller intermediate BDDs

• Lighter transition functions

• Lighter image computations

Less memory required

Page 24: Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste

The End

Page 25: Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste

Motivation

• Model-checking

• Code optimization

• Test sequence generation

• …

Reachable State Space (RSS)

Page 26: Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste

R ← INITnew ← Rwhile ( new ≠ ø ) do new ← Image(new) \ R R ← R U newend while

Reachable State Space (RSS)

• Breadth First Search algorithm

• Symbolic methods (BDDs)

Page 27: Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste

Introduction

• Esterel

• Synchronous reactive structural

programming– sequence, if-then-else

– Parallelism, preemption

• Circuit translation (model-checking level)

Page 28: Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste
Page 29: Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste
Page 30: Syntax-driven partitioning for model-checking of Esterel programs Eric Vecchié - INRIA Aoste

Partitioning - detail