skip to main content

Skipping the binder bureaucracy with mixed embeddings in a semantics course (functional pearl)

Published:19 August 2021Publication History
Skip Abstract Section

Abstract

Rigorous reasoning about programs calls for some amount of bureaucracy in managing details like variable binding, but, in guiding students through big ideas in semantics, we might hope to minimize the overhead. We describe our experiment introducing a range of such ideas, using the Coq proof assistant, without any explicit representation of variables, instead using a higher-order syntax encoding that we dub "mixed embedding": it is neither the fully explicit syntax of deep embeddings nor the syntax-free programming of shallow embeddings. Marquee examples include different takes on concurrency reasoning, including in the traditions of model checking (partial-order reduction), program logics (concurrent separation logic), and type checking (session types) -- all presented without any side conditions on variables.

Skip Supplemental Material Section

Supplemental Material

Auxiliary Presentation Video

This is a presentation for the ICFP 2021 paper "Skipping the Binder Bureaucracy with Mixed Embeddings in a Semantics Course," whose abstract is: Rigorous reasoning about programs calls for some amount of bureaucracy in managing details like variable binding, but, in guiding students through big ideas in semantics, we might hope to minimize the overhead. We describe our experiment introducing a range of such ideas, using the Coq proof assistant, without any explicit representation of variables, instead using a higher-order syntax encoding that we dub "mixed embedding": it is neither the fully explicit syntax of deep embeddings nor the syntax-free programming of shallow embeddings. Marquee examples include different takes on concurrency reasoning, including in the traditions of model checking (partial-order reduction), program logics (concurrent separation logic), and type checking (session types) -- all presented without any side conditions on variables.

3473599.mp4

Presentation Videos

