let s try to understand part of iris
play

Let's try to understand (part of) Iris Willem Penninckx The Paper - PowerPoint PPT Presentation

Let's try to understand (part of) Iris Willem Penninckx The Paper Iris: Monoids and Invariants as an Orthogonal Basis for Concurrent Reasoning Ralf Jung, David Swasey, Filip Sieczkowski, Kasper Svendsen, Aaron Turon, Lars Birkedal, and Derek


  1. Let's try to understand (part of) Iris Willem Penninckx

  2. The Paper Iris: Monoids and Invariants as an Orthogonal Basis for Concurrent Reasoning Ralf Jung, David Swasey, Filip Sieczkowski, Kasper Svendsen, Aaron Turon, Lars Birkedal, and Derek Dreyer

  3. DISCLAIMER I'm not an expert

  4. Concurrency is about shared state Situation Shared Verify this state Shared Memory No secret memory overwrites, Counter only increases Message- Network Protocol passing Input/output Filesystems, Protocol Humans, ...

  5. How to verify when there's concurrency? “ Monoids and invariants are all you need ” – Iris

  6. Invariant: assertion about shared state Thread 1: Atomic operation 1 Atomic operation 2 Assertion holds Atomic operation 3 Atomic operation 4

  7. (Iris-style) Monoid “error” element Commutative binary operator Name of the monoid Set

  8. “Case study”: Verification + concurrency + heap Proglang: v = malloc() v1 = !v2 v1 := v2 v1 = v2

  9. Attempt #1 Invariant, e.g.: GLOBAL physical state is h

  10. Thread 1: v1 = malloc() v1 := 7

  11. “partial knowledge” in monoid Set

  12. “partial knowledge” in monoid Local partial knowledge Global knowledge

  13. “partial knowledge” in monoid Local partial knowledge No global knowledge Global knowledge

  14. “partial knowledge” in monoid Local partial knowledge No global knowledge Global knowledge = g h

  15. “partial knowledge” in monoid Exercise: what does this mean?

  16. Note: in paper composition Is just pointwise (so (\eps, l1) . (\eps l2) is not always \bot) Exercise: what is the neutral element?

  17. Thread 1: v1 = malloc() v1 := 7

  18. Thread 1: v1 = malloc() v1 := 7 Link with physical? Combined: = = Know in physical state!

  19. Let's prove v1 := 7 Our invariant holds

  20. Strategy ● Open invariant ● Combine thread's ghost state with invar's Know in physical state! – ● Do physical update – ● Do ghost update ● Split thread's ghost state and invar's ● Close invariant

  21. Phys. Upd frame v1 := 7 Need to update ghost state to close invar

  22. ??? Allowed if “does not harm other threads”

  23. “Does not harm other threads” ? No: other thread might have e.g. ? Yes: cell update

  24. Increase-only counter

  25. Wrapping up ● Monoids ● Physical assertion ● Ghost assertion ● Invariants ● Teaser Episode 3 ● Can I model I/O in Iris? (Willem) ● Logical Atomicity (Amin)

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend