arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2512.10748cs.PLcs.LO
收藏

本质正确的算法与递归余代数

Intrinsically Correct Algorithms and Recursive Coalgebras

Radboud University Nijmegen(奈梅亨拉德堡德大学)

Cass Alexandru, Henning Urbat, Thorsten Wißmann

AI总结:

本文提出一种构建本质递归余代数的框架,通过well-founded functor概念证明递归算法的正确性,展示了Quicksort等经典算法的正式化验证。

摘要:

递归余代数提供了一种优雅的范畴工具,用于建模递归算法并分析其终止性和正确性。通过考虑在适当索引家庭的范畴上余代数,相应算法的正确性从计算映射的类型中内隐地得出。然而,证明底层余代数的递归性是非平凡的,通常需要定制证明。这种复杂性阻碍了在证明助手中的余代数定义递归算法的形式化。我们引入了一种构建余代数的框架,这些余代数本质上是递归的,即余代数的类型保证了递归性。我们的方法基于well-founded functor的新概念,基于在well-founded关系索引的范畴上的category。我们证明了主要结果:每个well-founded functor的余代数都是递归的,并展示了已知的证明递归性和终止性的技术如排名函数都被此抽象设置所涵盖。我们展示了多个案例研究,包括快速排序、欧几里得算法和CYK解析。主要理论结果和所选案例研究已在Cubical Agda中形式化。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