Formal metatheory of second-order abstract syntax
Marcelo Fiore, Dmitrij Szamozvancev
Abstract
Despite extensive research both on the theoretical and practical fronts, formalising, reasoning about, and implementing languages with variable binding is still a daunting endeavour – repetitive boilerplate and the overly complicated metatheory of capture-avoiding substitution often get in the way of progressing on to the actually interesting properties of a language. Existing developments offer some relief, however at the expense of inconvenient and error-prone term encodings and lack of formal foundations. We present a mathematically-inspired language-formalisation framework implemented in Agda. The system translates the description of a syntax signature with variable-binding operators into an intrinsically-encoded, inductive data type equipped with syntactic operations such as weakening and substitution, along with their correctness properties. The generated metatheory further incorporates metavariables and their associated operation of metasubstitution, which enables second-order equational/rewriting reasoning. The underlying mathematical foundation of the framework – initial algebra semantics – derives compositional interpretations of languages into their models satisfying the semantic substitution lemma by construction.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
3 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
Cited by top-tier papers3
- A Unified Treatment of the Substitution Tensor for Presheaves, Nominal Sets, Renaming Sets, and so onFabian Lenke, Stefan Milius, Henning UrbatLICS 2026
- Pyrosome: Verified Compilation for Modular MetatheoryDustin Jamner, Gabriel Kammer, Ritam Nag, Adam ChlipalaOOPSLA 2025
- BiSikkel: A Multimode Logical Framework in AgdaJoris Ceulemans, Andreas Nuyts, Dominique DevriesePOPL 2025
Builds on2
Related papers
- Substructural Abstract Syntax with Variable Binding and Single-Variable SubstitutionMarcelo Fiore, Sanjiv RanchodLICS 2025 · 3 citations
- Intrinsic Verification of Parsers and Formal Grammar Theory in Dependent Lambek CalculusSteven Schaefer, Nathan Varner, Pedro Henrique Azevedo de Amorim, Max S. NewPLDI 2025
- Contract System Metatheories à la Carte: A Transition-System View of ContractsShu-Hung You, Christos Dimoulas, Robert Bruce FindlerOOPSLA 2025
- Intrinsically typed compilation with nameless labelsArjen Rouvoet, Robbert Krebbers, Eelco VisserPOPL 2021 · 5 citations
- Contextual Embeddings: Implementing Bound Variables through Instance ResolutionSamantha Frohlich, Jessica Foster, G. A. Kavvos, Meng WangPLDI 2026
