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.
Supplemental Material
- 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 Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Adam Chlipala. 2008. Parametric Higher-Order Abstract Syntax for Mechanized Semantics. In Proc. ICFP. https://doi.org/10.1145/1411204.1411226 Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Cross Ref
- 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 Scholar
Cross Ref
- 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 Scholar
Digital Library
- R. Milner. 1982. A Calculus of Communicating Systems. Springer-Verlag, Berlin, Heidelberg. isbn:0387102353Google Scholar
- Robin Milner. 1999. Communicating and Mobile Systems: The π -Calculus. Cambridge University Press, USA. isbn:0521658691Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- F. Pfenning and C. Elliot. 1988. Higher-order abstract syntax. In Proc. PLDI. 199–208. https://doi.org/10.1145/53990.54010 Google Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Cross Ref
- Ilya Sergey. 2014. Programs and Proofs: Mechanizing Mathematics with Dependent Types. https://doi.org/10.5281/zenodo.4996239 Lecture notes with exercises. Google Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
Index Terms
Skipping the binder bureaucracy with mixed embeddings in a semantics course (functional pearl)
Recommendations
Programming Language Semantics with Isabelle/HOL
WEIT '13: Proceedings of the 2013 2nd Workshop-School on Theoretical Computer ScienceIsabelle is a generic meta-logical framework for implementing logical formalisms, and Isabelle/HOL is the specialization of Isabelle for HOL, which stands for Higher Order Logic. In programming language theory, formal semantics is the field concerned ...
Soundness and Completeness Proofs by Coinductive Methods
We show how codatatypes can be employed to produce compact, high-level proofs of key results in logic: the soundness and completeness of proof systems for variations of first-order logic. For the classical completeness result, we first establish an ...
Proof Pearl: a Formal Proof of Higman's Lemma in ACL2
Higman's lemma is an important result in infinitary combinatorics, which has been formalized in several theorem provers. In this paper we present a formalization and proof of Higman's Lemma in the ACL2 theorem prover. Our formalization is based on a ...






Comments