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

用变换法生成程序验证中的循环不变式

Generating Loop Invariants for Program Verification by Transformation

G. W. Hamilton

摘要:

循环不变量在命令式程序的验证中起着核心作用。然而,找到这些不变量对于程序员来说通常是一项困难且耗时的任务。我们以前已经展示了如何程序转换可以用来促进功能程序的验证,但由于需要发现这些循环不变量,命令式程序的验证更具挑战性。在本文中,我们描述了一种自动发现循环不变量的技术。我们的方法类似于归纳迭代法,但避免了使用这种方法和其他方法时可能导致的子句中的潜在指数爆破。我们的方法利用了简化程序转换算法将子句转换为简化形式,便于识别它们之间的相似性和差异性,从而帮助发现不变量。我们证明,我们的技术终止,并证明其成功的应用程序,已被证明是有问题的使用其他方法的例子。我们还讨论了我们的技术未能找到一个不变的情况下,并显示如何可以改善到一定程度。

英文摘要:

Loop invariants play a central role in the verification of imperative programs. However, finding these invariants is often a difficult and time-consuming task for the programmer. We have previously shown how program transformation can be used to facilitate the verification of functional programs, but the verification of imperative programs is more challenging due to the need to discover these loop invariants. In this paper, we describe a technique for automatically discovering loop invariants. Our approach is similar to the induction-iteration method, but avoids the potentially exponential blow-up in clauses that can result when using this and other methods. Our approach makes use of the distil- lation program transformation algorithm to transform clauses into a simplified form that facilitates the identification of similarities and differences between them and thus help discover invariants. We prove that our technique terminates, and demonstrate its successful application to example programs that have proven to be problematic using other approaches. We also characterise the situations where our technique fails to find an invariant, and show how this can be ameliorated to a certain extent.

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

↑