Annotation inference for separation logic based verifiers

Frédéric Vogels, Bart Jacobs, Frank Piessens, Jan Smans
[ISBN] [Google Scholar] [DBLP] [Citeseer]
Read: 19 January 2020

Formal Techniques for Distributed Systems
Springer Berlin Heidelberg
Berlin, Heidelberg
Pages 319-333
Topic(s): tools verification
Note(s): VeriFast verifier, VCC verifier, separation logic, permission logic, auto-active verification

One of the challenges in automatic program verification tools such as the VCC verifier and the VeriFast verifier is the amount of annotation required to write the specification and guide the verification tool to construct a proof.

The VeriFast tool’s initial goal was to provide sound, fast verification for C and Java. This paper describes three extensions to reduce the amount of annotation required. These extensions are implemented outside the small core and therefore any annotations added cannot cause VeriFast to produce unsound results.

  1. In VeriFast, one often “opens” a predicate at the start of a function to expand the predicate’s definition and “closes” a predicate at the end of a function to trigger proof that the predicate holds, The first auto-annotations technique is to automatically open/close any predicates mentioned in the requires/assumes clauses provided the predicates are not recursive. The basis for this is a directed graph between predicates that mention each other where edges are labelled with side-conditions.

  2. In VeriFast, one also explicitly applies lemmas. The second auto-annotation aggressively applies lemmas as soon as possible (i.e., as soon as they can be triggered) to make all consequences available to the prover unless doing so could lead to an exponential explosion or would remove facts from the symbolic state.

  3. Finally, they perform a shape analysis, which further drives open/close, lemma application and also loop invariant generation.

The overall effect of these three inference steps is a dramatic reduction in the amount of annotation required. Across eight functions totalling 113 lines of code, the amount of annotation required drops from 205 lines of annotation to just 8 lines of annotation.

Annotation burden