skip to main content

Dijkstra monads forever: termination-sensitive specifications for interaction trees

Published:04 January 2021Publication History
Skip Abstract Section

Abstract

This paper extends the Dijkstra monad framework, designed for writing specifications over effectful programs using monadic effects, to handle termination sensitive specifications over interactive programs. We achieve this by introducing base specification monads for non-terminating programs with uninterpreted events. We model such programs using interaction trees, a coinductive datatype for representing programs with algebraic effects in Coq, which we further develop by adding trace semantics. We show that this approach subsumes typical, simple proof principles. The framework is implemented as an extension of the Interaction Trees Coq library.

References

  1. Andrew W. Appel. 2014. Program Logics-for Certified Compilers. Cambridge University Press. http://www.cambridge.org/de/academic/subjects/computer-science/ programming-languages-and-applied-logic/programlogics-certified-compilers?format=HBGoogle ScholarGoogle Scholar
  2. Venanzio Capretta. 2005. General Recursion via Coinductive Types. Logical Methods in Computer Science 1, 2 ( 2005 ), 1-18. https://doi.org/10.2168/LMCS-1( 2 :1) 2005 Google ScholarGoogle ScholarCross RefCross Ref
  3. Quentin Carbonneaux, Jan Hofmann, Thomas Reps, and Zhong Shao. 2017. Automated resource analysis with Coq proof objects. In International Conference on Computer Aided Verification. Springer, 64-85.Google ScholarGoogle ScholarCross RefCross Ref
  4. Edsger W. Dijkstra. 1975. Guarded Commands, Nondeterminacy and Formal Derivation of Programs. Commun. ACM 18, 8 (Aug. 1975 ), 453-457. https://doi.org/10.1145/360933.360975 Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Robert W. Floyd. 1967. Assigning Meanings to Programs. Proceedings of Symposium on Applied Mathematics 19 ( 1967 ), 19-32. http://laser.cs.umass.edu/courses/cs521-621.Spr06/papers/Floyd.pdfGoogle ScholarGoogle ScholarCross RefCross Ref
  6. Ronghui Gu, Zhong Shao, Hao Chen, Jieung Kim, Jérémie Koenig, Xiongnan (Newman) Wu, Vilhelm Sjöberg, and David Costanzo. 2019. Building Certified Concurrent OS Kernels. Commun. ACM 62, 10 (Sept. 2019 ), 89-99. https://doi.org/10. 1145/3356903 Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Ronghui Gu, Zhong Shao, Hao Chen, Xiongnan (Newman) Wu, Jieung Kim, Vilhelm Sjöberg, and David Costanzo. 2016. CertiKOS: An Extensible Architecture for Building Certified Concurrent OS Kernels. In 12th USENIX Symposium on Operating Systems Design and Implementation, OSDI 2016, Savannah, GA, USA, November 2-4, 2016. 653-669. https: //www.usenix.org/conference/osdi16/technical-sessions/presentation/guGoogle ScholarGoogle ScholarDigital LibraryDigital Library
  8. C. A. R. Hoare. 1969. An Axiomatic Basis for Computer Programming. Commun. ACM 12, 10 ( 1969 ), 576-580. https: //doi.org/10.1145/363235.363259 Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Chung-Kil Hur, Georg Neis, Derek Dreyer, and Viktor Vafeiadis. 2013. The Power of Parameterization in Coinductive Proof. SIGPLAN Not. 48, 1 (Jan. 2013 ), 193-206. https://doi.org/10.1145/2480359.2429093 Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Ralf Jung, Jacques-Henri Jourdan, Robbert Krebbers, and Derek Dreyer. 2017. RustBelt: Securing the Foundations of the Rust Programming Language. Proc. ACM Program. Lang. 2, POPL, Article 66 ( Dec. 2017 ), 34 pages. https://doi.org/10. 1145/3158154 Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Ralf Jung, Robbert Krebbers, LArs Birkedal, and Derek Dreyer. 2016. Higher-order ghost state. In Proceedings of the 21st ACM SIGPLAN International Conference on Functional Programming, ICFP 2016, Nara, Japan, September 18-22, 2016, Jacques Garrigue, Gabriele Keller, and Eijiro Sumii (Eds.). ACM, 256-269. https://doi.org/10.1145/2951913.2951943 Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Leonidas Lampropoulos and Benjamin C. Pierce. 2018. QuickChick: Property-Based Testing in Coq. Electronic textbook. https://softwarefoundations.cis.upenn.edu/qc-current/index.htmlGoogle ScholarGoogle Scholar
  13. Thomas Letan, Yann Régis-Gianas, Pierre Chiflier, and Guillaume Hiet. 2018. Modular Verification of Programs with Efects and Efect Handlers in Coq. In Formal Methods-22nd International Symposium, FM 2018, Held as Part of the Federated Logic Conference, FloC 2018, Oxford, UK, July 15-17, 2018, Proceedings. 338-354. https://doi.org/10.1007/978-3-319-95582-7_20 Google ScholarGoogle ScholarCross RefCross Ref
  14. Kenji Maillard, Danel Ahman, Robert Atkey, Guido Martínez, Cătălin Hriţcu, Exequiel Rivas, and Éric Tanter. 2019. Dijkstra Monads for All. Proc. ACM Program. Lang. 3, ICFP, Article Article 104 (July 2019 ), 29 pages. https://doi.org/10.1145/3341708 Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Gregory Malecha, Greg Morrisett, and Ryan Wisnesky. 2011. Trace-based Verification of Imperative Programs with I/O. J. Symb. Comput. 46, 2 (Feb. 2011 ), 95-118. https://doi.org/10.1016/j.jsc. 2010. 08.004 Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Conor McBride. 2015. Turing-Completeness Totally Free. In Mathematics of Program Construction-12th International Conference, MPC 2015, Königswinter, Germany, June 29-July 1, 2015. Proceedings. 257-275. https://doi.org/10.1007/978-3-319-19797-5_13 Google ScholarGoogle ScholarCross RefCross Ref
  17. Aleksandar Nanevski, Greg Morrisett, and Lars Birkedal. 2006. Polymorphism and Separation in Hoare Type Theory. SIGPLAN Not. 41, 9 (Sept. 2006 ), 62-73. https://doi.org/10.1145/1160074.1159812 Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Ulf Norell. 2007. Towards a practical programming language based on dependent type theory.Google ScholarGoogle Scholar
  19. Benjamin C. Pierce, Arthur Azevedo de Amorim, Chris Casinghino, Marco Gaboardi, Michael Greenberg, Caˇtaˇlin Hriţcu, Vilhelm Sjöberg, and Brent Yorgey. 2018. Logical Foundations. Electronic textbook. Version 5.5. http://www.cis.upenn. edu/~bcpierce/sf.Google ScholarGoogle Scholar
  20. Jonathan Protzenko, Bryan Parno, Aymeric Fromherz, Chris Hawblitzel, Marina Polubelova, Karthikeyan Bhargavan, Benjamin Beurdouche, Joonwon Choi, Antoine Delignat-Lavaud, Cédric Fournet, Natalia Kulatova, Tahina Ramananandro, Aseem Rastogi, Nikhil Swamy, Christoph M. Wintersteiger, and Santiago Zanella-Beguelin. 2020. EverCrypt: A Fast, Verified, Cross-Platform Cryptographic Provider. In IEEE Symposium on Security and Privacy. IEEE. https://www. microsoft.com/en-us/research/publication/evercrypt-a-fast-verified-cross-platform-cryptographic-provider/Google ScholarGoogle Scholar
  21. Ilya Sergey, Aleksandar Nanevski, and Anindya Banerjee. 2015. Mechanized Verification of Fine-Grained Concurrent Programs. SIGPLAN Not. 50, 6 ( June 2015 ), 77-87. https://doi.org/10.1145/2813885.2737964 Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Nikhil Swamy, Juan Chen, Cédric Fournet, Pierre-Yves Strub, Karthikeyan Bhargavan, and Jean Yang. 2011. Secure distributed programming with value-dependent types. In Proceeding of the 16th ACM SIGPLAN international conference on Functional Programming, ICFP 2011, Tokyo, Japan, September 19-21, 2011. 266-278. https://doi.org/10.1145/2034773.2034811 Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Nikhil Swamy, Joel Weinberger, Cole Schlesinger, Juan Chen, and Benjamin Livshits. 2013. Verifying higher-order programs with the dijkstra monad. In ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI '13, Seattle, WA, USA, June 16-19, 2013. 387-398. https://doi.org/10.1145/2491956.2491978 Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Wouter Swierstra. 2008. Data Types à la Carte. Journal of Functional Programming 18, 4 ( 2008 ), 423-436.Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Li-yao Xia, Yannick Zakowski, Paul He, Chung-Kil Hur, Gregory Malecha, Benjamin C. Pierce, and Steve Zdancewic. 2020. Interaction Trees. Proceedings of the ACM on Programming Languages 4, POPL (Jan. 2020 ).Google ScholarGoogle Scholar

Index Terms

  1. Dijkstra monads forever: termination-sensitive specifications for interaction trees

                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!