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.

[1]  Nicolas Halbwachs,et al.  Automatic discovery of linear restraints among variables of a program , 1978, POPL.

[2]  Andreas Podelski,et al.  A Complete Method for the Synthesis of Linear Ranking Functions , 2004, VMCAI.

[3]  Marius Bozga,et al.  Deciding Conditional Termination , 2012, TACAS.

[4]  Michel Hack,et al.  Decidability Questions for Petri Nets , 1975, Outstanding Dissertations in the Computer Sciences.

[5]  Henny B. Sipma,et al.  Linear Ranking with Reachability , 2005, CAV.

[6]  Paul Feautrier,et al.  Multi-dimensional Rankings, Program Termination, and Complexity Bounds of Flowchart Programs , 2010, SAS.

[7]  Jochen Hoenicke,et al.  Linear Ranking for Linear Lasso Programs , 2013, ATVA.

[8]  Andreas Podelski,et al.  ARMC: The Logical Choice for Software Model Checking with Abstraction Refinement , 2007, PADL.

[9]  Javier Esparza,et al.  Decidability and Complexity of Petri Net Problems - An Introduction , 1996, Petri Nets.

[10]  Frédéric Mesnard,et al.  Recurrence with affine level mappings is P-time decidable for CLP$({\mathbb R})$ , 2007, Theory and Practice of Logic Programming.

[11]  Samir Genaim,et al.  On the Termination of Integer Loops , 2012, TOPL.

[12]  Frédéric Mesnard,et al.  A new look at the automatic synthesis of linear ranking functions , 2012, Inf. Comput..

[13]  Amir M. Ben-Amram,et al.  Ranking Functions for Linear-Constraint Loops , 2012, JACM.

[14]  Jérôme Leroux,et al.  Vector addition system reachability problem: a short self-contained proof , 2011, POPL '11.

[15]  Daniel Larraz,et al.  Proving termination of imperative programs using Max-SMT , 2013, 2013 Formal Methods in Computer-Aided Design.

[16]  Joël Ouaknine,et al.  Positivity Problems for Low-Order Linear Recurrence Sequences , 2013, SODA.

[17]  Henny B. Sipma,et al.  The Polyranking Principle , 2005, ICALP.

[18]  Allen Van Gelder,et al.  Termination detection in logic programs using argument sizes (extended abstract) , 1991, PODS.

[19]  Sumit Gulwani,et al.  Proving Conditional Termination , 2008, CAV.

[20]  Richard M. Karp,et al.  Parallel Program Schemata , 1969, J. Comput. Syst. Sci..

[21]  Henny B. Sipma,et al.  Synthesis of Linear Ranking Functions , 2001, TACAS.

[22]  Neil D. Jones,et al.  Computability and complexity - from a programming perspective , 1997, Foundations of computing series.

[23]  Andreas Podelski,et al.  Termination proofs for systems code , 2006, PLDI '06.

[24]  Daniel Larraz Hurtado,et al.  Proving termination of imperative programs using Max-SMT , 2013, FMCAD 2013.

[25]  William R. Harris,et al.  Alternation for Termination , 2010, SAS.

[26]  Marc Brockschmidt,et al.  Better Termination Proving through Cooperation , 2013, CAV.

[27]  Marsha Chechik,et al.  Tools and Algorithms for the Construction and Analysis of Systems , 2016, Lecture Notes in Computer Science.

[28]  Florian Zuleger,et al.  Ramsey vs. Lexicographic Termination Proving , 2013, TACAS.

[29]  M. Nielsen,et al.  Decidability Issues for Petri Nets , 1994 .