skip to main content

Fractional resources in unbounded separation logic

Published:31 October 2022Publication History
Skip Abstract Section

Abstract

Many separation logics support fractional permissions to distinguish between read and write access to a heap location, for instance, to allow concurrent reads while enforcing exclusive writes. Fractional permissions extend to composite assertions such as (co)inductive predicates and magic wands by allowing those to be multiplied by a fraction. Typical separation logic proofs require that this multiplication has three key properties: it needs to distribute over assertions, it should permit fractions to be factored out from assertions, and two fractions of the same assertion should be combinable into one larger fraction.

Existing formal semantics incorporating fractional assertions into a separation logic define multiplication semantically (via models), resulting in a semantics in which distributivity and combinability do not hold for key resource assertions such as magic wands, and fractions cannot be factored out from a separating conjunction. By contrast, existing automatic separation logic verifiers define multiplication syntactically, resulting in a different semantics for which it is unknown whether distributivity and combinability hold for all assertions.

In this paper, we present a novel semantics for separation logic assertions that allows states to hold more than a full permission to a heap location during the evaluation of an assertion. By reimposing upper bounds on the permissions held per location at statement boundaries, we retain key properties of separation logic, in particular, the frame rule. Our assertion semantics unifies semantic and syntactic multiplication and thereby reconciles the discrepancy between separation logic theory and tools and enjoys distributivity, factorisability, and combinability. We have formalised our semantics and proved its properties in Isabelle/HOL.

