Synthesizing Commutativity Conditions Kshitij Bansal Eric Koskinen - - PowerPoint PPT Presentation

synthesizing commutativity conditions
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

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

slide-2
SLIDE 2

Thread 1 Thread 3 Thread 2 Thread 4

slide-3
SLIDE 3

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

slide-4
SLIDE 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

slide-5
SLIDE 5

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

Linearizability Commutativity

slide-6
SLIDE 6

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

Linearizability Commutativity

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 . . .

slide-7
SLIDE 7

Serializable. … Opaque.

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

slide-8
SLIDE 8

Serializable. … Opaque.

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

Linearizable Commute

slide-9
SLIDE 9

Linearizable Commute

slide-10
SLIDE 10

Linearizable Commute

Reduce to Reachability Bouajjani et al. ICALP’15

Many techniques based on program logics

slide-11
SLIDE 11

Commute

add(x) ⋈ remove(y)

?

slide-12
SLIDE 12

Commute

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

slide-13
SLIDE 13

Commute

Set Abstract Data Type S Example.

slide-14
SLIDE 14

Commute

Goal. Discover a condition that implies

add(x) ⋈ remove(y)

slide-15
SLIDE 15

Commute

Candidate commutativity condition φ Goal. Discover a condition that implies

add(x) ⋈ remove(y)

Strategy. ⋈ valid ⎞

φ … ⇒

⎛ | ⎝ ⎠ |

slide-16
SLIDE 16

Commute

Candidate commutativity condition φ Goal. Discover a condition that implies

add(x) ⋈ remove(y)

Strategy. ⋈ valid ⎞

φ … ⇒

⎛ | ⎝ ⎠ |

slide-17
SLIDE 17

Commute

Candidate commutativity condition φ Goal. Discover a condition that implies

add(x) ⋈ remove(y)

Strategy. ⋈ valid ⎞

φ … ⇒

⎛ | ⎝ ⎠ |

slide-18
SLIDE 18

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.

slide-19
SLIDE 19

Commute

false false false

⋈ valid ⎞

H0 … ⇒

⎛ | ⎝ ⎠ | Abstraction Refinement Algorithm

slide-20
SLIDE 20

Commute

false false false

⋈ valid ⎞

H1 … ⇒

⎛ | ⎝ ⎠ |

slide-21
SLIDE 21

Commute

false false false

⋈ valid ⎞

H’1 … ⇒

⎛ | ⎝ ⎠ |

slide-22
SLIDE 22

Commute

false false false

⋈ valid ⎞

… ⇒

⎛ | ⎝ ⎠ |

H2

slide-23
SLIDE 23

Commute

false false false

⋈ valid ⎞

… ⇒

⎛ | ⎝ ⎠ |

H2

slide-24
SLIDE 24

Commute

slide-25
SLIDE 25

Commute

Challenges

  • 1. Avoid introducing quantifier alternation

Translate partial specification to equivalent total specification.

  • 2. Populating atomic predicates

Automatically extracted from the atoms of the transition system

  • 3. Dynamic choice of next predicate

Counterexamples and “poke” heuristics.

slide-26
SLIDE 26

Commute

Thank you!