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

表示不变量的数据驱动推理

Data-Driven Inference of Representation Invariants

Anders Miltner, Saswat Padhi, Todd Millstein, David Walker

摘要:

表示不变式是一个属性,它保存了由模块产生的所有抽象类型的值。表示不变量在软件工程和程序验证中起着重要的作用。在本文中,我们开发了一个反例驱动的算法,用于推断一个表示不变,这是足以暗示一个模块所需的规范。关键的新颖性是一个类型导向的概念,可见的诱导性,这确保了算法朝着它的目标,因为它之间交替削弱和加强候选不变。该算法是参数化的基于示例的合成引擎和验证器,我们证明了它是健全的和完整的有限类型的一阶模块,假设合成器和验证器以及。我们在一个名为Hanoi的工具中实现了这些想法,该工具可以合成递归数据类型的表示不变量。Hanoi不仅处理一阶代码的不变量,还处理高阶代码的不变量。在其后端,Hanoi使用一个名为Myth的枚举合成器和一个枚举测试工具作为验证器。由于河内使用测试进行验证,它并不健全,尽管我们的经验评估表明,它在我们调查的基准上是成功的。

英文摘要:

A representation invariant is a property that holds of all values of abstract type produced by a module. Representation invariants play important roles in software engineering and program verification. In this paper, we develop a counterexample-driven algorithm for inferring a representation invariant that is sufficient to imply a desired specification for a module. The key novelty is a type-directed notion of visible inductiveness, which ensures that the algorithm makes progress toward its goal as it alternates between weakening and strengthening candidate invariants. The algorithm is parameterized by an example-based synthesis engine and a verifier, and we prove that it is sound and complete for first-order modules over finite types, assuming that the synthesizer and verifier are as well. We implement these ideas in a tool called Hanoi, which synthesizes representation invariants for recursive data types. Hanoi not only handles invariants for first-order code, but higher-order code as well. In its back end, Hanoi uses an enumerative synthesizer called Myth and an enumerative testing tool as a verifier. Because Hanoi uses testing for verification, it is not sound, though our empirical evaluation shows that it is successful on the benchmarks we investigated.

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

↑