Hostname: page-component-89b8bd64d-dvtzq Total loading time: 0 Render date: 2026-05-12T13:03:15.275Z Has data issue: false hasContentIssue false

Higher order symbolic execution for contract verification and refutation*

Published online by Cambridge University Press:  21 December 2016

PHÚC C. NGUYÊN
Affiliation:
University of Maryland, College Park, Maryland, USA (e-mail: pcn@cs.umd.edu)
SAM TOBIN-HOCHSTADT
Affiliation:
Indiana University, Bloomington, Indiana, USA (e-mail: samth@cs.indiana.edu)
DAVID VAN HORN
Affiliation:
University of Maryland, College Park, Maryland, USA (e-mail: dvanhorn@cs.umd.edu)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the 'Save PDF' action button.

We present a new approach to automated reasoning about higher-order programs by endowing symbolic execution with a notion of higher-order, symbolic values. 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. Contracts aid symbolic execution by providing a rich language of specifications serving as a basis of symbolic higher-order values; the theory of blame enables modular verification and leads to the theorem that verified components can't be blamed; and the run-time monitoring of contracts enables soft verification whereby verified and unverified components can safely interact. Conversely, symbolic execution aids contracts by providing compile-time verification and automated test case generation from counter-examples to verification. This relation between symbolic exuection and contracts engenders a virtuous cycle encouraging the gradual use of contracts.

Our 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 off-the-shelf solvers to decide problems without heavy encodings. Counterexample search is sound and relatively complete with respect to a first-order solver for base type values and counter-examples are reported as concrete values, including functions. Therefore, it can form the basis of automated verification and bug-finding tools for higher-order programs. The approach is competitive with a range of existing tools—including type systems, flow analyzers, and model checkers—on their own benchmarks. We have built a prototype to analyze programs written in Racket and report on its effectiveness in verifying and refuting contracts.

Information

Type
Articles
Copyright
Copyright © Cambridge University Press 2016 
Submit a response

Discussions

No Discussions have been published for this article.