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

高阶程序的相对完备反例

Relatively Complete Counterexamples for Higher-Order Programs

Phuc C. Nguyen, David Van Horn

摘要:

在本文中,我们研究的问题产生的输入高阶程序导致它的错误。我们首先研究的问题,在PCF的设置,类型,核心功能语言,并贡献了第一个相对完整的方法构造反例PCF程序。该方法是相对完整的意义上的霍尔逻辑的完整性降低到一阶求解器的PCF的基本类型的完整性。在实践中,这意味着SMT求解器可以用于有效地自动生成大类程序的高阶反例。我们实现了这一结果,采用一种新的形式的符号执行高阶程序。这种符号执行的显著之处在于,即使考虑了符号高阶输入和值,路径条件仍然是一阶公式。我们的符号函数应用程序的处理,使重建高阶反例从这个一阶公式。在建立了我们的主要理论结果之后,我们概述了如何将该方法应用于具有一流合同的无类型,高阶,有状态语言,并展示了如何使用反例生成来检测这种设置中的合同违规行为。为了验证我们的方法,我们实现了一个工具生成反例错误的模块写在Racket。

英文摘要:

In this paper, we study the problem of generating inputs to a higher-order program causing it to error. We first study the problem in the setting of PCF, a typed, core functional language and contribute the first relatively complete method for constructing counterexamples for PCF programs. The method is relatively complete in the sense of Hoare logic; completeness is reduced to the completeness of a first-order solver over the base types of PCF. In practice, this means an SMT solver can be used for the effective, automated generation of higher-order counterexamples for a large class of programs. We achieve this result by employing a novel form of symbolic execution for higher-order programs. The remarkable aspect of this symbolic execution is that even though symbolic higher-order inputs and values are considered, the path condition remains a first-order formula. Our handling of symbolic function application enables the reconstruction of higher-order counterexamples from this first-order formula. After establishing our main theoretical results, we sketch how to apply the approach to untyped, higher-order, stateful languages with first-class contracts and show how counterexample generation can be used to detect contract violations in this setting. To validate our approach, we implement a tool generating counterexamples for erroneous modules written in Racket.

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

↑