Lune

POPL2023顶会

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

Pedro Abreu, Benjamin Delaware, Alex Hubers, Christa Jenkins, J. Garrett Morris, Aaron Stump

摘要

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.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

可以从这些问题问起

Lune 可以查阅

全文 · 相关的 Paper

获取答案

免费开始,无需绑卡

相关 Paper

  1. Intrinsically Correct Algorithms and Recursive CoalgebrasCass Alexandru, Henning Urbat, Thorsten WißmannPLDI 2026
  2. Phased synthesis of divide and conquer programsAzadeh Farzan, Victor NicoletPLDI 2021 · 11 次引用
  3. Synthesis with Asymptotic Resource BoundsQinheping Hu, John Cyphert, Loris D'Antoni, Thomas W. RepsCAV 2021 · 5 次引用
  4. Decomposition diversity with symmetric data and codataDavid Binder, Julian Jabs, Ingo Skupin, Klaus OstermannPOPL 2020 · 2 次引用
  5. The Essence of Generalized Algebraic Data TypesFilip Sieczkowski, Sergei Stepanenko, Jonathan Sterling, Lars BirkedalPOPL 2024 · 7 次引用
黄昏的海面,两侧是细线勾勒的悬崖