paperbot · PL 论文追踪

全部论文 待读 收藏

P2 A Type-Based Approach to Divide-and-Conquer Recursion in Coq

Coq 中分治递归的基于类型的方法
POPL 7(POPL)2023匹配度 2/10 · 论文属于纯类型论与 Coq 形式化验证,研究分治递归的代数编码和终止性类型纪律,与用户关注的静态分析、LLM/Agent 交叉、浮点程序分析或贝叶斯程序分析均无直接关联;仅在“形式化验证”这一宽泛方向上略有交集。引用 0 inbox
Pedro Abreu, Benjamin Delaware, Alex Hubers, Christa Jenkins, J. Garrett Morris, Aaron Stump
crossref: 2026-09-10

AI 速览

一句话:提出一种用代数与类型纪律刻画分治递归的方法,并在 Coq 中实现验证,无需结构递归或依赖类型。

本文研究如何在 Coq 中编写并验证分治递归程序。既有工作用代数方法刻画递归方案,本文将其扩展到分治递归:把递归表示为一种代数,外层递归可以启动内层递归来构造可供外层合法递归的数据。终止性完全由递归方案的类型纪律保证,且对底层类型系统要求不高,可在 System Fω 加有限形式的正递归类型中实现。Coq 实现不依赖结构递归或依赖类型。作者用归并排序、快速排序、Harper 正则表达式匹配器等例子展示方法,并导出带索引版本,实现一种可用于推理此类函数的分治归纳。

问题
在 Coq 中编写和验证分治递归程序时,如何保证终止性并把递归模式代数化,同时避免依赖结构递归与依赖类型。
方法
将递归表示为代数,允许外层递归启动内层递归来构造数据;用递归方案的类型纪律强制终止,并给出 System Fω 加有限正递归类型的实现。
评估
在 Coq 中实现该方法,并以归并排序、快速排序、Harper 正则表达式匹配器等为例演示,另导出带索引版本支持分治归纳推理。
原文摘要(Abstract)

This paper proposes a new approach to writing and verifying divide-and-conquer programs in Coq. Extending the rich line of previous work on algebraic approaches to recursion schemes, we present an algebraic approach to divide-and-conquer recursion: recursions are represented as a form of algebra, and from outer recursions, one may initiate inner recursions that can construct data upon which the outer recursions may legally recurse. Termination is enforced entirely by the typing discipline of our recursion schemes. Despite this, our approach requires little from the underlying type system, and can be implemented in System F ω plus a limited form of positive-recursive types. Our implementation of the method in Coq does not rely on structural recursion or on dependent types. The method is demonstrated on several examples, including mergesort, quicksort, Harper’s regular-expression matcher, and others. An indexed version is also derived, implementing a form of divide-and-conquer induction that can be used to reason about functions defined via our method.

链接与引用

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

BibTeX
@article{paperbot2049,
  title = {A Type-Based Approach to Divide-and-Conquer Recursion in Coq},
  author = {Pedro Abreu and Benjamin Delaware and Alex Hubers and Christa Jenkins and J. Garrett Morris and Aaron Stump},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {7},
  number = {POPL},
  year = {2023},
  doi = {10.1145/3571196}
}