paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Intrinsically Correct Algorithms and Recursive Coalgebras

内在正确的算法与递归余代数
PLDI 10(PLDI)2026匹配度 2/10 · 该论文属于纯范畴论/形式语义与定理证明工程,讨论递归余代数的内在正确性与终止性,并在 Cubical Agda 中形式化;它与用户核心方向(LLM/Agent 与静态分析/形式化验证的交叉、浮点程序分析、贝叶斯程序分析)没有直接关联,仅与形式化验证基础有非常间接的关系。引用 0 inbox
Cass Alexandru, Henning Urbat, Thorsten Wißmann
crossref: 2026-09-10

AI 速览

一句话:提出 well-founded functor 框架,使余代数的类型自动保证递归性,从而内在获得算法正确性与终止性。

递归余代数用范畴工具建模递归算法并分析终止性与正确性:在合适索引族范畴上,算法正确性可由计算映射的类型内在推出。但证明底层余代数的递归性通常不平凡,且多为特设证明,阻碍其在证明助手中形式化。本文提出构造“内在递归”余代数的框架,核心是良基关系索引族范畴上的良基函子。主要结果证明良基函子的任意余代数都是递归的,并表明 ranking function 等经典终止性证明技术可被该抽象框架涵盖。作者以 Quicksort、Euclidean algorithm 和 CYK parsing 为例,并在 Cubical Agda 中形式化了主定理与部分案例。

问题
证明递归余代数的递归性通常依赖特设论证,难以在证明助手中形式化;论文要为其提供类型即保证递归性的统一范畴框架。
方法
引入以良基关系索引的族范畴上的良基函子概念,并证明良基函子的任意余代数都是递归的,从而涵盖 ranking function 等终止性技术。
评估
通过 Quicksort、Euclidean algorithm 与 CYK parsing 等案例研究验证框架,并在 Cubical Agda 中形式化主定理和部分案例。
原文摘要(Abstract)

Recursive coalgebras provide an elegant categorical tool for modelling recursive algorithms and analysing their termination and correctness. By considering coalgebras over categories of suitably indexed families, the correctness of the corresponding algorithms follows intrinsically just from the type of the computed maps. However, proving recursivity of the underlying coalgebras is non-trivial, and proofs are typically ad hoc. This layer of complexity impedes the formalization of coalgebraically defined recursive algorithms in proof assistants. We introduce a framework for constructing coalgebras which are intrinsically recursive in the sense that the type of the coalgebra guarantees recursivity from the outset. Our approach is based on the novel concept of a well-founded functor on a category of families indexed by a well-founded relation. We show as our main result that every coalgebra for a well-founded functor is recursive, and demonstrate that well-known techniques for proving recursivity and termination such as ranking functions are subsumed by this abstract setup. We present a number of case studies, including Quicksort, the Euclidian algorithm, and CYK parsing. Both the main theoretical result and selected case studies have been formalized in Cubical Agda.

链接与引用

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

BibTeX
@article{paperbot3756,
  title = {Intrinsically Correct Algorithms and Recursive Coalgebras},
  author = {Cass Alexandru and Henning Urbat and Thorsten Wißmann},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {10},
  number = {PLDI},
  year = {2026},
  doi = {10.1145/3808309}
}