Invariant Generation for Multi-Path Loops with Polynomial Assignments

01/11/2018
by   Andreas Humenberger, et al.
0

Program analysis requires the generation of program properties expressing conditions to hold at intermediate program locations. When it comes to programs with loops, these properties are typically expressed as loop invariants. In this paper we study a class of multi-path program loops with numeric variables, in particular nested loops with conditionals, where assignments to program variables are polynomial expressions over program variables. We call this class of loops extended P-solvable and introduce an algorithm for generating all polynomial invariants of such loops. By an iterative procedure employing Gröbner basis computation, our approach computes the polynomial ideal of the polynomial invariants of each program path and combines these ideals sequentially until a fixed point is reached. This fixed point represents the polynomial ideal of all polynomial invariants of the given extended P-solvable loop. We prove termination of our method and show that the maximal number of iterations for reaching the fixed point depends linearly on the number of program variables and the number of inner loops. In particular, for a loop with m program variables and r conditional branches we prove an upper bound of m*r iterations. We implemented our approach in the Aligator software package. Furthermore, we evaluated it on 18 programs with polynomial arithmetic and compared it to existing methods in invariant generation. The results show the efficiency of our approach.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
05/08/2017

Automated Generation of Non-Linear Loop Invariants Utilizing Hypergeometric Sequences

Analyzing and reasoning about safety properties of software systems beco...
research
08/16/2018

Aligator.jl - A Julia Package for Loop Invariant Generation

We describe the Aligator.jl software package for automatically generatin...
research
09/10/2021

Regular Path Clauses and Their Application in Solving Loops

A well-established approach to reasoning about loops during program anal...
research
05/07/2019

Automatic Generation of Moment-Based Invariants for Prob-Solvable Loops

One of the main challenges in the analysis of probabilistic programs is ...
research
06/23/2022

Algebra-Based Reasoning for Loop Synthesis

Provably correct software is one of the key challenges of our software-d...
research
03/19/2019

Semantic programming: method Δ_0^p-enrichments and polynomial computable fixed points

Computer programs fast entered in our live and the questions associated ...
research
06/02/2023

(Un)Solvable Loop Analysis

Automatically generating invariants, key to computer-aided analysis of p...

Please sign up or login with your details

Forgot password? Click here to reset