Templates and Recurrences: Better Together

03/30/2020
by   Jason Breck, et al.
0

This paper is the confluence of two streams of ideas in the literature on generating numerical invariants, namely: (1) template-based methods, and (2) recurrence-based methods. A template-based method begins with a template that contains unknown quantities, and finds invariants that match the template by extracting and solving constraints on the unknowns. A disadvantage of template-based methods is that they require fixing the set of terms that may appear in an invariant in advance. This disadvantage is particularly prominent for non-linear invariant generation, because the user must supply maximum degrees on polynomials, bases for exponents, etc. On the other hand, recurrence-based methods are able to find sophisticated non-linear mathematical relations, including polynomials, exponentials, and logarithms, because such relations arise as the solutions to recurrences. However, a disadvantage of past recurrence-based invariant-generation methods is that they are primarily loop-based analyses: they use recurrences to relate the pre-state and post-state of a loop, so it is not obvious how to apply them to a recursive procedure, especially if the procedure is non-linearly recursive (e.g., a tree-traversal algorithm). In this paper, we combine these two approaches and obtain a technique that uses templates in which the unknowns are functions rather than numbers, and the constraints on the unknowns are recurrences. The technique synthesizes invariants involving polynomials, exponentials, and logarithms, even in the presence of arbitrary control-flow, including any combination of loops, branches, and (possibly non-linear) recursion. For instance, it is able to show that (i) the time taken by merge-sort is O(n log(n)), and (ii) the time taken by Strassen's algorithm is O(n^log_2(7)).

READ FULL TEXT

page 1

page 2

page 3

page 4

research
04/25/2016

Generalized Homogeneous Polynomials for Efficient Template-Based Nonlinear Invariant Synthesis

The template-based method is one of the most successful approaches to al...
research
01/15/2019

Synthesising a Database of Parameterised Linear and Non-Linear Invariants for Time-Series Constraints

Many constraints restricting the result of some computations over an int...
research
04/27/2021

The ksmt calculus is a δ-complete decision procedure for non-linear constraints

ksmt is a CDCL-style calculus for solving non-linear constraints over re...
research
07/12/2023

Rethinking Answer Set Programming Templates

In imperative programming, the Domain-Driven Design methodology helps in...
research
02/07/2017

Extracting Lifted Mutual Exclusion Invariants from Temporal Planning Domains

We present a technique for automatically extracting mutual exclusion inv...
research
03/17/2020

Learning Nonlinear Loop Invariants with Gated Continuous Logic Networks (Extended Version)

Verifying real-world programs often requires inferring loop invariants w...
research
11/03/2019

A note on Legendre, Hermite, Chebyshev, Laguerre and Gegenbauer wavelets with an application on sbvps arising in real life

Getting solution near singular point of any non-linear BVP is always tou...

Please sign up or login with your details

Forgot password? Click here to reset