paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Formal metatheory of second-order abstract syntax

二阶抽象语法的形式化元理论
POPL 6(POPL)2022匹配度 2/10 · 论文属于形式语义与证明工程,围绕 Agda 中带变量绑定和二阶替换的语言元理论,与用户核心方向(LLM/Agent 与静态分析/形式化验证交叉、浮点程序分析、贝叶斯程序分析)没有直接关联。它不涉及 LLM/Agent,也不针对工业落地、benchmark 或程序分析任务。引用 20 inbox
Marcelo Fiore, Dmitrij Szamozvancev
crossref: 2026-09-10

AI 速览

一句话:在 Agda 中基于初始代数语义自动生成带变量绑定与二阶替换的语言元理论框架。

该论文针对带变量绑定的语言在形式化、推理与实现中长期存在的重复样板和捕获避免替换元理论过于复杂的问题,提出一个受数学启发的语言形式化框架,并在 Agda 中实现。框架将带绑定算子的语法签名描述翻译为内在编码的归纳数据类型,自动配备 weakening、substitution 等语法操作及其正确性性质,并进一步集成 metavariable 与 metasubstitution,从而支持二阶等式与重写推理。其数学基础是初始代数语义,能够按构造导出语言的组合语义解释,并保证其模型满足语义替换引理。相较既有方案,该工作避免了不便且易错的项编码,同时提供了形式化基础。

问题
带变量绑定的语言在形式化与推理时,捕获避免替换的元理论繁琐复杂,现有方案常依赖不便且易错的项编码,且缺乏形式基础。
方法
在 Agda 中实现基于初始代数语义的框架,将带绑定算子的语法签名翻译为内在编码的归纳数据类型,自动生成 weaken、substitution 及正确性性质,并支持 metavariable 与 metasubstitution 以进行二阶等式/重写推理。
评估
通过 Agda 实现及生成的元理论展示框架可用性:语法操作与其正确性性质随数据类型自动产生,且语义替换引理由构造保证,从而支持组合式语义解释。
原文摘要(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.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot1577,
  title = {Formal metatheory of second-order abstract syntax},
  author = {Marcelo Fiore and Dmitrij Szamozvancev},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {6},
  number = {POPL},
  year = {2022},
  doi = {10.1145/3498715}
}