English

Syntax Monads for the Working Formal Metatheorist

Logic in Computer Science 2023-12-15 v1 Programming Languages

Abstract

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.

Keywords

Cite

@article{arxiv.2312.08897,
  title  = {Syntax Monads for the Working Formal Metatheorist},
  author = {Lawrence Dunn and Val Tannen and Steve Zdancewic},
  journal= {arXiv preprint arXiv:2312.08897},
  year   = {2023}
}

Comments

In Proceedings ACT 2023, arXiv:2312.08138

R2 v1 2026-06-28T13:50:52.303Z