Separation Logic Tutorial by Armando Solar-Lezama

separation logic tutorial n.w
1 / 20
Embed
Share

Learn about Separation Logic Tutorial by Armando Solar-Lezama, focusing on local reasoning about programs that alter data structures. Explore concepts like heap notation, formalizing notation, algebra of heap predicates, and more.

  • Separation Logic
  • Tutorial
  • Armando Solar-Lezama
  • Data Structures

Uploaded on | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Separation Logic Tutorial Armando Solar-Lezama

  2. Separation logic See: Local Reasoning about Programs that Alter Data Structures By O Hearn, Reynolds and Yang Key idea: Break the heap into disjoint pieces Focus on a few small pieces at a time Statements affect one piece at a time

  3. The language Imp + extensions Stmt : ? = ? ? = ? ? = ????(?1, ,??) | ???????(?) Operational Semantics ? ? ?? ??? ? ??? ??? ? :? ? ? ? ? ? ??? ? = ? ? = ? ? ? ? ? = ? ? = ? ? ? ? ? = ? ? = ? ? ? s x ? = ????(?0 ??) ? = ? ? ? ? ?0 ?, ,? + ? ?? ? ? ??? ? = (max??? ) + 1 ???????(?) ? = ? { ? ? }

  4. Separation Logic: Notation Heaps are described by predicates in the following language: emp := The heap is empty There are no cells in this heap ? ? := The heap has exactly one cell. This cell is at location x This cell stores the value y A * B := Heap can be partitioned into two disjoint regions, one region where A is true, one region where B is true

  5. Formalizing the notation Copied from the paper by O Hearn, Reynolds and Yang 0# 1 Domains of 0 and 1 are disjoint 0 1 Union of disjoint heaps

  6. A few more definitions ? 10 ? 10 * ? 11 Some useful rules:

  7. Some additional shorthand Copied from the paper by O Hearn, Reynolds and Yang An interesting property

  8. Algebra of heap predicates Which assertions are valid? Copied from the paper by O Hearn, Reynolds and Yang

  9. Algebra of heap predicates Which assertions are valid?

  10. Describing data-structures What does this heap describe? ? ?,? (? + ? ?, ?) b -o ... a o x+o x+o+1 x x+1

  11. Proofs Rules for Separation Logic Copied from the paper by O Hearn, Reynolds and Yang Small Axioms

  12. Proof Rules for Separation Logic Copied from the paper by O Hearn, Reynolds and Yang ? ? ? ?.? ?{ ?.?} ? ????(?)

  13. More Cycle Free Data- structures Copied from the paper by O Hearn, Reynolds and Yang

  14. Examples

  15. Examples

  16. Concurrency Resources, Concurrency and Local Reasoning By Peter O Hearn

  17. Disjoint Concurrency Rule

  18. Simple Example

  19. Mergesort

  20. Mergesort

Related


More Related Content