差异约束:命令式程序复杂性分析的充分抽象
Difference Constraints: An adequate Abstraction for Complexity Analysis of Imperative Programs
摘要:
差分约束在文献中已被用于终止分析,其中它们表示形式为x' <= y + c的关系不等式,并且描述当前状态中x的值至多是前一状态中y的值加上某个整数常数c。在本文中,我们认为,命令式程序的复杂性通常来自计数器的增量和重置,这可以自然地建模的差异约束。本文提出了分析差分约束程序的第一个实用算法,并描述了如何将C程序抽象为差分约束程序。我们的方法有助于自动化的复杂性和(资源)约束分析领域,使自动摊销的复杂性分析的一类新的程序,并提供一个概念上简单的程序模型,涉及不变和约束分析。我们证明了我们的方法的有效性,通过一个彻底的实验比较真实世界的C代码:我们的工具Loopus计算的复杂性相当多的功能,在更短的时间比相关的工具从文献。
英文摘要:
Difference constraints have been used for termination analysis in the literature, where they denote relational inequalities of the form x' <= y + c, and describe that the value of x in the current state is at most the value of y in the previous state plus some integer constant c. In this paper, we argue that the complexity of imperative programs typically arises from counter increments and resets, which can be modeled naturally by difference constraints. We present the first practical algorithm for the analysis of difference constraint programs and describe how C programs can be abstracted to difference constraint programs. Our approach contributes to the field of automated complexity and (resource) bound analysis by enabling automated amortized complexity analysis for a new class of programs and providing a conceptually simple program model that relates invariant- and bound analysis. We demonstrate the effectiveness of our approach through a thorough experimental comparison on real world C code: our tool Loopus computes the complexity for considerably more functions in less time than related tools from the literature.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。