Invariant and type inference for matrices

  • Authors:
  • Thomas A. Henzinger;Thibaud Hottelier;Laura Kovács;Andrei Voronkov

  • Affiliations:
  • IST Austria (Institute of Science and Technology, Austria);UC Berkeley;ETH Zürich;University of Manchester

  • Venue:
  • VMCAI'10 Proceedings of the 11th international conference on Verification, Model Checking, and Abstract Interpretation
  • Year:
  • 2010

Quantified Score

Hi-index 0.01

Visualization

Abstract

We present a loop property generation method for loops iterating over multi-dimensional arrays. When used on matrices, our method is able to infer their shapes (also called types), such as upper-triangular, diagonal, etc. To generate loop properties, we first transform a nested loop iterating over a multi-dimensional array into an equivalent collection of unnested loops. Then, we infer quantified loop invariants for each unnested loop using a generalization of a recurrence-based invariant generation technique. These loop invariants give us conditions on matrices from which we can derive matrix types automatically using theorem provers. Invariant generation is implemented in the software package Aligator and types are derived by theorem provers and SMT solvers, including Vampire and Z3. When run on the Java matrix package JAMA, our tool was able to infer automatically all matrix types describing the matrix shapes guaranteed by JAMA’s API.