Reasoning About Vectors using an SMT Theory of Sequences

05/17/2022
by   Ying Sheng, et al.
0

Dynamic arrays, also referred to as vectors, are fundamental data structures used in many programs. Modeling their semantics efficiently is crucial when reasoning about such programs. The theory of arrays is widely supported but is not ideal, because the number of elements is fixed (determined by its index sort) and cannot be adjusted, which is a problem, given that the length of vectors often plays an important role when reasoning about vector programs. In this paper, we propose reasoning about vectors using a theory of sequences. We introduce the theory, propose a basic calculus adapted from one for the theory of strings, and extend it to efficiently handle common vector operations. We prove that our calculus is sound and show how to construct a model when it terminates with a saturated configuration. Finally, we describe an implementation of the calculus in cvc5 and demonstrate its efficacy by evaluating it on verification conditions for smart contracts and benchmarks derived from existing array benchmarks.

READ FULL TEXT

page 1

page 2

page 3

page 4

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
11/01/2017

Fast Dynamic Arrays

We present a highly optimized implementation of tiered vectors, a data s...
research
10/10/2017

A Lambda Calculus for Transfinite Arrays: Unifying Arrays and Streams

Array programming languages allow for concise and generic formulations o...
research
10/11/2017

Abductive functional programming, a semantic approach

We propose a call-by-value lambda calculus extended with a new construct...
research
03/13/2021

Proving and Disproving Programs with Shared Mutable Data

We present a tool for verification of deterministic programs with shared...
research
04/25/2022

General Interpolation and Strong Amalgamation for Contiguous Arrays

Interpolation is an essential tool in software verification, where first...
research
06/01/2021

Quantifiers on Demand

Automated program verification is a difficult problem. It is undecidable...

Please sign up or login with your details

Forgot password? Click here to reset