Data-Driven Inference of Representation Invariants

03/26/2020
by   Anders Miltner, et al.
0

A representation invariant is a property that holds of all values of abstract type produced by a module. Representation invariants play important roles in software engineering and program verification. In this paper, we develop a counterexample-driven algorithm for inferring a representation invariant that is sufficient to imply a desired specification for a module. The key novelty is a type-directed notion of visible inductiveness, which ensures that the algorithm makes progress toward its goal as it alternates between weakening and strengthening candidate invariants. The algorithm is parameterized by an example-based synthesis engine and a verifier, and we prove that it is sound and complete for first-order modules over finite types, assuming that the synthesizer and verifier are as well. We implement these ideas in a tool called Hanoi, which synthesizes representation invariants for recursive data types. Hanoi not only handles invariants for first-order code, but higher-order code as well. In its back end, Hanoi uses an enumerative synthesizer called Myth and an enumerative testing tool as a verifier. Because Hanoi uses testing for verification, it is not sound, though our empirical evaluation shows that it is successful on the benchmarks we investigated.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
07/07/2017

Data-Driven Loop Invariant Inference with Automatic Feature Synthesis

We present LoopInvGen, a tool for generating loop invariants that can pr...
research
02/26/2019

Sound Invariant Checking Using Type Modifiers and Object Capabilities

In this paper we use pre existing language support for type modifiers an...
research
07/31/2021

Solving Constrained Horn Clauses over ADTs by Finite Model Finding

First-order logic is a natural way of expressing the properties of compu...
research
03/28/2019

SymInfer: Inferring Program Invariants using Symbolic States

We introduce a new technique for inferring program invariants that uses ...
research
05/30/2022

Data-driven Numerical Invariant Synthesis with Automatic Generation of Attributes

We propose a data-driven algorithm for numerical invariant synthesis and...
research
07/08/2022

Flux: Liquid Types for Rust

We introduce Flux, which shows how logical refinements can work hand in ...
research
07/11/2018

Everybody's Got To Be Somewhere

The key to any nameless representation of syntax is how it indicates the...

Please sign up or login with your details

Forgot password? Click here to reset