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