Syntax Monads for the Working Formal Metatheorist

Lawrence Dunn
(University of Pennsylvania)
Val Tannen
(University of Pennsylvania)
Steve Zdancewic
(University of Pennsylvania)

Formally verifying the properties of formal systems using a proof assistant requires justifying numerous minor lemmas about capture-avoiding substitution. Despite work on category-theoretic accounts of syntax and variable binding, raw, first-order representations of syntax, the kind considered by many practitioners and compiler frontends, have received relatively little attention. Therefore applications miss out on the benefits of category theory, most notably the promise of reusing formalized infrastructural lemmas between implementations of different systems. Our Coq framework Tealeaves provides libraries of reusable infrastructure for a raw, locally nameless representation and can be extended to other representations in a modular fashion. In this paper we give a string-diagrammatic account of decorated traversable monads (DTMs), the key abstraction implemented by Tealeaves. We define DTMs as monoids of structured endofunctors before proving a representation theorem a la Kleisli, yielding a recursion combinator for finitary tree-like datatypes.

In Sam Staton and Christina Vasilakopoulou: Proceedings of the Sixth International Conference on Applied Category Theory 2023 (ACT 2023), University of Maryland, 31 July - 4 August 2023, Electronic Proceedings in Theoretical Computer Science 397, pp. 98–117.
Published: 14th December 2023.

ArXived at: https://dx.doi.org/10.4204/EPTCS.397.7 bibtex PDF
References in reconstructed bibtex, XML and HTML format (approximated).
Comments and questions to: eptcs@eptcs.org
For website issues: webmaster@eptcs.org