StrataGEM: A Generic Petri Net Verification Framework

34
StrataGEM: A Generic Petri Net Verification Framework Edmundo López Bóbeda, Maximilien Colange, Didier Buchs Wednesday, June 25th 2014 - Tunis, Tunisia Petri nets 2014

description

Presentation given at the International Conference on Application and Theory of Petri Nets and Concurrency 2014, in Tunis, Tunisia. You can find the paper manuscript at http://edmundo.lopezbobeda.net/publications .

Transcript of StrataGEM: A Generic Petri Net Verification Framework

Page 1: StrataGEM: A Generic Petri Net Verification Framework

StrataGEM: A Generic Petri Net

Verification FrameworkEdmundo López Bóbeda, Maximilien Colange, Didier Buchs

Wednesday, June 25th 2014 - Tunis, Tunisia

Petri nets 2014

Page 2: StrataGEM: A Generic Petri Net Verification Framework

Stratagem

Model checker

Photo: FastJack/Flickr" http://www.flickr.com/photos/fastjack/282707058/

Prototyping lab

Page 3: StrataGEM: A Generic Petri Net Verification Framework

Goal

Your formalism Your Model checker

Page 4: StrataGEM: A Generic Petri Net Verification Framework

Creating your model checker: A Checklist

• Semantics

• Description of the computation

• Optimizations

Page 5: StrataGEM: A Generic Petri Net Verification Framework

HowTerms

Strategies Rewrite rules

Page 6: StrataGEM: A Generic Petri Net Verification Framework

Semantics A running example

R

Y

G

t3t1

t2

Page 7: StrataGEM: A Generic Petri Net Verification Framework

R(suc(0), Y(0, G(0, empty)))

"

"

"

"

Representing a stateR

Y

G

t3t1

t2

Term = State

Page 8: StrataGEM: A Generic Petri Net Verification Framework

R(suc(0), Y(0, G(0, empty)))

iArc = R(suc(x), p) ↝ R(x, p)

oArc = G(x, p) ↝ G(suc(x), p)

"

"

Representing arcsR

Y

G

t3t1

t2Rewrite rules

Page 9: StrataGEM: A Generic Petri Net Verification Framework

Representing transitionsR

Y

G

t3t1

t2

R(suc(0), Y(0, G(0, empty)))

iArc = R(suc(x), p) ↝ R(x, p)

oArc = G(x, p) ↝ G(suc(x), p)

t1 = ???

"

Page 10: StrataGEM: A Generic Petri Net Verification Framework

Strategies in a nutshell

Strategies Rewrite rules

Terms

Page 11: StrataGEM: A Generic Petri Net Verification Framework

Strategies in a nutshell

Strategies

Rewrite rules

Page 12: StrataGEM: A Generic Petri Net Verification Framework

Basic strategy semantics

• Basic strategy (A list of rewrite rules)

• Application to root term only

• The first applicable rule is applied

• Otherwise, fail

Page 13: StrataGEM: A Generic Petri Net Verification Framework

Other useful strategies• Identity[t] = t

• Fail[t], always fails

• (S1 orElse S2)[t] = S1[t] or S2[t], if S1[t] fails

• Conditional application of strategies

• (S1 andThen S2)[t] = S2[S1[t]]

• Sequential composition of strategies

• Subtermk(S)[f(t1, …, tn)] = f(t1, …, S(tk), …, tn)

• Apply strategy to subterm

Page 14: StrataGEM: A Generic Petri Net Verification Framework

Representing transitionsR(suc(0), Y(0, G(0, empty)))

iArc = R(suc(x), p) ↝ R(x, p)

oArc = G(x, p) ↝ G(suc(x), p)

t1 = Once(iArc) andThen Once(oArc)

