同时具有势和反势的微分成本分析
Differential Cost Analysis with Simultaneous Potentials and Anti-potentials
摘要:
我们提出了一种新的方法来进行差异成本分析,给出了一个程序的修订,试图静态约束的差异,在两个程序版本之间的资源使用,或成本。差异成本分析特别有趣,因为它有许多引人注目的应用,例如在代码审查时检测资源使用回归或证明不存在某些侧通道漏洞。差异成本分析的一种现有方法是应用关系推理,该关系推理在概念上构造产品程序,在该产品程序上可以过度近似两个程序版本之间的成本差异。然而,任何关系方法中的一个重大挑战是有效地对齐程序版本以获得精确的结果。在本文中,我们的主要观点是,我们可以避免的需要和程序对齐的限制,如果相反,我们绑定的差异,而不是直接绑定的具体成本差异的两个成本约束摘要。特别是,我们的方法计算两个程序版本之间的成本的最大差异的阈值,同时使用两种成本约束摘要-一个潜在的功能,评估的上限为第一个程序中产生的成本和反潜在的功能,评估的下限为第二个程序中产生的成本。我们的方法有一些理想的属性:它可以是完全自动化的,它允许优化相对成本的阈值,它是适合的程序,是不是语法相似,它支持非确定性。我们已经评估了我们的方法的实施,从文献中收集的一些程序对,我们发现,我们的方法计算在大多数例子中的相对成本紧阈值。
英文摘要:
We present a novel approach to differential cost analysis that, given a program revision, attempts to statically bound the difference in resource usage, or cost, between the two program versions. Differential cost analysis is particularly interesting because of the many compelling applications for it, such as detecting resource-use regressions at code-review time or proving the absence of certain side-channel vulnerabilities. One prior approach to differential cost analysis is to apply relational reasoning that conceptually constructs a product program on which one can over-approximate the difference in costs between the two program versions. However, a significant challenge in any relational approach is effectively aligning the program versions to get precise results. In this paper, our key insight is that we can avoid the need for and the limitations of program alignment if, instead, we bound the difference of two cost-bound summaries rather than directly bounding the concrete cost difference. In particular, our method computes a threshold value for the maximal difference in cost between two program versions simultaneously using two kinds of cost-bound summaries -- a potential function that evaluates to an upper bound for the cost incurred in the first program and an anti-potential function that evaluates to a lower bound for the cost incurred in the second. Our method has a number of desirable properties: it can be fully automated, it allows optimizing the threshold value on relative cost, it is suitable for programs that are not syntactically similar, and it supports non-determinism. We have evaluated an implementation of our approach on a number of program pairs collected from the literature, and we find that our method computes tight threshold values on relative cost in most examples.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。