arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1309.5148cs.PLcs.SE
收藏

带有抽象解释的溢出表达式自动修复

Automatic Repair of Overflowing Expressions with Abstract Interpretation

Francesco Logozzo, Matthieu Martel

摘要:

我们考虑合成可证明非溢出整数算术表达式或整数算术表达式之间的布尔关系的问题。首先,我们使用一个数值抽象域来推断程序变量之间的数值属性。然后我们检查这些属性是否保证给定的表达式不会溢出。如果不是这种情况,我们合成一个等价的,但不溢出的表达式,或者我们报告这样的表达式不存在。非溢出表达式的合成取决于三个正交因素:输入表达式(例如,是线性的,多项式的,?),输出表达式(例如,是否允许进行情况拆分?),和底层的数值抽象域--抽象域越精确,就能合成越正确的表达式。我们考虑三种常见的情况:(i)整数系数和区间的线性表达式;(ii)线性表达式的布尔表达式;和(iii)线性表达式与模板。在第一种情况下,我们证明了存在一个完整的多项式算法来解决这个问题。在第二种情况下,我们有一个不完整的多项式算法,而在第三种情况下,我们有一个完整的,但最坏情况的指数算法。

英文摘要:

We consider the problem of synthesizing provably non-overflowing integer arithmetic expressions or Boolean relations among integer arithmetic expressions. First we use a numerical abstract domain to infer numerical properties among program variables. Then we check if those properties guarantee that a given expression does not overflow. If this is not the case, we synthesize an equivalent, yet not-overflowing expression, or we report that such an expression does not exists. The synthesis of a non-overflowing expression depends on three, orthogonal factors: the input expression (e.g., is it linear, polynomial,... ?), the output expression (e.g., are case splits allowed?), and the underlying numerical abstract domain - the more precise the abstract domain is, the more correct expressions can be synthesized. We consider three common cases: (i) linear expressions with integer coefficients and intervals; (ii) Boolean expressions of linear expressions; and (iii) linear expressions with templates. In the first case we prove there exists a complete and polynomial algorithm to solve the problem. In the second case, we have an incomplete yet polynomial algorithm, whereas in the third we have a complete yet worst-case exponential algorithm.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