Proving and Disproving Programs with Shared Mutable Data

03/13/2021
by   Georg Schmid, et al.
0

We present a tool for verification of deterministic programs with shared mutable references against specifications such as assertions, preconditions, postconditions, and read/write effects. We implement our tool by encoding programs with mutable references into annotated purely functional recursive programs. We then rely on function unfolding and the SMT solver Z3 to prove or disprove safety and to establish program termination. Our tool uses a new translation of programs where frame conditions are encoded using quantifier-free formulas in first-order logic (instead of relying on quantifiers or separation logic). This quantifier-free encoding enables SMT solvers to prove safety or report counterexamples relative to the semantics of procedure specifications. Our encoding is possible thanks to the expressive power of the extended array theory of the Z3 SMT solver. In addition to the ability to report counterexamples, our tool retains efficiency of reasoning about purely functional layers of data structures, providing expressiveness for mutable data but also a significant level of automation for purely functional aspects of software. We illustrate our tool through examples manipulating mutable linked structures and arrays.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
04/06/2019

System FR as Foundations for Stainless

We present the design, implementation, and foundation of a verifier for ...
research
04/09/2021

A Theory of Heap for Constrained Horn Clauses (Extended Technical Report)

Constrained Horn Clauses (CHCs) are an intermediate program representati...
research
01/25/2019

A First Order Logic with Frames

We propose a novel logic, called Frame Logic (FL), that extends first-or...
research
04/02/2021

Proving Non-termination by Program Reversal

We present a new approach to proving non-termination of non-deterministi...
research
09/17/2020

Formulog: Datalog for SMT-Based Static Analysis (Extended Version)

Satisfiability modulo theories (SMT) solving has become a critical part ...
research
05/17/2022

Reasoning About Vectors using an SMT Theory of Sequences

Dynamic arrays, also referred to as vectors, are fundamental data struct...
research
10/05/2022

Gradual C0: Symbolic Execution for Efficient Gradual Verification

Current static verification techniques such as separation logic support ...

Please sign up or login with your details

Forgot password? Click here to reset