Putting the Squeeze on Array Programs: Loop Verification via Inductive Rank Reduction

06/02/2021
by   Oren Ish Shalom, et al.
0

Automatic verification of array manipulating programs is a challenging problem because it often amounts to the inference of in ductive quantified loop invariants which, in some cases, may not even be firstorder expressible. In this paper, we suggest a novel verification tech nique that is based on induction on userdefined rank of program states as an alternative to loopinvariants. Our technique, dubbed inductive rank reduction, works in two steps. Firstly, we simplify the verification problem and prove that the program is correct when the input state con tains an input array of length B or less, using the length of the array as the rank of the state. Secondly, we employ a squeezing function g which converts a program state sigma with an array of length > B to a state g(sigma) containing an array of length minus 1 or less. We prove that when g satisfies certain natural conditions then if the program violates its specification on sigma then it does so also on g(sigma). The correctness of the program on inputs with arrays of arbitrary lengths follows by induction. We make our technique automatic for array programs whose length of execution is proportional to the length of the input arrays by (i) perform ing the first step using symbolic execution, (ii) verifying the conditions required of g using Z3, and (iii) providing a heuristic procedure for syn thesizing g. We implemented our technique and applied it successfully to several interesting arraymanipulating programs, including a bidirec tional summation program whose loop invariant cannot be expressed in firstorder logic while its specification is quantifier free.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
02/23/2020

Verifying Array Manipulating Programs with Full-Program Induction

We present a full-program induction technique for proving (a sub-class o...
research
07/12/2017

Verifying Array Manipulating Programs by Tiling

Formally verifying properties of programs that manipulate arrays in loop...
research
05/26/2023

Automatic Program Instrumentation for Automatic Verification (Extended Technical Report)

In deductive verification and software model checking, dealing with cert...
research
05/22/2019

Reductions for Automated Hypersafety Verification

We propose an automated verification technique for hypersafety propertie...
research
01/24/2023

Relation-Algebraic Verification of Disjoint-Set Forests

This paper studies how to use relation algebras, which are useful for hi...
research
02/26/2021

Tensors Fitting Perfectly

Multidimensional arrays (NDArrays) are a central abstraction in modern s...
research
08/04/2020

Trace Logic for Inductive Loop Reasoning

We propose trace logic, an instance of many-sorted first-order logic, to...

Please sign up or login with your details

Forgot password? Click here to reset