Once(S) = S orElse Subterm2(Once(S)

R

Y

G

t3t1

t2

Page 15: StrataGEM: A Generic Petri Net Verification Framework

Creating your model checker: A Checklist

• Semantics

• Description of the computation

• Optimizations

Page 16: StrataGEM: A Generic Petri Net Verification Framework

t1 = Once(iArc) andThen Once(oArc)

t2 = … ; t3 = …

CalcSS = ???

"

"

Description of the computation

R

Y

G

t3t1

t2

Page 17: StrataGEM: A Generic Petri Net Verification Framework

Strategies extended• Natural extension

• S[{t1, …, tn}] = {S[t1], …, S[tn]}

• Set strategies

• Union(S1, S2)[T] = S1[T] U S2[T], if both succeed

• Fixpoint(S)[T] = μT.S[T]

Page 18: StrataGEM: A Generic Petri Net Verification Framework

t1 = Once(iArc) andThen Once(oArc)

t2 = … ; t3 = …

CalcSS = Fixpoint(

Union(

Try(t1), Try(t2), Try(t3), Identity))

Try(S) = S orElse Identity

Description of the computation

R

Y

G

t3t1

t2

Page 19: StrataGEM: A Generic Petri Net Verification Framework

Creating your model checker: A Checklist

• Semantics

• Description of the computation

• Optimizations

Page 20: StrataGEM: A Generic Petri Net Verification Framework

Decision Diagram Operations

Trans. Trans.

State Space

Verification

Optim 1

Your formalism

Oth

er m

odel

che

cker

s

Page 21: StrataGEM: A Generic Petri Net Verification Framework

Decision Diagram Operations

Trans. Trans. Trans.

State Space

Verification

Optim 1

Optim 2

Your formalism

Oth

er m

odel

che

cker

s

Page 22: StrataGEM: A Generic Petri Net Verification Framework

Decision Diagram Operations

Trans. Trans. Trans.

State Space

Verification

Optim 1

Optim 2

Your formalism

Oth

er m

odel

che

cker

s

Page 23: StrataGEM: A Generic Petri Net Verification Framework

Engine

Decision Diagram Operations

Translation

Stra

tage

mSemantics, State Space,

OptimizationState

SpaceVerification Optim 1 Optim 2

Your formalism

=

Page 24: StrataGEM: A Generic Petri Net Verification Framework

Engine

Decision Diagram Operations

Translation

Stra

tage

mSemantics, State Space,

Optimization

Your formalism

Translation

Page 25: StrataGEM: A Generic Petri Net Verification Framework

Saturation: for connaisseurs• Well known DD optimization

technique

• Apply local fixpoint in order to reduce peak effect

R

Y

G

t3t1

t2Satn(S) = (Subtermn(Satn(S)) orElse FixPoint(S)) andThen Fixpoint(S)

Page 26: StrataGEM: A Generic Petri Net Verification Framework

Saturation: for connaisseursR

Y

G

t3t1

t2

Satn(S) = (Subtermn(Satn(S)) orElse FixPoint(S)) andThen Fixpoint(S)

R(1, Y(0, G(0, empty )))

Page 27: StrataGEM: A Generic Petri Net Verification Framework

Creating your model checker: A Checklist

• Semantics

• Description of the computation

• Optimizations

Page 28: StrataGEM: A Generic Petri Net Verification Framework

Practical results

• Stratagem has been used to implement:

• Optimizations: Saturation, Clustering, Anonymization, etc.

• Other formalisms: Divine formalism

Page 29: StrataGEM: A Generic Petri Net Verification Framework

Practical results• Comparison with PNXDD

• Symbolic model checking

• Similar techniques (topological, decision diagrams)

• Common model database (model checking contest)

• 2nd best tool for state space calculation last year

Page 30: StrataGEM: A Generic Petri Net Verification Framework

Practical resultsRa

tio ti

me

PNXD

D/ti

me

Stra

tage

m

0

0.35

0.7

1.05

1.4

Model size (scale parameter)

5 10 20 50 100 200

Erathostenes Railroad Shared Mem

Page 31: StrataGEM: A Generic Petri Net Verification Framework

Implementation

• 3700 lines of Scala

• Available for download http://sourceforge.net/projects/stratagem-mc/

• Source code available on Github

• Platform independent

Page 32: StrataGEM: A Generic Petri Net Verification Framework

Future work

• Implement CTL verification

• Implement other translations (Algebraic Petri nets)

• Implement other optimization techniques

Page 33: StrataGEM: A Generic Petri Net Verification Framework

Thank you! Any questions?

Page 34: StrataGEM: A Generic Petri Net Verification Framework

The paper for this presentation can be found at: http://

edmundo.lopezbobeda.net/publications