arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 1801.03967cs.PLcs.SC
收藏

多路径循环的多项式不变量生成

Invariant Generation for Multi-Path Loops with Polynomial Assignments

Andreas Humenberger, Maximilian Jaroschek, Laura Kovács

摘要:

程序分析需要生成程序属性,这些属性表示在中间程序位置保持的条件。当涉及到具有循环的程序时,这些属性通常表示为循环不变式。在本文中,我们研究了一类多路径程序循环与数值变量,特别是嵌套循环的条件,其中的分配程序变量是多项式表达式的程序变量。我们称这类循环扩展P-可解的,并介绍了一种算法,用于生成所有的多项式不变量,这样的循环。通过一个迭代过程,采用格罗布纳基计算,我们的方法计算的多项式理想的多项式不变量的每个程序路径,并结合这些理想顺序,直到达到一个固定点。这个不动点表示给定的扩展P-可解循环的所有多项式不变量的多项式理想。我们证明了我们的方法的终止,并表明达到不动点的最大迭代次数线性依赖于程序变量的数量和内部循环的数量。特别地,对于一个有m个程序变量和r个条件分支的循环,我们证明了m*r次迭代的上界。我们在Alignator软件包中实现了我们的方法。此外,我们评估了18个程序与多项式运算,并比较它与现有的方法在不变量生成。结果表明,我们的方法的效率。

英文摘要:

Program analysis requires the generation of program properties expressing conditions to hold at intermediate program locations. When it comes to programs with loops, these properties are typically expressed as loop invariants. In this paper we study a class of multi-path program loops with numeric variables, in particular nested loops with conditionals, where assignments to program variables are polynomial expressions over program variables. We call this class of loops extended P-solvable and introduce an algorithm for generating all polynomial invariants of such loops. By an iterative procedure employing Gröbner basis computation, our approach computes the polynomial ideal of the polynomial invariants of each program path and combines these ideals sequentially until a fixed point is reached. This fixed point represents the polynomial ideal of all polynomial invariants of the given extended P-solvable loop. We prove termination of our method and show that the maximal number of iterations for reaching the fixed point depends linearly on the number of program variables and the number of inner loops. In particular, for a loop with m program variables and r conditional branches we prove an upper bound of m*r iterations. We implemented our approach in the Aligator software package. Furthermore, we evaluated it on 18 programs with polynomial arithmetic and compared it to existing methods in invariant generation. The results show the efficiency of our approach.

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

↑