Targeted Synthesis for Programming with Data Invariants

04/30/2019
by   John Sarracino, et al.
0

Programmers frequently maintain implicit data invariants, which are relations between different data structures in a program. Traditionally, such invariants are manually enforced and checked by programmers. This ad-hoc practice is difficult because the programmer must manually account for all the locations and configurations that break an invariant. Moreover, implicit invariants are brittle under code-evolution: when the invariants and data structures change, the programmer must repeat the process of manually repairing all of the code locations where invariants are violated. A much better approach is to introduce data invariants as a language feature and rely on language support to maintain invariants. To handle this challenge, we introduce Targeted Synthesis, a technique for integrating data invariants with invariant-agnostic imperative code at compile-time. This technique is nontrivial due to the complex structure of both invariant specifications, as well as general imperative code. The key insight is to take a language co-design approach involving both the language of data invariants, as well as the imperative language. We leverage this insight to produce two high-level results: first, we support a language with iterators without requiring general quantified reasoning, and second, we infer complicated invariant-preserving patches. We evaluate these claims through a language termed Spyder, a core calculus of data invariants over imperative iterator programs. We evaluate the expressiveness and performance of Spyder on a variety of programs inspired by web applications, and we find that Spyder efficiently compiles and maintains data invariants.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
03/22/2019

SLING: Using Dynamic Analysis to Infer Program Invariants in Separation Logic

We introduce a new dynamic analysis technique to discover invariants in ...
research
01/05/2023

Builtin Types viewed as Inductive Families

State of the art optimisation passes for dependently typed languages can...
research
10/10/2017

Proofs as Relational Invariants of Synthesized Execution Grammars

The automatic verification of programs that maintain unbounded low-level...
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
06/14/2022

Solving Invariant Generation for Unsolvable Loops

Automatically generating invariants, key to computer-aided analysis of p...
research
09/16/2019

Learning Invariants through Soft Unification

Human reasoning involves recognising common underlying principles across...
research
03/14/2019

Are My Invariants Valid? A Learning Approach

Ensuring that a program operates correctly is a difficult task in large,...

Please sign up or login with your details

Forgot password? Click here to reset