Dynamic Partial-Order Reduction for Model Checking Software
Cormac Flanagan
UC Santa Cruz
Patrice Godefroid
Bell Labs Presented by:
Dynamic Partial-Order Reduction for Model Checking Software Cormac - - PowerPoint PPT Presentation
Dynamic Partial-Order Reduction for Model Checking Software Cormac Flanagan Patrice Godefroid UC Santa Cruz Bell Labs Presented by: Ulrich Mller Model Checking Given a multithreaded program Wed like to check for deadlocks and
UC Santa Cruz
Bell Labs Presented by:
– Proove it! – Ideally in a push-button fashion – Directly using source code (implementation vs abstraction)
– Exhaustive state space exploration – Here:
(r0, s0, t0) (r1, s1, t1) (r0, s0, t1) (r0, s1, t1)
r1 r0 t1 t0 s1 s0
Given n=3 independent threads: This is how the global state space looks: Possible Interleavings:
(Distinct paths in state graph)
Number of states:
n n i
=
– Use independence between transitions to reduce the state space Two transitions are independent if both of the following hold:
t2 t2 t1 t1
commute, we can swap two adjacent ones in a given trace
traces
those traces per equivalence class! Also called Model Checking using Representatives
Watch out: These are transitions!
Linear order Partial order
is a persistent transition, if it is independent with every transition ri reachable from s without executing b
sound to only explore b
threads
s
b r1 r2 ri independent Based on Flanagan‘s presentation of the paper
1,0,0 0,0,0 0,1,0 1,0,2 0,1,0 1,1,0 1,1,2 1,1,4 1,1,0 1,1,2
x=1 g+=2 y=1 g*=2
x,y,g
{S} {S}
r1 r2 s1 s2
R S
x=1 g+=2 y=1 g*=2 x=1 g+=2 y=1 g*=2 x=1 g+=2 y=1 g*=2
Summ Summary: ary:
{S,R}
– No approximate/expensive/complicated static analysis – Supports pointer-rich data structures – Supports dynamic creation of threads/objects
– Finite state space – Acyclic state space
– Liveness properties and LTL?
Inspect: A Framework for Dynamic Verification of Multithreaded C Programs Sadly, very sparsely documented. http://www.cs.utah.edu/~yuyang/inspect/ Cute: A Concolic Unit Testing Engine for C and Java Uses a simplified version of DPOR to guide symbolic model checking. http://osl.cs.uiuc.edu/~ksen/cute/
From a lecture of Theo Ruys on the subject
From Flanagan‘s presentation of the paper
1 10 100 1000 10000 100000 1000000 10000000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Number of threads Number of transitions
Dynamic POR, stateless, sleep sets Dynamic POR, stateless, no sleep sets Static POR, stateless, sleep sets Static POR, stateless, no sleep sets Static POR, stateful, sleep sets Static POR, stateful, no sleep sets