Ranking Functions for Linear-Constraint Loops

In this article, we study the complexity of the problems: given a loop, described by linear constraints over a finite set of variables, is there a linear or lexicographical-linear ranking function for this loop? While existence of such functions implies termination, these problems are not equivalent to termination. When the variables range over the rationals (or reals), it is known that both problems are PTIME decidable. However, when they range over the integers, whether for single-path or multipath loops, the complexity has not yet been determined. We show that both problems are coNP-complete. However, we point out some special cases of importance of PTIME complexity. We also present complete algorithms for synthesizing linear and lexicographical-linear ranking functions, both for the general case and the special PTIME cases. Moreover, in the rational setting, our algorithm for synthesizing lexicographical-linear ranking functions extends existing ones, because our definition for such functions is more general, yet it has PTIME complexity.

[1]  Jan Leike,et al.  Ranking Function Synthesis for Linear Lasso Programs , 2014, ArXiv.

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

[3]  Sophie Pinchinat,et al.  Verification of gap-order constraint abstractions of counter systems , 2012, Theor. Comput. Sci..

[4]  Peter Lee,et al.  Automatic numeric abstractions for heap-manipulating programs , 2010, POPL '10.

[5]  Daniel Kroening,et al.  Ranking function synthesis for bit-vector relations , 2010, Formal Methods Syst. Des..

[6]  Elvira Albert,et al.  COSTA: Design and Implementation of a Cost and Termination Analyzer for Java Bytecode , 2008, FMCO.

[7]  Michael Codish,et al.  A Semantic Basis for the Termination Analysis of Logic Programs , 1999, J. Log. Program..

[8]  Ricardo Peña-Marí,et al.  Size Invariant and Ranking Function Synthesis in a Functional Language , 2011, WFLP.

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

[10]  Alexander Schrijver,et al.  Theory of linear and integer programming , 1986, Wiley-Interscience series in discrete mathematics and optimization.

[11]  Komei Fukuda,et al.  Lecture : Polyhedral Computation , Spring 2013 , 2013 .

[12]  Mark Braverman,et al.  Termination of Integer Linear Programs , 2006, CAV.

[13]  Frédéric Mesnard,et al.  Eventual linear ranking functions , 2013, PPDP.

[14]  Henny B. Sipma,et al.  Practical Methods for Proving Program Termination , 2002, CAV.

[15]  Warwick Harvey,et al.  Computing Two-Dimensional Integer Hulls , 1999, SIAM J. Comput..

[16]  Samir Genaim,et al.  On the linear ranking problem for integer linear-constraint loops , 2012, POPL.

[17]  Amir M. Ben-Amram Size-change termination with difference constraints , 2008, TOPL.

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

[19]  Richard M. Karp,et al.  On linear characterizations of combinatorial optimization problems , 1980, 21st Annual Symposium on Foundations of Computer Science (sfcs 1980).

[20]  Étienne Payet,et al.  A termination analyzer for Java bytecode based on path-length , 2010, TOPL.

[21]  Jürgen Giesl,et al.  Automated Termination Proofs with AProVE , 2004, RTA.

[22]  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.

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

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

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

[26]  Henny B. Sipma,et al.  Termination of Polynomial Programs , 2005, VMCAI.

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

[28]  Pierre Ganty,et al.  Proving Termination Starting from the End , 2013, CAV.

[29]  Jacob M. Howe,et al.  Integer Polyhedra for Program Analysis , 2009, AAIM.

[30]  Patrick Cousot,et al.  Proving Program Invariance and Termination by Parametric Abstraction, Lagrangian Relaxation and Semidefinite Programming , 2005, VMCAI.

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

[32]  Dan Suciu,et al.  Journal of the ACM , 2006 .

[33]  Peter J. Stuckey,et al.  Testing for Termination with Monotonicity Constraints , 2005, ICLP.

[34]  GenaimSamir,et al.  Ranking Functions for Linear-Constraint Loops , 2014 .

[35]  Daniel Kroening,et al.  Termination Analysis with Compositional Transition Invariants , 2010, CAV.

[36]  Andreas Podelski,et al.  Transition invariants , 2004, Proceedings of the 19th Annual IEEE Symposium on Logic in Computer Science, 2004..

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

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

[39]  Jean-Louis Lassez,et al.  Querying constraints , 1990, PODS '90.

[40]  Anna Philippou,et al.  Tools and Algorithms for the Construction and Analysis of Systems , 2018, Lecture Notes in Computer Science.

[41]  Antoine Miné,et al.  The octagon abstract domain , 2001, Proceedings Eighth Working Conference on Reverse Engineering.

[42]  Henny B. Sipma,et al.  Termination Analysis of Integer Linear Loops , 2005, CONCUR.

[43]  Doran Wilde,et al.  A LIBRARY FOR DOING POLYHEDRAL OPERATIONS , 2000 .

[44]  Paul Feautrier,et al.  Some efficient solutions to the affine scheduling problem. Part II. Multidimensional time , 1992, International Journal of Parallel Programming.

[45]  Nachum Dershowitz,et al.  A General Framework for Automatic Termination Analysis of Logic Programs , 2000, Applicable Algebra in Engineering, Communication and Computing.

[46]  Éva Tardos,et al.  A Strongly Polynomial Algorithm to Solve Combinatorial Linear Programs , 1986, Oper. Res..

[47]  Amir M. Ben-Amram Monotonicity Constraints for Termination in the Integer Domain , 2011, Log. Methods Comput. Sci..

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

[49]  A. M. Turing,et al.  Checking a large routine , 1989 .

[50]  Elvira Albert,et al.  Closed-Form Upper Bounds in Static Cost Analysis , 2011, Journal of Automated Reasoning.

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

[52]  John P. Gallagher,et al.  Termination analysis of logic programs through combination of type-based norms , 2007, TOPL.

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

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

[55]  Roberto Bagnara,et al.  The Parma Polyhedra Library: Toward a complete set of numerical abstractions for the analysis and verification of hardware and software systems , 2006, Sci. Comput. Program..

[56]  Richard M. Karp,et al.  Reducibility Among Combinatorial Problems , 1972, 50 Years of Integer Programming.

[57]  FeautrierPaul Some efficient solutions to the affine scheduling problem , 1992 .

[58]  Alain Darte Understanding loops: The influence of the decomposition of Karp, Miller, and Winograd , 2010, Eighth ACM/IEEE International Conference on Formal Methods and Models for Codesign (MEMOCODE 2010).

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

[60]  Paul Feautrier,et al.  Some efficient solutions to the affine scheduling problem. I. One-dimensional time , 1992, International Journal of Parallel Programming.

[61]  David K. Smith Theory of Linear and Integer Programming , 1987 .

[62]  Neil D. Jones,et al.  The size-change principle for program termination , 2001, POPL '01.

[63]  室 章治郎 Michael R.Garey/David S.Johnson 著, "COMPUTERS AND INTRACTABILITY A guide to the Theory of NP-Completeness", FREEMAN, A5判変形判, 338+xii, \5,217, 1979 , 1980 .

[64]  Peter Z. Revesz,et al.  Tightened Transitive Closure of Integer Addition Constraints , 2009, SARA.

[65]  Roberto Bagnara,et al.  An Improved Tight Closure Algorithm for Integer Octagonal Constraints , 2007, VMCAI.

[66]  Ashish Tiwari,et al.  Termination of Linear Programs , 2004, CAV.

[67]  Mark Evan Hartmann,et al.  Cutting planes and the complexity of the integer hull , 1989 .

[68]  Andrey Rybalchenko,et al.  Temporal verification with transition invariants , 2004 .