Synthesizing Commutativity Conditions
Eric Koskinen IBM Research, New York United States Omer Tripp IBM Research, New York United States Kshitij Bansal New York University United States
Synthesizing Commutativity Conditions Kshitij Bansal Eric Koskinen - - PowerPoint PPT Presentation
Synthesizing Commutativity Conditions Kshitij Bansal Eric Koskinen Omer Tripp New York University IBM Research, New York IBM Research, New York United States United States United States Thread Thread Thread Thread 1 2 3 4 Thread
Eric Koskinen IBM Research, New York United States Omer Tripp IBM Research, New York United States Kshitij Bansal New York University United States
Thread 1 Thread 3 Thread 2 Thread 4
Concurrent HashMap Concurrent Queue Concurrent List
Thread 1 Thread 3 Thread 2 Thread 4
put get enq deq add rm
Thread 1 Thread 3 Thread 2 Thread 4
Concurrent HashMap Concurrent Queue Concurrent List
Thread 1 Thread 3 Thread 2 Thread 4
put get enq deq add rm
Shared Memory
rd wr
Thread 1 Thread 3 Thread 2 Thread 4
Concurrent HashMap Concurrent Queue Concurrent List
Thread 1 Thread 3 Thread 2 Thread 4
put get enq deq add rm
Shared Memory
rd wr
Thread 1 Thread 3 Thread 2 Thread 4
Concurrent HashMap Concurrent Queue Concurrent List
Thread 1 Thread 3 Thread 2 Thread 4
put get enq deq add rm
Shared Memory
rd wr
Thread 1 Thread 3 Thread 2 Thread 4
Building blocks for Exploiting Multi-core Performance (boosting, open-nesting, Celements et al TOCS’15) Sensible programming models Static/dynamic race detection Separation of concerns in verification . . .
The PUSH/PULL Model
Push
⟨ht.get(5),_⟩
Pull
⟨ht.map(3,x),_⟩ ⟨ht.map(3,x),_⟩ ⟨q.enq(‘a’),_⟩ ⟨q.enq(‘a’),_,gUC⟩ ⟨ht.map(3,x),_,gUC⟩ ⟨ht.map(7,2),_,gUC⟩
PLDI 2015
The PUSH/PULL Model
Push
⟨ht.get(5),_⟩
Pull
⟨ht.map(3,x),_⟩ ⟨ht.map(3,x),_⟩ ⟨q.enq(‘a’),_⟩ ⟨q.enq(‘a’),_,gUC⟩ ⟨ht.map(3,x),_,gUC⟩ ⟨ht.map(7,2),_,gUC⟩
PLDI 2015
Reduce to Reachability Bouajjani et al. ICALP’15
Many techniques based on program logics
add(x) ⋈ remove(y)
?
add(x) ⋈ remove(y)
?
Joint work with Kshitij Bansal (NYU) and Omer Tripp (IBM)
New Technique
✓ Synthesize sound commutativity conditions ✓ Developed an encoding that allows us to reduce
commutativity to a format amenable to SMT solvers
✓ Relative completeness ✓ Implemented and applied to key data-structures
Commute
Set Abstract Data Type S Example.
Commute
Goal. Discover a condition that implies
add(x) ⋈ remove(y)
Commute
Candidate commutativity condition φ Goal. Discover a condition that implies
add(x) ⋈ remove(y)
Strategy. ⋈ valid ⎞
⎛ | ⎝ ⎠ |
Commute
Candidate commutativity condition φ Goal. Discover a condition that implies
add(x) ⋈ remove(y)
Strategy. ⋈ valid ⎞
⎛ | ⎝ ⎠ |
Commute
Candidate commutativity condition φ Goal. Discover a condition that implies
add(x) ⋈ remove(y)
Strategy. ⋈ valid ⎞
⎛ | ⎝ ⎠ |
Commute
Candidate commutativity condition φ Goal. Discover a condition that implies
add(x) ⋈ remove(y)
Strategy. ⋈ valid ⎞
⎛ | ⎝ ⎠ | A SMT-friend encoding that does not introduce quantifiers (aside from outermost ∀) Translate partial specification to equivalent total specification.
Commute
false false false
⋈ valid ⎞
⎛ | ⎝ ⎠ | Abstraction Refinement Algorithm
Commute
false false false
⋈ valid ⎞
⎛ | ⎝ ⎠ |
Commute
false false false
⋈ valid ⎞
⎛ | ⎝ ⎠ |
Commute
false false false
⋈ valid ⎞
⎛ | ⎝ ⎠ |
Commute
false false false
⋈ valid ⎞
⎛ | ⎝ ⎠ |
Commute
Commute
Challenges
Translate partial specification to equivalent total specification.
Automatically extracted from the atoms of the transition system
Counterexamples and “poke” heuristics.
Commute
Thank you!