paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Runtime Complexity Bounds Using Squeezers

使用 Squeezers 的运行时复杂度上界
TOPLAS 44(3)2022匹配度 3/10 · 该论文属于程序分析与抽象解释中的运行时复杂度上界分析,与静态分析基础相关,但未涉及用户画像核心关注的 LLM/Agentic 程序分析、浮点程序分析或贝叶斯程序分析等交叉方向。引用 1 inbox
Oren Ish-Shalom, Shachar Itzhaky, Noam Rinetzky, Sharon Shoham
crossref: 2026-09-10

AI 速览

一句话:提出基于 squeezers 的迹比较方法,为现有代价分析难以处理的程序推导更紧的运行时上界。

自动推导程序时间复杂度的上界在性能调试、资源认证和编译优化中十分重要。现有代价分析技术擅长处理整数和线性算术,但当复杂度更精细地依赖执行期间的数据演化时,往往只能给出松界甚至无界。本文提出一种新方法,推广基于 ranking function 的递推关系:不展开单次循环迭代去分析中间状态,而是将整条执行迹与更低 rank 的整条执行迹进行比较来推导递推式。作者定义了一组关于整条迹的全局性质,并表明这些性质可通过少量局部条件高效检查;为此,他们适配了原本用于安全性验证的 state squeezers 归纳机制。评估表明,该方法涵盖 bounded unfolding 的推理能力,并能解决基于 cost relations 和控制流分析的工具无法处理的复杂例子。

问题
自动分析程序运行时上界时,若复杂度依赖执行中数据的复杂演化,现有基于整数和线性算术的代价分析工具会产生松界或无界。
方法
推广基于 ranking function 的递推关系,通过比较整条执行迹与更低 rank 的执行迹来推导递推式,并用整条迹的全局性质及少量局部条件进行检查,复用 state squeezers 归纳机制。
评估
通过示例展示该方法涵盖 bounded unfolding 的推理能力,并能解决现有基于 cost relations 和控制流分析的工具失败的复杂程序。
原文摘要(Abstract)

Determining upper bounds on the time complexity of a program is a fundamental problem with a variety of applications, such as performance debugging, resource certification, and compile-time optimizations. Automated techniques for cost analysis excel at bounding the resource complexity of programs that use integer values and linear arithmetic. Unfortunately, they fall short when the complexity depends more intricately on the evolution of data during execution. In such cases, state-of-the-art analyzers have shown to produce loose bounds, or even no bound at all. We propose a novel technique that generalizes the common notion of recurrence relations based on ranking functions. Existing methods usually unfold one loop iteration and examine the resulting arithmetic relations between variables. These relations assist in establishing a recurrence that bounds the number of loop iterations. We propose a different approach, where we derive recurrences by comparing whole traces with whole traces of a lower rank, avoiding the need to analyze the complexity of intermediate states. We offer a set of global properties, defined with respect to whole traces, that facilitate such a comparison and show that these properties can be checked efficiently using a handful of local conditions. To this end, we adapt state squeezers , an induction mechanism previously used for verifying safety properties. We demonstrate that this technique encompasses the reasoning power of bounded unfolding, and more. We present some seemingly innocuous, yet intricate, examples that previous tools based on cost relations and control flow analysis fail to solve, and that our squeezer-powered approach succeeds.

链接与引用

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

BibTeX
@article{paperbot1610,
  title = {Runtime Complexity Bounds Using Squeezers},
  author = {Oren Ish-Shalom and Shachar Itzhaky and Noam Rinetzky and Sharon Shoham},
  journal = {ACM Transactions on Programming Languages and Systems},
  volume = {44},
  number = {3},
  year = {2022},
  doi = {10.1145/3527632}
}