paperbot · PL 论文追踪

全部论文 待读 收藏

P2 A greedy algorithm for dropping digits

一种删除数字的贪心算法
JFP vol.312021匹配度 2/10 · 该论文属于形式化推导与证明工程(谓词逻辑、依赖类型证明助手、等式推理),虽与形式化验证沾边,但完全不涉及 LLM/Agent、静态分析、浮点或贝叶斯程序分析,也未针对某类程序/benchmark 指出失效原因,与用户画像的核心交叉方向基本无关。引用 1 inbox
RICHARD BIRD, SHIN-CHENG MU
crossref: 2026-09-10

AI 速览

一句话:通过谓词逻辑、依赖类型证明助手和等式推理,系统推导出删除 k 位数字使结果最大的线性时间贪心算法。

论文研究一个经典谜题:给定一个十进制数,删除 k 个数字,使剩余数字按原序组成的新数尽可能大。作者采用程序计算与证明相结合的方法:先用谓词逻辑论证贪心算法的整体结构,说明为何逐步删除局部最差数字可得到全局最优;再在依赖类型证明助手中构造性地证明贪心条件成立;最后通过等式推理推导出单步贪心操作,并将算法优化为线性时间。该工作展示了如何从逻辑规约与构造性证明出发,严谨地推导出高效贪心算法,而无需依赖非形式化论证。

问题
给定十进制数,删除 k 位后保持原序,使所得数最大;要求给出正确且高效的算法。
方法
用谓词逻辑刻画并论证贪心结构,在依赖类型证明助手中构造性证明贪心条件,并通过等式推理计算贪心步与线性时间优化。
评估
以形式化证明和等式推导为主,论证所得算法正确且具有线性时间复杂度;未报告大规模实验。
原文摘要(Abstract)

Abstract Consider the following puzzle: given a number, remove k digits such that the resulting number is as large as possible. Various techniques are employed to derive a linear-time solution to the puzzle: we justify the structure of a greedy algorithm by predicate logic, give a constructive proof of the greedy condition using a dependently typed proof assistant and calculate the greedy step as well as the final, linear-time optimisation by equational reasoning.

链接与引用

DOI 原文 ·

BibTeX
@article{paperbot1225,
  title = {A greedy algorithm for dropping digits},
  author = {RICHARD BIRD and SHIN-CHENG MU},
  journal = {Journal of Functional Programming},
  volume = {31},
  year = {2021},
  doi = {10.1017/s0956796821000198}
}