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.
Similar content being viewed by others
References
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)
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)
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)
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)
Bird, R.S., Paterson, R.: de Bruijn notation as a nested datatype. J. Funct. Program. 9(1), 77–91 (1999)
Cheney, J.: Nominal logic and abstract syntax. SIGACT News 36(4), 47–69 (2005)
Crary, K., Harper, R.: Higher-order abstract syntax: setting the record straight. SIGACT News 37(3), 93–96 (2006)
Gabbay, M., Pitts, A.M.: A new approach to abstract syntax with variable binding. Form. Asp. Comput. 13(3–5), 341–363 (2002)
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)
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))
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)
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)
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)
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)
Matthes, R.: An induction principle for nested datatypes in intensional type theory. J. Funct. Program. 19(3&4), 439–468 (2009)
The Coq development team: The Coq proof assistant reference manual. LogiCal Project. Version 8.0 (2004)
Pfenning, F., Elliott, C.: Higher-order abstract syntax. In: PLDI, pp. 199–208 (1988)
Zsidó, J.: Catégories de lambda-calculs. Ph.D. thesis, Université de Nice–Sophia Antipolis (2010)
Author information
Authors and Affiliations
Corresponding author
Rights 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
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10817-010-9207-9