Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article
Open access

Theorems for free from separation logic specifications

Published: 19 August 2021 Publication History

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.

Supplementary Material

Auxiliary Presentation Video (icfp21main-p101-p-video.mp4)
This is a presentation video of the talk at ICFP'21 for our paper accepted in the research track. 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.
MP4 File (3473586.mp4)
Presentation Videos

References

[1]
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
[2]
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
[3]
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
[4]
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
[5]
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
[6]
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
[7]
Lars Birkedal and Aleš Bizjak. 2020. Lecture Notes on Iris: Higher-Order Concurrent Separation Log. http://iris-project.org/tutorial-pdfs/iris-lecture-notes.pdf
[8]
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
[9]
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
[10]
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
[11]
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
[12]
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
[13]
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
[14]
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
[15]
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
[16]
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
[17]
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
[18]
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
[19]
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
[20]
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
[21]
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
[22]
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
[23]
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
[24]
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
[25]
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
[26]
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
[27]
A. N. Maslov. 1976. Multilevel stack automata. Problems Inform. Transmission, 12, 1 (1976), 38–42.
[28]
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
[29]
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
[30]
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
[31]
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
[32]
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
[33]
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
[34]
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.pdf
[35]
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
[36]
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
[37]
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
[38]
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
[39]
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
[40]
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
[41]
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
[42]
Philip Wadler. 1989. Theorems for free!. 347–359. https://doi.org/10.1145/99370.99404
[43]
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

Cited By

View all
  • (2024)A Proof Recipe for Linearizability in Relaxed Memory Separation LogicProceedings of the ACM on Programming Languages10.1145/36563848:PLDI(175-198)Online publication date: 20-Jun-2024
  • (2024)A Compositional Theory of LinearizabilityJournal of the ACM10.1145/364366871:2(1-107)Online publication date: 12-Apr-2024
  • (2024)Compositional Verification of Concurrent C Programs with Search Structure TemplatesProceedings of the 13th ACM SIGPLAN International Conference on Certified Programs and Proofs10.1145/3636501.3636940(60-74)Online publication date: 9-Jan-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Proceedings of the ACM on Programming Languages
Proceedings of the ACM on Programming Languages  Volume 5, Issue ICFP
August 2021
1011 pages
EISSN:2475-1421
DOI:10.1145/3482883
Issue’s Table of Contents
This work is licensed under a Creative Commons Attribution International 4.0 License.

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 19 August 2021
Published in PACMPL Volume 5, Issue ICFP

Permissions

Request permissions for this article.

Check for updates

Badges

Author Tags

  1. Iris
  2. Linearizability
  3. Program Specifications
  4. Separation Logic

Qualifiers

  • Research-article

Funding Sources

  • VILLUM Foundation

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)191
  • Downloads (Last 6 weeks)28
Reflects downloads up to 15 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2024)A Proof Recipe for Linearizability in Relaxed Memory Separation LogicProceedings of the ACM on Programming Languages10.1145/36563848:PLDI(175-198)Online publication date: 20-Jun-2024
  • (2024)A Compositional Theory of LinearizabilityJournal of the ACM10.1145/364366871:2(1-107)Online publication date: 12-Apr-2024
  • (2024)Compositional Verification of Concurrent C Programs with Search Structure TemplatesProceedings of the 13th ACM SIGPLAN International Conference on Certified Programs and Proofs10.1145/3636501.3636940(60-74)Online publication date: 9-Jan-2024
  • (2024)The Logical Essence of Well-Bracketed Control FlowProceedings of the ACM on Programming Languages10.1145/36328628:POPL(575-603)Online publication date: 5-Jan-2024
  • (2024)Trillium: Higher-Order Concurrent and Distributed Separation Logic for Intensional RefinementProceedings of the ACM on Programming Languages10.1145/36328518:POPL(241-272)Online publication date: 5-Jan-2024
  • (2023)Conjuring Fusion Laws via Relational CalculusJournal of Information Processing10.2197/ipsjjip.31.2131(21-32)Online publication date: 2023
  • (2023)Proof Automation for Linearizability in Separation LogicProceedings of the ACM on Programming Languages10.1145/35860437:OOPSLA1(462-491)Online publication date: 6-Apr-2023
  • (2023)An Operational Approach to Library Abstraction under Relaxed Memory ConcurrencyProceedings of the ACM on Programming Languages10.1145/35712467:POPL(1542-1572)Online publication date: 11-Jan-2023
  • (2023)A Compositional Theory of LinearizabilityProceedings of the ACM on Programming Languages10.1145/35712317:POPL(1089-1120)Online publication date: 11-Jan-2023
  • (2022)Necessity specifications for robustnessProceedings of the ACM on Programming Languages10.1145/35633176:OOPSLA2(811-840)Online publication date: 31-Oct-2022
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media