paperbot · PL 论文追踪

全部论文 待读 收藏

P2 2-Functoriality of Initial Semantics, and Applications

初始语义的 2-函子性及其应用
ICFP 9(ICFP)2025匹配度 2/10 · 论文属于纯范畴论/形式语义方向,研究变量绑定表示与初始语义的2-范畴结构,与用户关注的静态分析、Agentic 程序、浮点/贝叶斯程序分析及其与 LLM 的交叉均无直接关系。仅在“形式化”这一宽泛层面与 PL 理论相关,但未涉及 AI 或程序分析工具落地。引用 0 inbox
Benedikt Ahrens, Ambroise Lafont, Thomas Lamiaux
crossref: 2026-09-10

AI 速览

一句话:证明以 monoidal 范畴为参数的初始语义具有 2-范畴结构,并据此关联不同变量绑定表示下的模型。

初始语义为归纳结构及其性质提供递归原理,但对带变量绑定与替换的语言,不同上下文与自由变量表示(如 unscoped、well-scoped、de Bruijn、locally nameless、有限或无限上下文)对应不同的 monoidal 范畴,从而对同一签名给出不同模型,难以比较。本文证明:以 monoidal 范畴为参数的初始语义自然具有 2-范畴结构;当这些范畴之间存在关系时,可诱导相应初始模型之间的关系。作者据此关联 de Bruijn 与 locally nameless、有限与无限上下文等实现所得到的模型,并给出 simply-typed 语法的广义递归原理。

问题
同一抽象签名在采用不同上下文/自由变量表示(unscoped、well-scoped、de Bruijn、locally nameless、有限/无限上下文)时会产生不同的初始语义模型,如何比较与关联这些模型?
方法
把初始语义参数化于建模上下文与绑定的 monoidal 范畴,证明该构造具有 2-范畴结构,从而在 monoidal 范畴相关时导出对应模型之间的关系。
评估
将理论应用于关联 de Bruijn 与 locally nameless、有限与无限上下文等实现得到的模型,并给出 simply-typed 语法的广义递归原理。
原文摘要(Abstract)

Initial semantics aims to model inductive structures and their properties, and to provide them with recursion principles respecting these properties. An ubiquitous example is the fold operator for lists. We are concerned with initial semantics that model languages with variable binding and their substitution structure, and that provide substitution-safe recursion principles. There are different approaches to implementing languages with variable binding depending on the choice of representation for contexts and free variables, such as unscoped syntax, or well-scoped syntax with finite or infinite contexts. Abstractly, each approach corresponds to choosing a different monoidal category to model contexts and binding, each choice yielding a different notion of “model” for the same abstract specification (or “signature”). In this work, we provide tools to compare and relate the models obtained from a signature for different choices of monoidal category. We do so by showing that initial semantics naturally has a 2-categorical structure when parametrized by the monoidal category modeling contexts. We thus can relate models obtained from different choices of monoidal categories provided the monoidal categories themselves are related. In particular, we use our results to relate the models of the different implementation — de Bruijn vs locally nameless, finite vs infinite contexts —, and to provide a generalized recursion principle for simply-typed syntax.

链接与引用

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

BibTeX
@article{paperbot3042,
  title = {2-Functoriality of Initial Semantics, and Applications},
  author = {Benedikt Ahrens and Ambroise Lafont and Thomas Lamiaux},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {9},
  number = {ICFP},
  year = {2025},
  doi = {10.1145/3747527}
}