paperbot · PL 论文追踪

全部论文 待读 收藏

P2 For a Few Dollars More: Verified Fine-Grained Algorithm Analysis Down to LLVM

为了多几美元:经验证的细粒度算法分析直至 LLVM
TOPLAS 44(3)2022匹配度 2/10 · 该论文属于程序验证与复杂度分析,虽与形式化验证相关,但未涉及LLM/Agent、静态分析在ML或Agentic程序中的应用、浮点程序分析或贝叶斯程序分析,与研究画像的核心交叉方向不匹配。引用 7 inbox
Maximilian P. L. Haslbeck, Peter Lammich
crossref: 2026-09-10

AI 速览

一句话:提出基于资源货币的逐步精化框架,在 LLVM IR 上验证高效算法的功能正确性与(摊还)最坏情况复杂度。

本文提出一个验证框架,用于同时验证实际高效算法的功能正确性和(摊还)最坏情况复杂度。其核心是逐步精化方法与新提出的“资源货币”概念:资源货币让复杂度分析沿精化链自然组织,并支持对操作计数的细粒度分析。框架以 LLVM 中间表示为目标,在已有语义基础上加入代价模型。作者通过两个案例研究进行评估:动态数组 push 的摊还常数时间操作,以及 O(n log n) 的 introsort 算法,并将它们精化到高效 LLVM 实现。所得排序算法性能与 GNU C++ 标准库中的先进实现相当,且可证明满足 C++ 标准要求的复杂度。

问题
如何在一个逐步精化到 LLVM 的框架中,同时验证高效算法的功能正确性与(摊还)最坏情况复杂度,并支持细粒度操作计数。
方法
提出资源货币概念,将 LLVM IR 语义扩展为带代价模型,并在逐步精化链上组织资源与复杂度分析。
评估
以动态数组 push 摊还常数时间和 O(n log n) introsort 为案例,精化到高效 LLVM 实现;排序性能与 GNU C++ 标准库相当,并证明满足 C++ 标准复杂度。
原文摘要(Abstract)

We present a framework to verify both, functional correctness and (amortized) worst-case complexity of practically efficient algorithms. We implemented a stepwise refinement approach, using the novel concept of resource currencies to naturally structure the resource analysis along the refinement chain, and allow a fine-grained analysis of operation counts. Our framework targets the LLVM intermediate representation. We extend its semantics from earlier work with a cost model. As case studies, we verify the amortized constant time push operation on dynamic arrays and the O ( n log n ) introsort algorithm, and refine them down to efficient LLVM implementations. Our sorting algorithm performs on par with the state-of-the-art implementation found in the GNU C++ Library, and provably satisfies the complexity required by the C++ standard.

链接与引用

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

BibTeX
@article{paperbot1609,
  title = {For a Few Dollars More: Verified Fine-Grained Algorithm Analysis Down to LLVM},
  author = {Maximilian P. L. Haslbeck and Peter Lammich},
  journal = {ACM Transactions on Programming Languages and Systems},
  volume = {44},
  number = {3},
  year = {2022},
  doi = {10.1145/3486169}
}