We propose a novel approach to prototype and create symbolic model-checkers. Our approach focuses on providing a high level abstraction above Decision Diagrams. It allows the model-checker creator to start from a high level formal semantics and to define an efficient Decision Diagram based model-checker.
Towards a General Approach for Symbolic Model-Checker Prototyping
1. Towards a General
Approach for Symbolic
Model-Checker Prototyping
Edmundo LĂłpez BĂłbeda, Maximilien Colange, Didier Buchs
Wednesday, September 24th 2014 - Enschede, Netherlands
1
11. Your awesome DSL
Existing Symbolic
Model checker
4
}Too much
work!
Translation
12. Your awesome DSL
Existing Symbolic
Model checker
4
}Too much
work!
Translation
high level data structures
13. Your awesome DSL
Existing Symbolic
Model checker
4
}Too much
work!
Translation
high level data structures
custom operations
14. Your awesome DSL
Existing Symbolic
Model checker
4
}Too much
work!
Translation
high level data structures
custom operations
rich data types
15. Your awesome DSL
Existing Symbolic
Model checker
4
}Too much
work!
Translation
high level data structures
custom operations
rich data types
low level
16. Your awesome DSL
Existing Symbolic
Model checker
4
}Too much
work!
Translation
high level data structures
custom operations
rich data types
low level
fixed primitives operations
17. Your awesome DSL
Abstract semantics
Translation
Set rewriting
Translation
Decision diagrams
5
18. Your awesome DSL
Abstract semantics
approach
{Our Translation Translation
Set rewriting
Decision diagrams
5
19. Your awesome DSL
Abstract semantics
approach
{Our Translation Translation
Set rewriting
Decision diagrams
5
}Our contribution
20. Abstract semantics
In context
6
Your awesome DSL
Abstract semantics
Translation
Set rewriting
Translation
Decision diagrams
21. Abstract semantics
In context
⢠High level representation
6
Your awesome DSL
Abstract semantics
Translation
Set rewriting
Translation
Decision diagrams
22. Abstract semantics
In context
⢠High level representation
⢠Suitable for humans
6
Your awesome DSL
Abstract semantics
Translation
Set rewriting
Translation
Decision diagrams
25. Abstract semantics
Variable assignation
⢠Let s be a state of a system
⢠s = {A = k1, B = k2, âŚ}
7
s
hB := c, si ! s[B = k/B = c]
26. Abstract semantics
Variable assignation
⢠Let s be a state of a system
⢠s = {A = k1, B = k2, âŚ}
⢠k, k1, k2, c â í
7
s
hB := c, si ! s[B = k/B = c]
27. Abstract semantics
Variable assignation
⢠Let s be a state of a system
⢠s = {A = k1, B = k2, âŚ}
⢠k, k1, k2, c â í
⢠A, B, etc variable names
7
s
hB := c, si ! s[B = k/B = c]
28. Set rewriting
In context
8
Your awesome DSL
Abstract semantics
Translation
Set rewriting
Translation
Decision diagrams
29. Set rewriting
In context
⢠Rewriting and strategies
8
Your awesome DSL
Abstract semantics
Translation
Set rewriting
Translation
Decision diagrams
30. Set rewriting
In context
⢠Rewriting and strategies
⢠Good semantic framework
[MartĂ-Oliet & Meseguer 1993]
8
Your awesome DSL
Abstract semantics
Translation
Set rewriting
Translation
Decision diagrams
31. Set rewriting
In context
⢠Rewriting and strategies
⢠Good semantic framework
[MartĂ-Oliet & Meseguer 1993]
⢠Operational semantics
8
Your awesome DSL
Abstract semantics
Translation
Set rewriting
Translation
Decision diagrams
32. Set rewriting
A state
⢠Variables
⢠var(A, 0, var(B, 2, var(C, 3, empty)))
9
45. Rewriting strategies
Basic strategy
⢠Basic strategy (A list of rewrite rules)
⢠Application to root term only
13
46. Rewriting strategies
Basic strategy
⢠Basic strategy (A list of rewrite rules)
⢠Application to root term only
⢠The first applicable rule is applied
13
47. Rewriting strategies
Basic strategy
⢠Basic strategy (A list of rewrite rules)
⢠Application to root term only
⢠The first applicable rule is applied
⢠Otherwise, fail
13
59. Set rewriting
Operational semantics / Variable Assignation
s
hB := c, si ! s[B = k/B = c]
assignK = { var(B, $x, $s) ⤳ var(B, c, $s) }
applyToB(S) = S orElse (Subterm3(applyToB(S)))
transition = applyToB(assignK)
16
60. Set rewriting
Set extension
⢠In practice
⢠Strategies and rewrite rules applied to sets of
terms
⢠Allow also to describe model checking
computation
17
66. Set rewriting
Computing state space
19
s
hB := c, si ! s[B = k/B = c]
transition1 = âŚ
semantic formula 2 transition2 = âŚ
67. Set rewriting
Computing state space
19
s
hB := c, si ! s[B = k/B = c]
transition1 = âŚ
semantic formula 2 transition2 = âŚ
âŚ
68. Set rewriting
Computing state space
19
s
hB := c, si ! s[B = k/B = c]
transition1 = âŚ
semantic formula 2 transition2 = âŚ
âŚ
semantic formula n transitionn = âŚ
69. Set rewriting
Computing state space
19
s
hB := c, si ! s[B = k/B = c]
transition1 = âŚ
semantic formula 2 transition2 = âŚ
âŚ
semantic formula n transitionn = âŚ
calculateSS = Fixpoint(Union(transition1, transition2, âŚ, transitionn))
72. Set rewriting
Saturation: For connaisseurs
⢠Well known DD optimization technique
⢠Apply local fixpoint in order to reduce peak effect
20
73. Set rewriting
Saturation: For connaisseurs
⢠Well known DD optimization technique
⢠Apply local fixpoint in order to reduce peak effect
⢠Satn(S) =
(Subtermn(Satn(S)) orElse FixPoint(S)) andThen Fixpoint(S)
20
74. Set rewriting
Saturation: For connaisseurs
⢠Well known DD optimization technique
⢠Apply local fixpoint in order to reduce peak effect
⢠Satn(S) =
(Subtermn(Satn(S)) orElse FixPoint(S)) andThen Fixpoint(S)
var(A, 1, var(B, 2, var(C, 0, empty )))
20
75. Set rewriting
Saturation: For connaisseurs
⢠Well known DD optimization technique
⢠Apply local fixpoint in order to reduce peak effect
⢠Satn(S) =
(Subtermn(Satn(S)) orElse FixPoint(S)) andThen Fixpoint(S)
var(A, 1, var(B, 2, var(C, 0, empty )))
20
76. Set rewriting
Saturation: For connaisseurs
⢠Well known DD optimization technique
⢠Apply local fixpoint in order to reduce peak effect
⢠Satn(S) =
(Subtermn(Satn(S)) orElse FixPoint(S)) andThen Fixpoint(S)
var(A, 1, var(B, 2, var(C, 0, empty )))
20
77. Set rewriting
Saturation: For connaisseurs
⢠Well known DD optimization technique
⢠Apply local fixpoint in order to reduce peak effect
⢠Satn(S) =
(Subtermn(Satn(S)) orElse FixPoint(S)) andThen Fixpoint(S)
var(A, 1, var(B, 2, var(C, 0, empty )))
20
78. Set rewriting
Saturation: For connaisseurs
⢠Well known DD optimization technique
⢠Apply local fixpoint in order to reduce peak effect
⢠Satn(S) =
(Subtermn(Satn(S)) orElse FixPoint(S)) andThen Fixpoint(S)
var(A, 1, var(B, 2, var(C, 0, empty )))
20
79. Set rewriting
Saturation: For connaisseurs
⢠Well known DD optimization technique
⢠Apply local fixpoint in order to reduce peak effect
⢠Satn(S) =
(Subtermn(Satn(S)) orElse FixPoint(S)) andThen Fixpoint(S)
var(A, 1, var(B, 2, var(C, 0, empty )))
20
80. Set rewriting
Saturation: For connaisseurs
⢠Well known DD optimization technique
⢠Apply local fixpoint in order to reduce peak effect
⢠Satn(S) =
(Subtermn(Satn(S)) orElse FixPoint(S)) andThen Fixpoint(S)
var(A, 1, var(B, 2, var(C, 0, empty )))
20
81. Set rewriting
Saturation: For connaisseurs
⢠Well known DD optimization technique
⢠Apply local fixpoint in order to reduce peak effect
⢠Satn(S) =
(Subtermn(Satn(S)) orElse FixPoint(S)) andThen Fixpoint(S)
var(A, 1, var(B, 2, var(C, 0, empty )))
20
82. Set rewriting
Saturation: For connaisseurs
⢠Well known DD optimization technique
⢠Apply local fixpoint in order to reduce peak effect
⢠Satn(S) =
(Subtermn(Satn(S)) orElse FixPoint(S)) andThen Fixpoint(S)
var(A, 1, var(B, 2, var(C, 0, empty )))
20
83. Set rewriting
Saturation: For connaisseurs
⢠Well known DD optimization technique
⢠Apply local fixpoint in order to reduce peak effect
⢠Satn(S) =
(Subtermn(Satn(S)) orElse FixPoint(S)) andThen Fixpoint(S)
var(A, 1, var(B, 2, var(C, 0, empty )))
20
84. Set rewriting
Saturation: For connaisseurs
⢠Well known DD optimization technique
⢠Apply local fixpoint in order to reduce peak effect
⢠Satn(S) =
(Subtermn(Satn(S)) orElse FixPoint(S)) andThen Fixpoint(S)
var(A, 1, var(B, 2, var(C, 0, empty )))
20
85. Decision Diagrams
In context
⢠Fast
⢠Large state spaces
⢠Suitable for model checking
21
Your awesome DSL
Abstract semantics
Translation
Set rewriting
Translation
Decision diagrams
86. The idea is that you never have
to think in terms of DD againâŚ
so we wonât talk about them :-)
22
88. Implementation
⢠We have a tool that implements the approach
⢠Stratagem http://sourceforge.net/projects/stratagem-mc/
(written in Java and Scala)
23
89. Implementation
⢠We have a tool that implements the approach
⢠Stratagem http://sourceforge.net/projects/stratagem-mc/
(written in Java and Scala)
⢠~3700 lines of Scala code (DD and Strategies engine)
23
90. Implementation
⢠We have a tool that implements the approach
⢠Stratagem http://sourceforge.net/projects/stratagem-mc/
(written in Java and Scala)
⢠~3700 lines of Scala code (DD and Strategies engine)
⢠Java code generated from model (Eclipse EMF, XText)
23
91. Implementation
⢠We have a tool that implements the approach
⢠Stratagem http://sourceforge.net/projects/stratagem-mc/
(written in Java and Scala)
⢠~3700 lines of Scala code (DD and Strategies engine)
⢠Java code generated from model (Eclipse EMF, XText)
⢠Implemented translation for Petri nets
23
92. Implementation
⢠We have a tool that implements the approach
⢠Stratagem http://sourceforge.net/projects/stratagem-mc/
(written in Java and Scala)
⢠~3700 lines of Scala code (DD and Strategies engine)
⢠Java code generated from model (Eclipse EMF, XText)
⢠Implemented translation for Petri nets
⢠Implemented translation for SPIN-like formalism
23
94. Practical results
Presentation
⢠Petri nets taken from the Model checking contest @
PETRI NETS 2014 [Kordon et al. 2014]
24
95. Practical results
Presentation
⢠Petri nets taken from the Model checking contest @
PETRI NETS 2014 [Kordon et al. 2014]
⢠Marcie [Heiner et al. 2013] was the best model
checker for the state space category
24
96. Practical results
Presentation
⢠Petri nets taken from the Model checking contest @
PETRI NETS 2014 [Kordon et al. 2014]
⢠Marcie [Heiner et al. 2013] was the best model
checker for the state space category
⢠Since then we only improved the translation
24
99. Practical results
Kanban problem
⢠Small Petri net
⢠16 places & 16 transitions, marking changes with
scale parameter
25
100. Practical results
Kanban problem
⢠Small Petri net
⢠16 places & 16 transitions, marking changes with
scale parameter
⢠State space for scale parameter 100
25
101. Practical results
Kanban problem
⢠Small Petri net
⢠16 places & 16 transitions, marking changes with
scale parameter
⢠State space for scale parameter 100
⢠1.7263 ¡1019 states
25
102. Practical results
Kanban problem
Marcie Stratagem
10 20 50 100
26
100
Time in seconds 0.1
10
1
Model size (scale parameter)
103. Practical results
Kanban problem
Marcie Stratagem
10 20 50 100
26
100
Time in seconds 0.1
10
1
Model size (scale parameter)
104. Practical results
Kanban problem
Marcie Stratagem
10 20 50 100
26
100
Time in seconds 0.1
10
1
Model size (scale parameter)
106. Practical results
Sharedmem problem
⢠Petri netâs places and transition increase with scale
parameter
27
107. Practical results
Sharedmem problem
⢠Petri netâs places and transition increase with scale
parameter
⢠2651 places & 5050 transitions for scale parameter
50
27
108. Practical results
Sharedmem problem
⢠Petri netâs places and transition increase with scale
parameter
⢠2651 places & 5050 transitions for scale parameter
50
⢠State space for scale parameter 50
27
109. Practical results
Sharedmem problem
⢠Petri netâs places and transition increase with scale
parameter
⢠2651 places & 5050 transitions for scale parameter
50
⢠State space for scale parameter 50
⢠5.87 ¡1026 states
27
110. Practical results
SharedMem problem
Marcie Stratagem
5 10 20 50
28
Time in seconds
1000
100
10
1
0.1
Model size (scale parameter)
111. Practical results
SharedMem problem
Marcie Stratagem
5 10 20 50
28
Time in seconds
1000
100
10
1
0.1
Model size (scale parameter)
112. Practical results
SharedMem problem
Marcie Stratagem
5 10 20 50
28
Time in seconds
1000
100
10
1
0.1
Model size (scale parameter)
122. Future work
⢠Systematically go from SOS rules to rewrite
strategies
31
123. Future work
⢠Systematically go from SOS rules to rewrite
strategies
⢠Create more translations
31
124. Future work
⢠Systematically go from SOS rules to rewrite
strategies
⢠Create more translations
⢠Implement CTL model checking using strategies
31
126. Bibliography
!
Narciso MartĂ-Oliet and JosĂŠ Meseguer. Rewriting Logic as a Logical and
Semantic Framework.1993
Peter Borovanský and Claude Kirchner and HÊlène Kirchner and Pierre-
Etienne Moreau and Marian Vittek. ELAN: A logical framework based on
computational systems. Electronic Notes in Theoretical Computer
Science 4(0):35 â 50, 1996.
M Heiner, C Rohr and M Schwarick. MARCIE - Model checking And
Reachability analysis done effiCIEntly; In Proc. PETRI NETS 2013, Milano,
Springer, LNCS, volume 7927, pages 389â399, June 2013
Kordon et al. HTML results from the Model Checking Contest @ Petri Net
(2014 edition). http://mcc.lip6.fr/2014, 2014
33
127. The paper for this presentation can
be found at: http://
edmundo.lopezbobeda.net/
publications
34