References

  1. Amal Ahmed. 2006. Step-Indexed Syntactic Logical Relations for Recursive and Quantified Types. In Proceedings of the 15th European Conference on Programming Languages and Systems (ESOP’06). Springer-Verlag, Berlin, Heidelberg. 69–83. isbn:354033095X https://doi.org/10.1007/11693024_6 Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Andrew W. Appel and David McAllester. 2001. An Indexed Model of Recursive Types for Foundational Proof-Carrying Code. ACM Trans. Program. Lang. Syst., 23, 5 (2001), sep, 657–683. issn:0164-0925 https://doi.org/10.1145/504709.504712 Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Vytautas Astrauskas, Peter Müller, Federico Poli, and Alexander J. Summers. 2019. Leveraging Rust Types for Modular Specification and Verification. In Object-Oriented Programming Systems, Languages, and Applications (OOPSLA). Proc. ACM Program. Lang., 3, OOPSLA, 147:1–147:30. https://doi.org/10.1145/3360573 Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Christian J. Bell, Andrew W. Appel, and David Walker. 2010. Concurrent Separation Logic for Pipelined Parallelization. In Static Analysis, Radhia Cousot and Matthieu Martel (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg. 151–166. isbn:978-3-642-15769-1 Google ScholarGoogle Scholar
  5. Stefan Blom and Marieke Huisman. 2014. The VerCors Tool for Verification of Concurrent Programs. In FM 2014: Formal Methods, Cliff Jones, Pekka Pihlajasaari, and Jun Sun (Eds.). Springer International Publishing, Cham. 127–131. isbn:978-3-319-06410-9 Google ScholarGoogle Scholar
  6. Stefan Blom and Marieke Huisman. 2015. Witnessing the elimination of magic wands. International Journal on Software Tools for Technology Transfer (STTT), 17, 6 (2015), 757–781. https://doi.org/10.1007/s10009-015-0372-3 Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Richard Bornat, Cristiano Calcagno, Peter W. O’Hearn, and Matthew J. Parkinson. 2005. Permission accounting in separation logic. In Principle of Programming Languages (POPL), Jens Palsberg and Martín Abadi (Eds.). ACM, 259–270. Google ScholarGoogle Scholar
  8. John Boyland. 2003. Checking Interference with Fractional Permissions. In Static Analysis (SAS), Radhia Cousot (Ed.). 55–72. Google ScholarGoogle Scholar
  9. John Tang Boyland. 2010. Semantics of fractional permissions with nesting. Transactions on Programming Languages and Systems (TOPLAS), 32, 6 (2010), 22:1–22:33. https://doi.org/10.1145/1749608.1749611 Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. James Brotherston, Diana Costa, Aquinas Hobor, and John Wickerson. 2020. Reasoning over Permissions Regions in Concurrent Separation Logic. In Computer Aided Verification (CAV), Shuvendu K. Lahiri and Chao Wang (Eds.). Google ScholarGoogle Scholar
  11. Cristiano Calcagno, Peter W. O’Hearn, and Hongseok Yang. 2007. Local action and abstract separation logic. In Logic in Computer Science (LICS). 366–375. Google ScholarGoogle Scholar
  12. Qinxiang Cao, Shengyi Wang, Aquinas Hobor, and Andrew W. Appel. 2019. Proof Pearl: Magic Wand as Frame. arxiv:cs.PL/1909.08789. Google ScholarGoogle Scholar
  13. Bor-Yuh Evan Chang and Xavier Rival. 2008. Relational inductive shape analysis. ACM SIGPLAN Notices, 43, 1 (2008), 247–260. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Patrick Cousot and Radhia Cousot. 1979. Constructive Versions of Tarski’s Fixed Point Theorems. Pacific J. Math., 81, 1 (1979), 43–57. Google ScholarGoogle ScholarCross RefCross Ref
  15. Thibault Dardinier. 2022. Unbounded Separation Logic. Archive of Formal Proofs, September, issn:2150-914x https://isa-afp.org/entries/Separation_Logic_Unbounded.html Google ScholarGoogle Scholar
  16. Thibault Dardinier, Peter Müller, and Alexander J. Summers. 2022. Fractional Resources in Unbounded Separation Logic (artifact). https://doi.org/10.5281/zenodo.7072457 Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Thibault Dardinier, Gaurav Parthasarathy, Noé Weeks, Peter Müller, and Alexander J. Summers. 2022. Sound Automation of Magic Wands. In Computer Aided Verification, Sharon Shoham and Yakir Vizel (Eds.). Springer International Publishing, Cham. 130–151. isbn:978-3-031-13188-2 Google ScholarGoogle Scholar
  18. Robert Dockins, Aquinas Hobor, and Andrew W. Appel. 2009. A Fresh Look at Separation Algebras and Share Accounting. In Programming Languages and Systems, Zhenjiang Hu (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg. 161–177. isbn:978-3-642-10672-9 Google ScholarGoogle Scholar
  19. C. Haack and C. Hurlin. 2009. Resource Usage Protocols for Iterators. Journal of Object Technology (JOT), 8, 4 (2009), June, 55–83. Google ScholarGoogle ScholarCross RefCross Ref
  20. Aquinas Hobor and Cristian Gherghina. 2012. Barriers in Concurrent Separation Logic: Now With Tool Support!. Logical Methods in Computer Science, Volume 8, Issue 2 (2012), April, https://doi.org/10.2168/LMCS-8(2:2)2012 Google ScholarGoogle ScholarCross RefCross Ref
  21. Bart Jacobs and Frank Piessens. 2011. Expressive modular fine-grained concurrency specification. In Principles of Programming Languages (POPL). 271–282. https://doi.org/10.1145/1926385.1926417 Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Bart Jacobs, Jan Smans, Pieter Philippaerts, Frédéric Vogels, Willem Penninckx, and Frank Piessens. 2011. VeriFast: A Powerful, Sound, Predictable, Fast Verifier for C and Java. In NASA Formal Methods (NFM), Mihaela Gheorghiu Bobaru, Klaus Havelund, Gerard J. Holzmann, and Rajeev Joshi (Eds.) (Lecture Notes in Computer Science, Vol. 6617). Springer, 41–55. Google ScholarGoogle Scholar
  23. Jonas Jensen, Lars Birkedal, and Peter Sestoft. 2011. Modular Verification of Linked Lists with Views via Separation Logic. Journal of Object Technology (JOT), 10 (2011), January, 2: 1–20. https://doi.org/10.1145/1924520.1924524 Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Ralf Jung, Robbert Krebbers, Jacques-Henri Jourdan, Ales Bizjak, Lars Birkedal, and Derek Dreyer. 2018. Iris from the ground up: A modular foundation for higher-order concurrent separation logic. J. Funct. Program., 28 (2018), e20. https://doi.org/10.1017/S0956796818000151 Google ScholarGoogle ScholarCross RefCross Ref
  25. Neelakantan R. Krishnaswami. 2006. Reasoning about Iterators with Separation Logic. In Specification and Verification of Component-Based Systems (SAVCBS). https://doi.org/10.1145/1181195.1181213 Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Xuan-Bach Le and Aquinas Hobor. 2018. Logical Reasoning for Disjoint Permissions. In European Symposium on Programming (ESOP), Amal Ahmed (Ed.). Google ScholarGoogle Scholar
  27. K. Rustan M. Leino, Peter Müller, and Jan Smans. 2009. Verification of Concurrent Programs with Chalice. In Foundations of Security Analysis and Design V (Lecture Notes in Computer Science, Vol. 5705). Springer, 195–222. http://www.springerlink.com Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. K. Rustan M. Leino, Peter Müller, and Jan Smans. 2010. Deadlock-free Channels and Locks. In European Symposium on Programming (ESOP), A. D. Gordon (Ed.) (Lecture Notes in Computer Science, Vol. 6012). Springer, 407–426. http://www.springerlink.com Google ScholarGoogle Scholar
  29. Toshiyuki Maeda, Haruki Sato, and Akinori Yonezawa. 2011. Extended Alias Type System Using Separating Implication. Workshop on Types in Language Design and Implementation (TLDI). https://doi.org/10.1145/1929553.1929559 Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Peter Müller, Malte Schwerhoff, and Alexander J. Summers. 2016. Viper: A Verification Infrastructure for Permission-Based Reasoning. In Verification, Model Checking, and Abstract Interpretation (VMCAI), B. Jobstmann and K. R. M. Leino (Eds.) (Lecture Notes in Computer Science, Vol. 9583). Springer, 41–62. Google ScholarGoogle Scholar
  31. Tobias Nipkow, Lawrence C Paulson, and Markus Wenzel. 2002. Isabelle/HOL: a proof assistant for higher-order logic. 2283, Springer Science & Business Media. Google ScholarGoogle Scholar
  32. Peter W. O’Hearn, Hongseok Yang, and John C. Reynolds. 2004. Separation and Information Hiding. SIGPLAN Not., 39, 1 (2004), jan, 268–280. issn:0362-1340 https://doi.org/10.1145/982962.964024 Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Matthew Parkinson. 2005. Local Reasoning for Java. Ph.D. Dissertation. https://www.microsoft.com/en-us/research/publication/local-reasoning-for-java/ http://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-654.html. Google ScholarGoogle Scholar
  34. Matthew Parkinson and Gavin Bierman. 2005. Separation logic and abstraction. In Principle of Programming Languages (POPL), J. Palsberg and M. Abadi (Eds.). ACM, 247–258. Google ScholarGoogle Scholar
  35. Willem Penninckx, Bart Jacobs, and Frank Piessens. 2015. Sound, Modular and Compositional Verification of the Input/Output Behavior of Programs. 9032, 158–182. https://doi.org/10.1007/978-3-662-46669-8_7 Google ScholarGoogle ScholarCross RefCross Ref
  36. John C. Reynolds. 2002. Separation Logic: A Logic for Shared Mutable Data Structures. In Logic in Computer Science (LICS). IEEE, 55–74. Google ScholarGoogle Scholar
  37. Malte Schwerhoff and Alexander J. Summers. 2015. Lightweight Support for Magic Wands in an Automatic Verifier. In European Conference on Object-Oriented Programming (ECOOP), J. T. Boyland (Ed.) (LIPIcs, Vol. 37). Schloss Dagstuhl, 614–638. Google ScholarGoogle Scholar
  38. Alexander J. Summers and Peter Müller. 2018. Automating Deductive Verification for Weak-Memory Programs. In Tools and Algorithms for the Construction and Analysis of Systems (TACAS) (Lecture Notes in Computer Science). Springer, 190–209. Google ScholarGoogle Scholar
  39. Kasper Svendsen and Lars Birkedal. 2014. Impredicative Concurrent Abstract Predicates. In Programming Languages and Systems, Zhong Shao (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg. 149–168. isbn:978-3-642-54833-8 Google ScholarGoogle Scholar
  40. Alfred Tarski. 1955. A lattice-theoretical fixpoint theorem and its applications.. Pacific J. Math., 5, 2 (1955), 285 – 309. https://doi.org/pjm/1103044538 Google ScholarGoogle ScholarCross RefCross Ref
  41. Thomas Tuerk. 2010. Local reasoning about while-loops. In Verified Software: Theories, Tools and Experiments - Theory Workshop (VS-Theory). Google ScholarGoogle Scholar
  42. Viktor Vafeiadis. 2011. Concurrent Separation Logic and Operational Semantics. Electronic Notes in Theoretical Computer Science, 276 (2011), 335–351. issn:1571-0661 https://doi.org/10.1016/j.entcs.2011.09.029 Twenty-seventh Conference on the Mathematical Foundations of Programming Semantics (MFPS XXVII). Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Jules Villard, Étienne Lozes, and Cristiano Calcagno. 2009. Proving Copyless Message Passing. In Proceedings of the 7th Asian Symposium on Programming Languages and Systems (APLAS ’09). Springer-Verlag, Berlin, Heidelberg. 194–209. isbn:9783642106712 https://doi.org/10.1007/978-3-642-10672-9_15 Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Fractional resources in unbounded separation logic

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in

          Full Access

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader
          About Cookies On This Site

          We use cookies to ensure that we give you the best experience on our website.

          Learn more

          Got it!