Hostname: page-component-74656f9884-2dmjx Total loading time: 0 Render date: 2026-11-10T14:11:52.136Z Has data issue: false hasContentIssue false

An iterative approach to precondition inference using constrained Horn clauses

Published online by Cambridge University Press:  10 August 2018

BISHOKSAN KAFLE
Affiliation:
The University of Melbourne
JOHN P. GALLAGHER
Affiliation:
Roskilde University and IMDEA Software Institute
GRAEME GANGE
Affiliation:
Monash University
PETER SCHACHTE
Affiliation:
The University of Melbourne
HARALD SØNDERGAARD
Affiliation:
The University of Melbourne
PETER J. STUCKEY
Affiliation:
The University of Melbourne
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 method for automatic inference of conditions on the initial states of a program that guarantee that the safety assertions in the program are not violated. Constrained Horn clauses (CHCs) are used to model the program and assertions in a uniform way, and we use standard abstract interpretations to derive an over-approximation of the set of unsafe initial states. The precondition then is the constraint corresponding to the complement of that set, under-approximating the set of safe initial states. This idea of complementation is not new, but previous attempts to exploit it have suffered from the loss of precision. Here we develop an iterative specialisation algorithm to give more precise, and in some cases optimal safety conditions. The algorithm combines existing transformations, namely constraint specialisation, partial evaluation and a trace elimination transformation. The last two of these transformations perform polyvariant specialisation, leading to disjunctive constraints which improve precision. The algorithm is implemented and tested on a benchmark suite of programs from the literature in precondition inference and software verification competitions.

Information

Type
Original Article
Copyright
Copyright © Cambridge University Press 2018