Skip to main content
Log in

Nested Abstract Syntax in Coq

  • Published:
Journal of Automated Reasoning Aims and scope Submit manuscript

Abstract

We illustrate Nested Abstract Syntax as a high-level alternative representation of languages with binding constructs, based on nested datatypes. Our running example is a partial solution in the Coq proof assistant to the POPLmark Challenge. The resulting formalization is very compact and does not require any extra library or special logical apparatus. Along the way, we propose an original, high-level perspective on environments.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Altenkirch, T., Reus, B.: Monadic presentations of lambda terms using generalized inductive types. In: Flum, J., Rodríguez-Artalejo, M. (eds.) CSL. Lecture Notes in Computer Science, vol. 1683, pp. 453–468. Springer (1999)

  2. Aydemir, B., Bohannon, A., Fairbairn, M., Foster, J., Pierce, B., Sewell, P., Vytiniotis, D., Washburn, G., Weirich, S., Zdancewic, S.: Mechanized metatheory for the masses: the POPLmark challenge. In: Proceedings of the Eighteenth International Conference on Theorem Proving in Higher Order Logics (TPHOLs 2005) (2005)

  3. Aydemir, B., Charguéraud, A., Pierce, B.C., Pollack, R., Weirich, S.: Engineering formal metatheory. In: POPL ’08: Proceedings of the 35th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 3–15. ACM, New York, NY, USA (2008)

    Chapter  Google Scholar 

  4. Bird, R.S., Meertens, L.G.L.T.: Nested datatypes. In: MPC ’98: Proceedings of the Mathematics of Program Construction, pp. 52–67. Springer, London (1998)

    Chapter  Google Scholar 

  5. Bird, R.S., Paterson, R.: de Bruijn notation as a nested datatype. J. Funct. Program. 9(1), 77–91 (1999)

    Article  MathSciNet  MATH  Google Scholar 

  6. Cheney, J.: Nominal logic and abstract syntax. SIGACT News 36(4), 47–69 (2005)

    Article  Google Scholar 

  7. Crary, K., Harper, R.: Higher-order abstract syntax: setting the record straight. SIGACT News 37(3), 93–96 (2006)

    Article  Google Scholar 

  8. Gabbay, M., Pitts, A.M.: A new approach to abstract syntax with variable binding. Form. Asp. Comput. 13(3–5), 341–363 (2002)

    Article  MATH  Google Scholar 

  9. Hirschowitz, A., Maggesi, M.: Modules over monads and linearity. In: Leivant, D., de Queiroz, R.J.G.B. (eds.) WoLLIC. Lecture Notes in Computer Science, vol. 4576, pp. 218–237. Springer (2007)

  10. Hirschowitz, A., Maggesi, M.: Modules over monads and initial semantics. Inf. Comput. 208(5), 545–564 (2010) (Special Issue: 14th Workshop on Logic, Language, Information and Computation (WoLLIC 2007))

    Article  MathSciNet  MATH  Google Scholar 

  11. Honsell, F., Miculan, M., Scagnetto, I.: An axiomatic approach to metareasoning on nominal algebras in HOAS. In: Orejas, F., Spirakis, P.G., van Leeuwen, J. (eds.) ICALP. Lecture Notes in Computer Science, vol. 2076, pp. 963–978. Springer (2001)

  12. Lee, D.K., Crary, K., Harper, R.: Towards a mechanized metatheory of standard ML. In: Hofmann, M., Felleisen, M. (eds.) POPL, pp. 173–184. ACM (2007)

  13. Matthes, R.: Nested datatypes with generalized mendler iteration: map fusion and the example of the representation of untyped lambda calculus with explicit flattening. In: Audebaud, P., Paulin-Mohring, C. (eds.) International Conference on Mathematics of Program Construction (MPC), Marseille, 15/07/2008–18/07/2008. LNCS, vol. 5133, pp. 220–242. http://www.springerlink.com/. Springer (2008)

  14. Matthes, R.: Recursion on nested datatypes in dependent type theory. In: Beckmann, A., Dimitracopoulos, C., Lwe, B. (eds.) Computability in Europe Logic and Theory of Algorithms (CiE), University of Athens, 15/06/2008–20/06/2008. LNCS, vol. 5028, pp. 431–446. http://www.springerlink.com/. Springer (2008) (Confrencier invit)

  15. Matthes, R.: An induction principle for nested datatypes in intensional type theory. J. Funct. Program. 19(3&4), 439–468 (2009)

    Article  MathSciNet  MATH  Google Scholar 

  16. The Coq development team: The Coq proof assistant reference manual. LogiCal Project. Version 8.0 (2004)

  17. Pfenning, F., Elliott, C.: Higher-order abstract syntax. In: PLDI, pp. 199–208 (1988)

  18. Zsidó, J.: Catégories de lambda-calculs. Ph.D. thesis, Université de Nice–Sophia Antipolis (2010)

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Marco Maggesi.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Hirschowitz, A., Maggesi, M. Nested Abstract Syntax in Coq. J Autom Reasoning 49, 409–426 (2012). https://doi.org/10.1007/s10817-010-9207-9

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10817-010-9207-9

Keywords

Navigation