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

用于契约验证和反驳的高阶符号执行

Higher-order symbolic execution for contract verification and refutation

Phuc C. Nguyen, Sam Tobin-Hochstadt, David Van Horn

摘要:

我们提出了一种新的方法来自动推理高阶程序赋予符号执行高阶,符号值的概念。我们的方法是健全的,相对完整的一阶求解器的基本类型值。因此,它可以为高阶程序的自动验证和缺陷查找工具奠定基础。为了验证我们的方法,我们用它来开发和评估一个系统,用于验证和反驳行为的软件合同组件的功能语言,我们称之为软合同验证。在这样做的过程中,我们发现了行为契约和高阶符号执行之间的互利关系。我们的系统使用高阶符号执行,利用合同作为符号值的来源,包括未知的行为值,并采用了一个可更新的堆合同不变的原因流敏感的事实。每当一个契约被反驳时,它会报告一个具体的反例来重现错误,这可能涉及到求解一个未知函数。该方法能够分析一级契约、递归数据结构、未知函数和控制流敏感的值的细化,这些在动态语言中都是惯用的。它有效地利用了现成的求解器来解决问题,而不需要大量的编码。这种方法在它们自己的基准测试上与广泛的现有工具(包括类型系统、流分析器和模型检查器)竞争。我们已经建立了一个工具,分析Racket编写的程序,并报告其在验证和反驳合同的有效性。

英文摘要:

We present a new approach to automated reasoning about higher-order programs by endowing symbolic execution with a notion of higher-order, symbolic values. Our approach is sound and relatively complete with respect to a first-order solver for base type values. Therefore, it can form the basis of automated verification and bug-finding tools for higher-order programs. To validate our approach, we use it to develop and evaluate a system for verifying and refuting behavioral software contracts of components in a functional language, which we call soft contract verification. In doing so, we discover a mutually beneficial relation between behavioral contracts and higher-order symbolic execution. Our system uses higher-order symbolic execution, leveraging contracts as a source of symbolic values including unknown behavioral values, and employs an updatable heap of contract invariants to reason about flow-sensitive facts. Whenever a contract is refuted, it reports a concrete counterexample reproducing the error, which may involve solving for an unknown function. The approach is able to analyze first-class contracts, recursive data structures, unknown functions, and control-flow-sensitive refinements of values, which are all idiomatic in dynamic languages. It makes effective use of an off-the-shelf solver to decide problems without heavy encodings. The approach is competitive with a wide range of existing tools---including type systems, flow analyzers, and model checkers---on their own benchmarks. We have built a tool which analyzes programs written in Racket, and report on its effectiveness in verifying and refuting contracts.

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

↑