Abstract
Separation logic specifications with abstract predicates intuitively enforce a discipline that constrains when and how calls may be made between a client and a library. Thus a separation logic specification of a library intuitively enforces a protocol on the trace of interactions between a client and the library. We show how to formalize this intuition and demonstrate how to derive "free theorems" about such interaction traces from abstract separation logic specifications. We present several examples of free theorems. In particular, we prove that a so-called logically atomic concurrent separation logic specification of a concurrent module operation implies that the operation is linearizable. All the results presented in this paper have been mechanized and formally proved in the Coq proof assistant using the Iris higher-order concurrent separation logic framework.
Supplemental Material
- Rajeev Alur and P. Madhusudan. 2004. Visibly pushdown languages. In Proceedings of the 36th Annual ACM Symposium on Theory of Computing, Chicago, IL, USA, June 13-16, 2004. 202–211. https://doi.org/10.1145/1007352.1007390 Google Scholar
Digital Library
- Thibaut Balabonski, François Pottier, and Jonathan Protzenko. 2016. The Design and Formalization of Mezzo, a Permission-Based Programming Language. ACM Trans. Program. Lang. Syst., 38, 4 (2016), Article 14, Aug., 94 pages. issn:0164-0925 https://doi.org/10.1145/2837022 Google Scholar
Digital Library
- Jesper Bengtson, Karthikeyan Bhargavan, Cédric Fournet, Andrew D. Gordon, and Sergio Maffeis. 2011. Refinement Types for Secure Implementations. ACM Trans. Program. Lang. Syst., 33, 2 (2011), Feb., 8:1–8:45. https://doi.org/10.1145/1890028.1890031 Google Scholar
Digital Library
- Kevin Bierhoff and Jonathan Aldrich. 2007. Modular Typestate Checking of Aliased Objects. In Proceedings of the 22nd Annual ACM SIGPLAN Conference on Object-oriented Programming Systems and Applications (OOPSLA’07). ACM, 301–320. https://doi.org/10.1145/1297027.1297050 Google Scholar
Digital Library
- Kevin Bierhoff, Nels E Beckman, and Jonathan Aldrich. 2009. Practical API Protocol Checking with Access Permissions. In Proceedings of the 23rd European Conference on Object-Oriented Programming (ECOOP’09). Springer-Verlag, 195–219. https://doi.org/10.1007/978-3-642-03013-0_10 Google Scholar
Digital Library
- Bodil Biering, Lars Birkedal, and Noah Torp-Smith. 2007. BI-hyperdoctrines, Higher-order Separation Logic, and Abstraction. ACM Trans. Program. Lang. Syst., 29, 5 (2007), Article 24, Aug., issn:0164-0925 https://doi.org/10.1145/1275497.1275499 Google Scholar
Digital Library
- Lars Birkedal and Aleš Bizjak. 2020. Lecture Notes on Iris: Higher-Order Concurrent Separation Log. http://iris-project.org/tutorial-pdfs/iris-lecture-notes.pdfGoogle Scholar
- Johannes Borgström, Andrew D. Gordon, and Riccardo Pucella. 2011. Roles, Stacks, Histories: A Triple for Hoare. Journal of Functional Programming, 21 (2011), 159–207. https://doi.org/10.1017/S0956796810000134 Google Scholar
Cross Ref
- Qinxiang Cao, Lennart Beringer, Samuel Gruetter, Josiah Dodds, and Andrew W. Appel. 2018. VST-Floyd: A Separation Logic Tool to Verify Correctness of C Programs. Journal of Automated Reasoning, 61, 1-4 (2018), 367–422. https://doi.org/10.1007/s10817-018-9457-5 Google Scholar
Digital Library
- Pedro da Rocha Pinto, Thomas Dinsdale-Young, and Philippa Gardner. 2014. TaDA: A Logic for Time and Data Abstraction. In Proceedings of ECOOP. https://doi.org/10.1007/978-3-662-44202-9_9 Google Scholar
Digital Library
- Robert DeLine and Manuel Fähndrich. 2001. Enforcing High-level Protocols in Low-level Software. In Proceedings of the ACM SIGPLAN 2001 Conference on Programming Language Design and Implementation (PLDI ’01). ACM, 59–69. https://doi.org/10.1145/381694.378811 Google Scholar
Digital Library
- Robert DeLine and Manuel Fähndrich. 2004. Typestates for Objects. In Object-Oriented Programming: Proceedings of the 18th European Conference on Object-Oriented Programming (ECOOP’04). Springer-Verlag, 465. https://doi.org/10.1007/978-3-540-24851-4_21 Google Scholar
Cross Ref
- Matthew Fluet, Greg Morrisett, and Amal Ahmed. 2006. Linear Regions Are All You Need. In Programming Languages and Systems, Peter Sestoft (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg. 7–21. isbn:978-3-540-33096-7 https://doi.org/10.1007/11693024_2 Google Scholar
Digital Library
- Ming Fu, Yong Li, Xinyu Feng, Zhong Shao, and Yu Zhang. 2010. Reasoning about Optimistic Concurrency Using a Program Logic for History. In In Proceedings of CONCUR. https://doi.org/10.1007/978-3-642-15375-4_27 Google Scholar
Cross Ref
- Philippa Gardner, Gian Ntzik, and Adam Wright. 2014. Local Reasoning for the POSIX File System. In ESOP. 169–188. https://doi.org/10.1007/978-3-642-54833-8_10 Google Scholar
Digital Library
- Hannah Gommerstadt, Limin Jia, and Frank Pfenning. 2018. Session-Typed Concurrent Contracts. In Programming Languages and Systems, Amal Ahmed (Ed.). Springer International Publishing, Cham. 771–798. isbn:978-3-319-89884-1 https://doi.org/10.1007/978-3-319-89884-1_27 Google Scholar
Cross Ref
- Alexey Gotsman, Noam Rinetzky, and Hongseok Yang. 2013. Verifying Concurrent Memory Reclamation Algorithms with Grace. In Proceedings of ESOP. https://doi.org/10.1007/978-3-642-37036-6_15 Google Scholar
Digital Library
- Maurice P. Herlihy and Jeannette M. Wing. 1990. Linearizability: a correctness condition for concurrent objects. ACM Trans. Program. Lang. Syst., 12, 3 (1990), July, 463–492. https://doi.org/10.1145/78969.78972 Google Scholar
Digital Library
- Kohei Honda, Vasco T. Vasconcelos, and Makoto Kubo. 1998. Language primitives and type discipline for structured communication-based programming. In Programming Languages and Systems, Chris Hankin (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg. 122–138. isbn:978-3-540-69722-0 https://doi.org/10.1007/BFb0053567 Google Scholar
Cross Ref
- Atsushi Igarashi and Naoki Kobayashi. 2002. Resource Usage Analysis. In Proceedings of the 29th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’02). ACM, 331–342. https://doi.org/10.1145/503272.503303 Google Scholar
Digital Library
- Samin S. Ishtiaq and Peter W. O’Hearn. 2001. BI As an Assertion Language for Mutable Data Structures. In Proceedings of the 28th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL’01). ACM, 14–26. https://doi.org/10.1145/360204.375719 Google Scholar
Digital Library
- Ralf Jung, David Swasey, Filip Sieczkowski, Kasper Svendsen, Aaron Turon, Lars Birkedal, and Derek Dreyer. 2015. Iris: Monoids and Invariants as an Orthogonal Basis for Concurrent Reasoning. In Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2015, Mumbai, India, January 15-17, 2015. 637–650. https://doi.org/10.1145/2676726.2676980 Google Scholar
Digital Library
- Ralf Jung, David Swasey, Filip Sieczkowski, Kasper Svendsen, Aaron Turon, Lars Birkedal, and Derek Dreyer. 2015. Iris: Monoids and Invariants as an Orthogonal Basis for Concurrent Reasoning. In Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2015, Mumbai, India, January 15-17, 2015. 637–650. https://doi.org/10.1145/2676726.2676980 Google Scholar
Digital Library
- Naoki Kobayashi. 2009. Types and Higher-order Recursion Schemes for Verification of Higher-order Programs. In Proceedings of the 36th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’09). ACM, 416–428. https://doi.org/10.1145/1480881.1480933 Google Scholar
Digital Library
- Nicolas Koh, Yao Li, Yishuai Li, Li-yao Xia, Lennart Beringer, Wolf Honoré, William Mansky, Benjamin C. Pierce, and Steve Zdancewic. 2019. From C to Interaction Trees: Specifying, Verifying, and Testing a Networked Server. In Proceedings of the 8th ACM SIGPLAN International Conference on Certified Programs and Proofs (CPP 2019). Association for Computing Machinery, New York, NY, USA. 234–248. isbn:9781450362221 https://doi.org/10.1145/3293880.3294106 Google Scholar
Digital Library
- Neelakantan R. Krishnaswami, Jonathan Aldrich, Lars Birkedal, Kasper Svendsen, and Alexandre Buisse. 2009. Design Patterns in Separation Logic. In Proceedings of the 4th International Workshop on Types in Language Design and Implementation (TLDI’09). ACM, 105–116. https://doi.org/10.1145/1481861.1481874 Google Scholar
Digital Library
- A. N. Maslov. 1976. Multilevel stack automata. Problems Inform. Transmission, 12, 1 (1976), 38–42.Google Scholar
- Karl Mazurak, Jianzhou Zhao, and Steve Zdancewic. 2010. Lightweight Linear Types in System F°. In Proceedings of the 5th ACM SIGPLAN Workshop on Types in Language Design and Implementation (TLDI ’10). Association for Computing Machinery, New York, NY, USA. 77–88. isbn:9781605588919 https://doi.org/10.1145/1708016.1708027 Google Scholar
Digital Library
- Greg Morrisett, Amal Ahmed, and Matthew Fluet. 2005. L3: A Linear Language with Locations. In Typed Lambda Calculi and Applications, Paweł Urzyczyn (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg. 293–307. isbn:978-3-540-32014-2 https://doi.org/10.1007/11417170_22 Google Scholar
Digital Library
- Nomair A Naeem and Ondrej Lhoták. 2008. Typestate-like analysis of multiple interacting objects. OOPSLA’08: Proceedings of Object-Oriented Programming, Systems, Languages and Applications, https://doi.org/10.1145/1449764.1449792 Google Scholar
Digital Library
- Matthew Parkinson and Gavin Bierman. 2005. Separation Logic and Abstraction. In Proceedings of the 32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL’05). ACM, 247–258. https://doi.org/10.1145/1040305.1040326 Google Scholar
Digital Library
- François Pottier and Jonathan Protzenko. 2015. A few lessons from the Mezzo project. In Summit oN Advances in Programming Languages (SNAPL) (Leibniz International Proceedings in Informatics, Vol. 32). Asilomar, United States. https://doi.org/10.4230/LIPIcs.SNAPL.2015.221 Google Scholar
Cross Ref
- J.C. Reynolds and G.D. Plotkin. 1993. On Functors Expressible in the Polymorphic Typed Lambda Calculus. Information and Computation, 105, 1 (1993), 1–29. https://doi.org/10.1006/inco.1993.1037 Google Scholar
Digital Library
- John C. Reynolds. 1983. Types, Abstraction and Parametric Polymorphism. In Information Processing 83. 513–523. http://www.cse.chalmers.se/edu/year/2010/course/DAT140_Types/Reynolds_typesabpara.pdfGoogle Scholar
- John C Reynolds. 2002. Separation logic: A logic for shared mutable data structures. In Proceedings of the 17th Annual IEEE Symposium on Logic in Computer Science (LICS’02). 55–74. https://doi.org/10.1109/LICS.2002.1029817 Google Scholar
Cross Ref
- Ilya Sergey, Aleksandar Nanevski, and Anindya Banerjee. 2015. Specifying and Verifying Concurrent Algorithms with Histories and Subjectivity. In Proceedings of ESOP. https://doi.org/10.1007/978-3-662-46669-8_14 Google Scholar
Digital Library
- Christian Skalka. 2008. Types and trace effects for object orientation. Higher-Order and Symbolic Computation, 21, 3 (2008), 239–282. https://doi.org/10.1007/s10990-008-9032-6 Google Scholar
Digital Library
- Christian Skalka, Scott Smith, and David Van Horn. 2008. Types and trace effects of higher order programs. Journal of Functional Programming, 18, 02 (2008), 179–249. https://doi.org/10.1017/S0956796807006466 Google Scholar
Digital Library
- Robert E Strom and Shaula Yemini. 1986. Typestate: A Programming Language Concept for Enhancing Software Reliability. IEEE Trans. Softw. Eng., 12, 1 (1986), Jan., 157–171. https://doi.org/10.1109/TSE.1986.6312929 Google Scholar
Digital Library
- Nikhil Swamy, Juan Chen, Cédric Fournet, Pierre-Yves Strub, Karthikeyan Bhargavan, and Jean Yang. 2013. Secure Distributed Programming with Value-Dependent Types. Journal of Functional Programming, 23, 4 (2013), 402–451. https://doi.org/10.1017/S0956796813000142 Google Scholar
Cross Ref
- Vasco T. Vasconcelos. 2012. Fundamentals of session types. Information and Computation, 217 (2012), 52–70. issn:0890-5401 https://doi.org/10.1016/j.ic.2012.05.002 Google Scholar
Digital Library
- Philip Wadler. 1989. Theorems for free!. 347–359. https://doi.org/10.1145/99370.99404 Google Scholar
Digital Library
- Li-yao Xia, Yannick Zakowski, Paul He, Chung-Kil Hur, Gregory Malecha, Benjamin C. Pierce, and Steve Zdancewic. 2019. Interaction Trees: Representing Recursive and Impure Programs in Coq. Proc. ACM Program. Lang., 4, POPL (2019), Article 51, Dec., 32 pages. https://doi.org/10.1145/3371119 Google Scholar
Digital Library
Index Terms
Theorems for free from separation logic specifications
Recommendations
Proof Automation for Linearizability in Separation Logic
Recent advances in concurrent separation logic enabled the formal verification of increasingly sophisticated fine-grained (i.e., lock-free) concurrent programs. For such programs, the golden standard of correctness is linearizability, which expresses ...
Transfinite Iris: resolving an existential dilemma of step-indexed separation logic
PLDI 2021: Proceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and ImplementationStep-indexed separation logic has proven to be a powerful tool for modular reasoning about higher-order stateful programs. However, it has only been used to reason about safety properties, never liveness properties. In this paper, we observe that the ...
Interactive proofs in higher-order concurrent separation logic
POPL '17: Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming LanguagesWhen using a proof assistant to reason in an embedded logic -- like separation logic -- one cannot benefit from the proof contexts and basic tactics of the proof assistant. This results in proofs that are at a too low level of abstraction because they ...






Comments