specifying and verifying concurrent algorithms with
play

Specifying and Verifying Concurrent Algorithms with Histories - PowerPoint PPT Presentation

Specifying and Verifying Concurrent Algorithms with Histories and Subjectivity Ilya Sergey Aleks Nanevski Anindya Banerjee ESOP 2015 A logic-based approach for Specifying and Verifying Concurrent Algorithms An


  1. Familiar PCM: finite heaps

  2. Familiar PCM: finite heaps • Heaps are partial finite maps nat → Val

  3. Familiar PCM: finite heaps • Heaps are partial finite maps nat → Val • Join operation ⊕ is disjoint union

  4. Familiar PCM: finite heaps • Heaps are partial finite maps nat → Val • Join operation ⊕ is disjoint union • Unit element 0 is the empty heap ∅

  5. Concurroid for thread-local state ∅

  6. Concurroid for thread-local state ∅ h s • h s — heap, logically owned by this thread

  7. Concurroid for thread-local state h o ∅ h s • h s — heap, logically owned by this thread • h o — heap, owned by others

  8. Concurroid for thread-local state Concurrent Separation Logic 
 O’Hearn [CONCUR’04] h o ∅ h s • h s — heap, logically owned by this thread • h o — heap, owned by others

  9. � � � � � � *x := 5; � � *y := 7; � � � � � � � �

  10. { h s = x ↦ - ⊕ y ↦ - ⋀ h o = h } � � � � � � *x := 5; � � *y := 7; � � � � � � � �

  11. disjoint by resource definition { h s = x ↦ - ⊕ y ↦ - ⋀ h o = h } � � � � � � *x := 5; � � *y := 7; � � � � � � � �

  12. disjoint by resource definition { h s = x ↦ - ⊕ y ↦ - ⋀ h o = h } � � { h s = x ↦ - ⋀ h o = y ↦ ? ⊕ h } � � � � *x := 5; � � *y := 7; � � � � � � � �

  13. disjoint by resource definition { h s = x ↦ - ⊕ y ↦ - ⋀ h o = h } � � { h s = x ↦ - ⋀ h o = y ↦ ? ⊕ h } { h s = y ↦ - ⋀ h o = x ↦ ? ⊕ h } � � � � *x := 5; � � *y := 7; � � � � � � � �

  14. disjoint by resource definition { h s = x ↦ - ⊕ y ↦ - ⋀ h o = h } � � { h s = x ↦ - ⋀ h o = y ↦ ? ⊕ h } { h s = y ↦ - ⋀ h o = x ↦ ? ⊕ h } � � � � *x := 5; � � *y := 7; � � { h s = x ↦ 5 ⋀ h o = y ↦ ? ⊕ h } { h s = y ↦ 7 ⋀ h o = x ↦ ? ⊕ h } � � � � � �

  15. disjoint by resource definition { h s = x ↦ - ⊕ y ↦ - ⋀ h o = h } � � { h s = x ↦ - ⋀ h o = y ↦ ? ⊕ h } { h s = y ↦ - ⋀ h o = x ↦ ? ⊕ h } � � � � *x := 5; � � *y := 7; � � { h s = x ↦ 5 ⋀ h o = y ↦ ? ⊕ h } { h s = y ↦ 7 ⋀ h o = x ↦ ? ⊕ h } � � � � � � { h s = x ↦ 5 ⊕ y ↦ 7 ⋀ h o = h }

  16. Key ideas • Subjectivity — reasoning with self and other • PCMs — uniform way to logically split state • Histories

  17. Key ideas • Subjectivity — reasoning with self and other • PCMs — uniform way to logically split state • Histories

  18. Key ideas • Subjectivity — reasoning with self and other • PCMs — uniform way to logically split state • Histories Sergey et al. [ESOP’15]

  19. Atomic stack specifications push(x)

  20. Atomic stack specifications { S ′ = x :: xs } { S = xs } push(x)

Recommend


More recommend