65 research outputs found
Complexity of Bradley-Manna-Sipma Lexicographic Ranking Functions
In this paper we turn the spotlight on a class of lexicographic ranking
functions introduced by Bradley, Manna and Sipma in a seminal CAV 2005 paper,
and establish for the first time the complexity of some problems involving the
inference of such functions for linear-constraint loops (without precondition).
We show that finding such a function, if one exists, can be done in polynomial
time in a way which is sound and complete when the variables range over the
rationals (or reals). We show that when variables range over the integers, the
problem is harder -- deciding the existence of a ranking function is
coNP-complete. Next, we study the problem of minimizing the number of
components in the ranking function (a.k.a. the dimension). This number is
interesting in contexts like computing iteration bounds and loop
parallelization. Surprisingly, and unlike the situation for some other classes
of lexicographic ranking functions, we find that even deciding whether a
two-component ranking function exists is harder than the unrestricted problem:
NP-complete over the rationals and -complete over the integers.Comment: Technical report for a corresponding CAV'15 pape
Ranking Templates for Linear Loops
We present a new method for the constraint-based synthesis of termination
arguments for linear loop programs based on linear ranking templates. Linear
ranking templates are parametrized, well-founded relations such that an
assignment to the parameters gives rise to a ranking function. This approach
generalizes existing methods and enables us to use templates for many different
ranking functions with affine-linear components. We discuss templates for
multiphase, piecewise, and lexicographic ranking functions. Because these
ranking templates require both strict and non-strict inequalities, we use
Motzkin's Transposition Theorem instead of Farkas Lemma to transform the
generated -constraint into an -constraint.Comment: TACAS 201
The Hardness of Finding Linear Ranking Functions for Lasso Programs
Finding whether a linear-constraint loop has a linear ranking function is an
important key to understanding the loop behavior, proving its termination and
establishing iteration bounds. If no preconditions are provided, the decision
problem is known to be in coNP when variables range over the integers and in
PTIME for the rational numbers, or real numbers. Here we show that deciding
whether a linear-constraint loop with a precondition, specifically with
partially-specified input, has a linear ranking function is EXPSPACE-hard over
the integers, and PSPACE-hard over the rationals. The precise complexity of
these decision problems is yet unknown. The EXPSPACE lower bound is derived
from the reachability problem for Petri nets (equivalently, Vector Addition
Systems), and possibly indicates an even stronger lower bound (subject to open
problems in VAS theory). The lower bound for the rationals follows from a novel
simulation of Boolean programs. Lower bounds are also given for the problem of
deciding if a linear ranking-function supported by a particular form of
inductive invariant exists. For loops over integers, the problem is PSPACE-hard
for convex polyhedral invariants and EXPSPACE-hard for downward-closed sets of
natural numbers as invariants.Comment: In Proceedings GandALF 2014, arXiv:1408.5560. I thank the organizers
of the Dagstuhl Seminar 14141, "Reachability Problems for Infinite-State
Systems", for the opportunity to present an early draft of this wor
Unrestricted Termination and Non-Termination Arguments for Bit-Vector Programs
Proving program termination is typically done by finding a well-founded
ranking function for the program states. Existing termination provers typically
find ranking functions using either linear algebra or templates. As such they
are often restricted to finding linear ranking functions over mathematical
integers. This class of functions is insufficient for proving termination of
many terminating programs, and furthermore a termination argument for a program
operating on mathematical integers does not always lead to a termination
argument for the same program operating on fixed-width machine integers. We
propose a termination analysis able to generate nonlinear, lexicographic
ranking functions and nonlinear recurrence sets that are correct for
fixed-width machine arithmetic and floating-point arithmetic Our technique is
based on a reduction from program \emph{termination} to second-order
\emph{satisfaction}. We provide formulations for termination and
non-termination in a fragment of second-order logic with restricted
quantification which is decidable over finite domains. The resulted technique
is a sound and complete analysis for the termination of finite-state programs
with fixed-width integers and IEEE floating-point arithmetic
Bounding the Computational Complexity of Flowchart Programs with Multi-dimensional Rankings
Proving the termination of a flowchart program can be done by exhibiting a ranking function, i.e., a function from the program states to a well-founded set, which strictly decreases at each program step. A standard method to automatically generate such a function is to compute invariants for each program point and to search for a ranking in a restricted class of functions that can be handled with linear programming techniques. Our first contribution is to propose an efficient algorithm to compute ranking functions: It can handle flowcharts of arbitrary structure, the class of candidate rankings it explores is larger, and our method, although greedy, is provably complete. Our second contribution is to show how to use the ranking functions we generate to get upper bounds for the computational complexity (number of transitions) of the source program, again for flowcharts of arbitrary structure. This estimate is a polynomial, which means that we can handle programs with more than linear complexity. We applied the method on a collection of test cases from the literature. We also point out important extensions, mainly to do with the scalability of the algorithm and, in particular, the integration of techniques based on cutpoints
Synthesis for Polynomial Lasso Programs
We present a method for the synthesis of polynomial lasso programs. These
programs consist of a program stem, a set of transitions, and an exit
condition, all in the form of algebraic assertions (conjunctions of polynomial
equalities). Central to this approach is the discovery of non-linear
(algebraic) loop invariants. We extend Sankaranarayanan, Sipma, and Manna's
template-based approach and prove a completeness criterion. We perform program
synthesis by generating a constraint whose solution is a synthesized program
together with a loop invariant that proves the program's correctness. This
constraint is non-linear and is passed to an SMT solver. Moreover, we can
enforce the termination of the synthesized program with the support of test
cases.Comment: Paper at VMCAI'14, including appendi
- …