Counterexample-Guided Precondition Inference

Abstract

Abstract. The precondition for an assertion within a procedure is use-ful for understanding, verifying and debugging programs. As the proce-dure might be used in multiple calling-contexts within the program, the precondition should be sufficiently precise to enable re-use. We present an extension of counterexample-guided abstraction refinement (CEGAR) for automated precondition inference. Starting with an overapproxima-tion of both the set of safe and unsafe states, we iteratively refine them until they become disjoint. The resulting precondition is then neces-sary and sufficient for the validity of the assertion, which prevents false alarms. We have implemented our approach and present experimental results using string and array-manipulating programs.

    Similar works