References

  1. Brian Aydemir, Arthur Charguéraud, Benjamin C. Pierce, Randy Pollack, and Stephanie Weirich. 2008. Engineering formal metatheory. In Proc. POPL. 3–15. https://doi.org/10.1145/1328438.1328443 Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Hendrik Pieter Barendregt. 1985. The lambda calculus - its syntax and semantics (Studies in logic and the foundations of mathematics, Vol. 103). North-Holland. isbn:978-0-444-86748-3Google ScholarGoogle Scholar
  3. Richard J. Boulton, Andrew Gordon, Michael J. C. Gordon, John Harrison, John Herbert, and John Van Tassel. 1992. Experience with Embedding Hardware Description Languages in HOL. In Proceedings of the IFIP TC10/WG 10.2 International Conference on Theorem Provers in Circuit Design: Theory, Practice and Experience. North-Holland Publishing Co., NLD. 129–156. isbn:0444896864Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. H. Chen, D. Ziegler, T. Chajed, A. Chlipala, M. F. Kaashoek, and N. Zeldovich. 2015. Using Crash Hoare Logic for Certifying the FSCQ File System. In Proc. SOSP. https://doi.org/10.1145/2815400.2815402 Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Adam Chlipala. 2008. Parametric Higher-Order Abstract Syntax for Mechanized Semantics. In Proc. ICFP. https://doi.org/10.1145/1411204.1411226 Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Adam Chlipala, Gregory Malecha, Greg Morrisett, Avraham Shinnar, and Ryan Wisnesky. 2009. Effective Interactive Proofs for Higher-Order Imperative Programs. In Proc. ICFP. https://doi.org/10.1145/1596550.1596565 Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Nicolas G. de Bruijn. 1972. Lambda-calculus notation with nameless dummies: a tool for automatic formal manipulation with application to the Church-Rosser theorem. Indag. Math., 34(5) (1972), 381–392.Google ScholarGoogle Scholar
  8. Patrice Godefroid, J. van Leeuwen, J. Hartmanis, G. Goos, and Pierre Wolper. 1996. Partial-Order Methods for the Verification of Concurrent Systems: An Approach to the State-Explosion Problem. Springer-Verlag, Berlin, Heidelberg. isbn:3540607617Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Andrew D. Gordon. 1993. An Operational Semantics for I/O in a Lazy Functional Language. In Proceedings of the Conference on Functional Programming Languages and Computer Architecture (FPCA ’93). Association for Computing Machinery, New York, NY, USA. 136–145. isbn:089791595X https://doi.org/10.1145/165180.165199 Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Robert Harper, Furio Honsell, and Gordon D. Plotkin. 1987. A Framework for Defining Logics. In Proceedings of the Symposium on Logic in Computer Science (LICS ’87), Ithaca, New York, USA, June 22-25, 1987. IEEE Computer Society, 194–204.Google ScholarGoogle Scholar
  11. C. A. R. Hoare. 1969. An Axiomatic Basis for Computer Programming. Commun. ACM, 12, 10 (1969), Oct., 576–580. issn:0001-0782 https://doi.org/10.1145/363235.363259 Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Kohei Honda. 1993. Types for dyadic interaction. In CONCUR’93, Eike Best (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg. 509–523. isbn:978-3-540-47968-0 https://doi.org/10.1007/3-540-57208-2_35 Google ScholarGoogle ScholarCross RefCross Ref
  13. Furio Honsell, Marino Miculan, and Ivan Scagnetto. 2001. An Axiomatic Approach to Metareasoning on Nominal Algebras in HOAS. In Proc. ICALP. 963–978. https://doi.org/10.1007/3-540-48224-5_78 Google ScholarGoogle ScholarCross RefCross Ref
  14. Furio Honsell, Marino Miculan, and Ivan Scagnetto. 2001. π -Calculus in (Co)Inductive-Type Theory. Theor. Comput. Sci., 253, 2 (2001), Feb., 239–285. issn:0304-3975 https://doi.org/10.1016/S0304-3975(00)00095-5 Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. R. Milner. 1982. A Calculus of Communicating Systems. Springer-Verlag, Berlin, Heidelberg. isbn:0387102353Google ScholarGoogle Scholar
  16. Robin Milner. 1999. Communicating and Mobile Systems: The π -Calculus. Cambridge University Press, USA. isbn:0521658691Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Aleksandar Nanevski, Greg Morrisett, Avraham Shinnar, Paul Govereau, and Lars Birkedal. 2008. Ynot: Dependent Types for Imperative Programs. In Proceedings of the 13th ACM SIGPLAN International Conference on Functional Programming (ICFP ’08). Association for Computing Machinery, New York, NY, USA. 229–240. isbn:9781595939197 https://doi.org/10.1145/1411204.1411237 Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Tobias Nipkow and Gerwin Klein. 2014. Concrete Semantics: With Isabelle/HOL. Springer Publishing Company, Incorporated. isbn:3319105418 https://doi.org/10.1007/978-3-319-10542-0 Google ScholarGoogle ScholarCross RefCross Ref
  19. Peter W. O’Hearn. 2007. Resources, concurrency, and local reasoning. Theor. Comput. Sci., 375, 1-3 (2007), 271–307. https://doi.org/10.1016/j.tcs.2006.12.035 Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Simon L. Peyton Jones and Philip Wadler. 1993. Imperative Functional Programming. In Proceedings of the 20th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’93). Association for Computing Machinery, New York, NY, USA. 71–84. isbn:0897915607 https://doi.org/10.1145/158511.158524 Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. F. Pfenning and C. Elliot. 1988. Higher-order abstract syntax. In Proc. PLDI. 199–208. https://doi.org/10.1145/53990.54010 Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Benjamin C. Pierce, Arthur Azevedo de Amorim, Chris Casinghino, Marco Gaboardi, Michael Greenberg, Cǎtǎlin Hriţcu, Vilhelm Sjöberg, Andrew Tolmach, and Brent Yorgey. 2018. Programming Language Foundations. Electronic textbook.Google ScholarGoogle Scholar
  23. Andrew M. Pitts. 2003. Nominal logic, a first order theory of names and binding. Information and Computation, 186, 2 (2003), 165–193. issn:0890-5401 https://doi.org/10.1016/S0890-5401(03)00138-X Theoretical Aspects of Computer Software (TACS 2001). Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. John C. Reynolds. 2002. Separation Logic: A Logic for Shared Mutable Data Structures. In Proc. LICS. https://doi.org/10.1109/LICS.2002.1029817 Google ScholarGoogle ScholarCross RefCross Ref
  25. Ilya Sergey. 2014. Programs and Proofs: Mechanizing Mathematics with Dependent Types. https://doi.org/10.5281/zenodo.4996239 Lecture notes with exercises. Google ScholarGoogle ScholarCross RefCross Ref
  26. A.K. Wright and M. Felleisen. 1994. A Syntactic Approach to Type Soundness. Inf. Comput., 115, 1 (1994), Nov., 38–94. issn:0890-5401 https://doi.org/10.1006/inco.1994.1093 Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Li-yao Xia, Yannick Zakowski, Paul He, Chung-Kil Hur, Gregory Malecha, Benjamin C. Pierce, and Steve Zdancewic. 2020. Interaction trees: representing recursive and impure programs in Coq. Proc. ACM Program. Lang., 4, POPL (2020), 51:1–51:32. https://doi.org/10.1145/3371119 Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Skipping the binder bureaucracy with mixed embeddings in a semantics course (functional pearl)

      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!