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 about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 9e218a76-5b78-42df-b012-1e03e6d2c7b8Cited 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
