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

一种反例引导的数值不变量求法

A Counterexample-guided Approach to Finding Numerical Invariants

ThanhVu Nguyen, Timos Antopoulos, Andrew Ruef, Michael Hicks

摘要:

数值不变量,例如,程序中数值变量之间的关系,代表了分析程序的一类有用的属性。一般多项式不变量表示更复杂的数值关系,但在许多科学和工程应用中经常需要它们。我们提出了NumInv,一个工具,实现了一个反例引导的不变生成(CEGIR)技术,自动发现数值不变,这是多项式的等式和不等式之间的关系数值变量。这种CEGIR技术从程序跟踪中推断候选不变量,然后使用KLEE测试输入生成工具对程序源代码进行检查。如果不变量不正确,KLEE返回反例迹,这有助于动态推理获得更好的结果。现有的CEGIR方法通常需要声音不变量,然而NumInv牺牲了可靠性并产生KLEE在一定时间范围内无法反驳的结果。这种设计和使用KLEE作为验证器允许NumInv为许多具有挑战性的程序发现有用和重要的数值不变量。初步结果表明,NumInv生成所需的不变量,用于理解和验证涉及复杂算术的程序的正确性。我们还表明,NumInv发现多项式不变量,捕捉精确的复杂性边界的程序用于基准现有的静态复杂性分析技术。最后,我们表明,NumInv执行竞争力相比,最先进的数值不变分析工具。

英文摘要:

Numerical invariants, e.g., relationships among numerical variables in a program, represent a useful class of properties to analyze programs. General polynomial invariants represent more complex numerical relations, but they are often required in many scientific and engineering applications. We present NumInv, a tool that implements a counterexample-guided invariant generation (CEGIR) technique to automatically discover numerical invariants, which are polynomial equality and inequality relations among numerical variables. This CEGIR technique infers candidate invariants from program traces and then checks them against the program source code using the KLEE test-input generation tool. If the invariants are incorrect KLEE returns counterexample traces, which help the dynamic inference obtain better results. Existing CEGIR approaches often require sound invariants, however NumInv sacrifices soundness and produces results that KLEE cannot refute within certain time bounds. This design and the use of KLEE as a verifier allow NumInv to discover useful and important numerical invariants for many challenging programs. Preliminary results show that NumInv generates required invariants for understanding and verifying correctness of programs involving complex arithmetic. We also show that NumInv discovers polynomial invariants that capture precise complexity bounds of programs used to benchmark existing static complexity analysis techniques. Finally, we show that NumInv performs competitively comparing to state of the art numerical invariant analysis tools.

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

↑