Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article

Ranking Functions for Linear-Constraint Loops

Published: 01 July 2014 Publication History

Abstract

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.

References

[1]
Elvira Albert, Puri Arenas, Samir Genaim, and Germán Puebla. 2011. Closed-form upper bounds in static cost analysis. J. Autom. Reason. 46, 2, 161--203.
[2]
Elvira Albert, Puri Arenas, Samir Genaim, German Puebla, and Damiano Zanardini. 2007. COSTA: Design and implementation of a cost and termination analyzer for Java bytecode. In Proceedings of the Symposium on Formal Methods for Components and Objects (FMCO’07). Frank S. de Boer, Marcello M. Bonsangue, Susanne Graf, and Willem P. de Roever Eds., Lecture Notes in Computer Science, vol. 5382, Springer, 113--132.
[3]
Christophe Alias, Alain Darte, Paul Feautrier, and Laure Gonnord. 2010. Multi-dimensional rankings, program termination, and complexity bounds of flowchart programs. In Proceedings of the Static Analysis Symposium (SAS’10). Radhia Cousot and Matthieu Martel Eds., Lecture Notes in Computer Science, vol. 6337, Springer, 117--133.
[4]
Roberto Bagnara, Patricia M. Hill, and Enea Zaffanella. 2008a. An improved tight closure algorithm for integer octagonal constraints. In Proceedings of the Symposium on Verification, Model Checking, and Abstract Interpretation (VMCAI’08). Francesco Logozzo, Doron Peled, and Lenore D. Zuck Eds., Lecture Notes in Computer Science, vol. 4905, Springer, 8--21.
[5]
Roberto Bagnara, Patricia M. Hill, and Enea Zaffanella. 2008b. The Parma polyhedra library: Toward a complete set of numerical abstractions for the analysis and verification of hardware and software systems. Sci. Comput. Program. 72, 1--2, 3--21.
[6]
Roberto Bagnara and Fred Mesnard. 2013. Eventual linear ranking functions. In Proceedings of the 15th International Symposium on Principles and Practice of Declarative Programming (PPDP’13). ACM Press, 229--238.
[7]
Roberto Bagnara, Fred Mesnard, Andrea Pescetti, and Enea Zaffanella. 2012. A new look at the automatic synthesis of linear ranking functions. Inf. Comput. 215, 47--67.
[8]
Amir M. Ben-Amram. 2008. Size-change termination with difference constraints. ACM Trans. Program. Lang. Syst. 30, 3.
[9]
Amir M. Ben-Amram. 2011. Monotonicity constraints for termination in the integer domain. Log. Meth. Comput. Sci. 7, 3.
[10]
Amir M. Ben-Amram and Samir Genaim. 2013. On the linear ranking problem for integer linear-constraint loops. In Proceedings of the 40th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL’13). ACM, New York, 51--62.
[11]
Amir M. Ben-Amram, Samir Genaim, and Abu Naser Masud. 2012. On the termination of integer loops. ACM Trans. Program. Lang. Syst. 34, 4, Article 16.
[12]
Marius Bozga, Radu Iosif, and Filip Konecný. 2012. Deciding conditional termination. In Proceedings of the Symposium on Tools and Algorithms for the Construction and Analysis of Systems (TACAS’12). Cormac Flanagan and Barbara König Eds., vol. 7214. Springer, 252--266.
[13]
Laura Bozzelli and Sophie Pinchinat. 2012. Verification of gap-order constraint abstractions of counter systems. In Proceedings of the Symposium on Verification, Model Checking, and Abstract Interpretation (VMCAI’12). Viktor Kuncak and Andrey Rybalchenko Eds., Lecture Notes in Computer Science, vol. 7148, Springer, 88--103.
[14]
Aaron R. Bradley, Zohar Manna, and Henny B. Sipma. 2005a. Linear ranking with reachability. In Proceedings of the Symposium on Computer Aided Verification (CAV’05). Kousha Etessami and Sriram K. Rajamani Eds., Lecture Notes in Computer Science, vol. 3576, Springer, 491--504.
[15]
Aaron R. Bradley, Zohar Manna, and Henny B. Sipma. 2005b. The polyranking principle. In Proceedings of the International Colloquium on Automata, Languages and Programming (ICALP’05). Luís Caires, Giuseppe F. Italiano, Luís Monteiro, Catuscia Palamidessi, and Moti Yung Eds., Lecture Notes in Computer Science, vol. 3580, Springer, 1349--1361.
[16]
Aaron R. Bradley, Zohar Manna, and Henny B. Sipma. 2005c. Termination analysis of integer linear loops. In Proceedings of the Symposium on Concurrency Theory (CONCUR’05). Martín Abadi and Luca de Alfaro Eds., Lecture Notes in Computer Science, vol. 3653, Springer, 488--502.
[17]
Aaron R. Bradley, Zohar Manna, and Henny B. Sipma. 2005d. Termination of polynomial programs. In Proceedings of the Symposium on Verification, Model Checking, and Abstract Interpretation (VMCAI’05). Radhia Cousot Ed., Lecture Notes in Computer Science, vol. 3385, Springer, 113--129.
[18]
Mark Braverman. 2006. Termination of integer linear programs. In Proceedings of the Symposium on Computer Aided Verification (CAV’06). Thomas Ball and Robert B. Jones Eds., Lecture Notes in Computer Science, vol. 4144, Springer, 372--385.
[19]
Marc Brockschmidt, Byron Cook, and Carsten Fuhs. 2013. Better termination proving through cooperation. In Computer Aided Verification (CAV’13). Natasha Sharygina and Helmut Veith Eds., Lecture Notes in Computer Science, vol. 8044, Springer, 413--429.
[20]
Maurice Bruynooghe, Michael Codish, John P. Gallagher, Samir Genaim, and Wim Vanhoof. 2007. Termination analysis of logic programs through combination of type-based norms. ACM Trans. Program. Lang. Syst. 29, 2.
[21]
Philip J. Charles, Jacob M. Howe, and Andy King. 2009. Integer polyhedra for program analysis. In Proceedings of the Symposium on Algorithmic Aspects in Information and Management (AAIM’09). Andrew V. Goldberg and Yunhong Zhou Eds., Lecture Notes in Computer Science, vol. 5564, Springer, 85--99.
[22]
Michael Codish, Vitaly Lagoon, and Peter J. Stuckey. 2005. Testing for termination with monotonicity constraints. In Proceedings of the International Conference on Logic Programming (ICLP’05). Maurizio Gabbrielli and Gopal Gupta Eds., Lecture Notes in Computer Science, vol. 3668, Springer, 326--340.
[23]
Michael Colón and Henny Sipma. 2001. Synthesis of linear ranking functions. In Proceedings of the Tools and Algorithms for the Construction and Analysis of Systems (TACAS’01). Tiziana Margaria and Wang Yi Eds., Lecture Notes in Computer Science, vol. 2031, Springer, 67--81.
[24]
Michael Colón and Henny Sipma. 2002. Practical methods for proving program termination. In Proceedings of the 14th International Conference on Computer Aided Verification (CAV’02). Ed Brinksma and Kim Guldstrand Larsen Eds., Lecture Notes in Computer Science, vol. 2404, Springer, 442--454.
[25]
Byron Cook, Daniel Kroening, Philipp Rümmer, and Christoph M. Wintersteiger. 2010. Ranking function synthesis for bit-vector relations. In Proceedings of the 16th International Conference on Tools and Algorithms for the Construction and Analysis of Systems (TACAS’10). Javier Esparza and Rupak Majumdar Eds., Lecture Notes in Computer Science, vol. 6015, Springer, 236--250.
[26]
Byron Cook, Andreas Podelski, and Andrey Rybalchenko. 2006. Termination proofs for systems code. In Proceedings of the Conference on Programming Language Design and Implementation (PLDI’06). Michael I. Schwartzbach and Thomas Ball Eds., ACM, 415--426.
[27]
Byron Cook, Abigail See, and Florian Zuleger. 2013. Ramsey vs. lexicographic termination proving. In Proceedings of the Conference on Tools and Algorithms for the Construction and Analysis of Systems (TACAS’13). Nir Piterman and Scott A. Smolka Eds., Lecture Notes in Computer Science, vol. 7795. Springer, 47--61.
[28]
Patrick Cousot. 2005. Proving program invariance and termination by parametric abstraction, lagrangian relaxation and semidefinite programming. In Proceedings of the Conference on Verification, Model Checking, and Abstract Interpretation (VMCAI’05). Radhia Cousot Ed., Lecture Notes in Computer Science, vol. 3385, Springer, 1--24.
[29]
Alain Darte. 2010. Understanding loops: The influence of the decomposition of Karp, Miller, and Winograd. In Proceedings of the Conference on Formal Methods and Models for Codesign (MEMOCODE’10). IEEE Computer Society, 139--148.
[30]
Paul Feautrier. 1992a. Some efficient solutions to the affine scheduling problem. I. One-dimensional time. Int. J. Paral. Prog. 21, 5, 313--347.
[31]
Paul Feautrier. 1992b. Some efficient solutions to the affine scheduling problem. II. Multidimensional time. Int. J. Paral. Prog. 21, 6, 389--420.
[32]
Komei Fukuda. 2013. Lecture: Polyhedral Computation. http://www-oldurls.inf.ethz.ch/personal/fukudak/lect/pclect/notes2013. (Last accessed 2/13).
[33]
Pierre Ganty and Samir Genaim. 2013. Proving termination starting from the end. In Proceedings of the 25th International Conference on Computer Aided Verification (CAV’13). Natasha Sharygina and Helmut Veith Eds., Lecture Notes in Computer Science, vol. 8044, Springer, 397--412.
[34]
Michael R. Garey and David S. Johnson. 1979. Computers and Intractability. W.H. Freeman and Co., New York.
[35]
Jürgen Giesl, René Thiemann, Peter Schneider-Kamp, and Stephan Falke. 2004. Automated termination proofs with AProVE. In Rewriting Techniques and Applications (RTA’04). Vincent van Oostrom Ed., Lecture Notes in Computer Science, vol. 3091, Springer, 210--220.
[36]
William R. Harris, Akash Lal, Aditya V. Nori, and Sriram K. Rajamani. 2011. Alternation for termination. In Proceedings of the Static Analysis Symposium (SAS’11). Lecture Notes in Computer Science, vol. 6337, Springer, 304--319.
[37]
Mark E. Hartmann. 1988. Cutting planes and the complexity of the integer hull. Ph.D. Dissertation. School of Operations Research and Industrial Engineering, Cornell University.
[38]
Warwick Harvey. 1999. Computing two-dimensional integer hulls. SIAM J. Comput. 28, 6, 2285--2299.
[39]
Warwick Harvey and Peter J. Stuckey. 1997. A unit two variable per inequality integer constraint solver for constraint logic programming. In Proceedings of the Australasian Computer Science Conference (ACSC’97). 102--111.
[40]
Matthias Heizmann, Jochen Hoenicke, Jan Leike, and Andreas Podelski. 2013. Linear ranking for linear lasso programs. In Proceedings of the Automated Technology for Verification and Analysis. Dang Hung and Mizuhito Ogawa Eds., Lecture Notes in Computer Science, vol. 8172. Springer, 365--380.
[41]
R. M. Karp. 1972. Reducibility among combinatorial problems. In Complexity of Computer Computations, R. E. Miller and J. W. Thatcher Eds. Plenum Press, New York, 85--103.
[42]
Richard M. Karp and Christos H. Papadimitriou. 1980. On linear characterizations of combinatorial optimization problems. In Proceedings of the Symposium on Foundations of Computer Science (FOCS’80). IEEE Computer Society, 1--9.
[43]
Daniel Kroening, Natasha Sharygina, Aliaksei Tsitovich, and Christoph Wintersteiger. 2010. Termination analysis with compositional transition invariants. In Proceedings of the 22nd International Conference on Computer Aided Verification (CAV’10). Lecture Notes in Computer Science, vol. 6174, Springer, 89--103.
[44]
Daniel Larraz, Albert Oliveras, Enric Rodríguez-Carbonell, and Albert Rubio. 2013. Proving termination of imperative programs using Max-SMT. In Proceedings of the Conference on Formal Methods in Computer-Aided Design (FMCAD’13). IEEE, 218--225.
[45]
Jean-Louis Lassez. 1990. Querying constraints. In Proceedings of the Symposium on Principles of Database Systems (PODS’90). ACM Press, 288--298.
[46]
Chin Soon Lee, Neil D. Jones, and Amir M. Ben-Amram. 2001. The size-change principle for program termination. In Proceedings of the Symposium on Principles of Programming Languages (POPL’01). Chris Hankin and Dave Schmidt Eds., ACM, 81--92.
[47]
Jan Leike. 2013. Ranking function synthesis for linear lasso programs. Master’s dissertation. University of Freiburg, Department of Computer Science.
[48]
Naomi Lindenstrauss and Yehoshua Sagiv. 1997. Automatic termination analysis of prolog programs. In Proceedings of the International Conference on Logic Programming (ICLP’97). Lee Naish Ed., MIT Press, 64--77.
[49]
Stephen Magill, Ming-Hsien Tsai, Peter Lee, and Yih-Kuen Tsay. 2010. Automatic numeric abstractions for heap-manipulating programs. In Proceedings of the 37th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL’10). Manuel V. Hermenegildo and Jens Palsberg Eds., ACM, 211--222.
[50]
Frédéric Mesnard and Alexander Serebrenik. 2008. Recurrence with affine level mappings is P-time decidable for CLP(R). Theory Prac. Logic Program. 8, 1, 111--119.
[51]
Antoine Miné. 2006. The octagon abstract domain. Higher-Order Symbolic Comput. 19, 1, 31--100.
[52]
Andreas Podelski and Andrey Rybalchenko. 2004a. A complete method for the synthesis of linear ranking functions. In Proceedings of the Conference on Verification, Model Checking, and Abstract Interpretation (VMCAI’04). Bernhard Steffen and Giorgio Levi Eds., Lecture Notes in Computer Science, vol. 2937, Springer, 239--251.
[53]
Andreas Podelski and Andrey Rybalchenko. 2004b. Transition invariants. In Proceedings of the 19th IEEE Symposium on Logic in Computer Science (LICS’04). IEEE Computer Society, 32--41.
[54]
Peter Z. Revesz. 2009. Tightened transitive closure of integer addition constraints. In Proceedings of the Symposium on Abstraction, Reformulation, and Approximation (SARA’09). Vadim Bulitko and J. Christopher Beck Eds.
[55]
Andrey Rybalchenko. 2004. Temporal verification with transition invariants. Ph.D. Dissertation, Universität des Saarlandes.
[56]
Alexander Schrijver. 1986. Theory of Linear and Integer Programming. Wiley, New York.
[57]
Kirack Sohn and Allen Van Gelder. 1991. Termination detection in logic programs using argument sizes. In Proceedings of the Symposium on Principles of Database Systems. Daniel J. Rosenkrantz Ed., ACM Press, 216--226.
[58]
Fausto Spoto, Fred Mesnard, and Étienne Payet. 2010. A termination analyzer for Java bytecode based on path-length. ACM Trans. Program. Lang. Syst. 32, 3.
[59]
Éva Tardos. 1986. A strongly polynomial algorithm to solve combinatorial linear programs. Oper. Res. 34, 250--256.
[60]
Ashish Tiwari. 2004. Termination of linear programs. In Proceedings of the Conference on Computer Aided Verification (CAV’04). Rajeev Alur and Doron Peled Eds., Lecture Notes in Computer Science, vol. 3114, Springer, 387--390.
[61]
Doran K. Wilde. 1993. A library for doing polyhedral operations. Tech. Rep. PI 785. IRISA (Institut de Recherche en Informatique et Systèmes Aléatoires), France.

Cited By

View all
  • (2024)Monotonicity and the Precision of Program AnalysisProceedings of the ACM on Programming Languages10.1145/36328978:POPL(1629-1662)Online publication date: 5-Jan-2024
  • (2024)TerGEC: A Graph Enhanced Contrastive Approach for Program Termination AnalysisScience of Computer Programming10.1016/j.scico.2024.103141(103141)Online publication date: May-2024
  • (2024)A lightweight approach to nontermination inference using Constrained Horn ClausesSoftware and Systems Modeling (SoSyM)10.1007/s10270-024-01161-523:2(319-342)Online publication date: 1-Apr-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Journal of the ACM
Journal of the ACM  Volume 61, Issue 4
July 2014
259 pages
ISSN:0004-5411
EISSN:1557-735X
DOI:10.1145/2660259
Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 July 2014
Accepted: 01 March 2014
Revised: 01 February 2014
Received: 01 July 2013
Published in JACM Volume 61, Issue 4

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Ranking functions
  2. linear constraints
  3. termination

Qualifiers

  • Research-article
  • Research
  • Refereed

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)36
  • Downloads (Last 6 weeks)2
Reflects downloads up to 04 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Monotonicity and the Precision of Program AnalysisProceedings of the ACM on Programming Languages10.1145/36328978:POPL(1629-1662)Online publication date: 5-Jan-2024
  • (2024)TerGEC: A Graph Enhanced Contrastive Approach for Program Termination AnalysisScience of Computer Programming10.1016/j.scico.2024.103141(103141)Online publication date: May-2024
  • (2024)A lightweight approach to nontermination inference using Constrained Horn ClausesSoftware and Systems Modeling (SoSyM)10.1007/s10270-024-01161-523:2(319-342)Online publication date: 1-Apr-2024
  • (2024)Breaking the Mold: Nonlinear Ranking Function Synthesis Without TemplatesComputer Aided Verification10.1007/978-3-031-65627-9_21(431-452)Online publication date: 24-Jul-2024
  • (2023)Termination of linear loops under commutative updatesProceedings of the 2023 International Symposium on Symbolic and Algebraic Computation10.1145/3597066.3597101(236-241)Online publication date: 24-Jul-2023
  • (2023)Modular Primal-Dual Fixpoint Logic Solving for Temporal VerificationProceedings of the ACM on Programming Languages10.1145/35712657:POPL(2111-2140)Online publication date: 11-Jan-2023
  • (2023)Optimal CHC Solving via Termination ProofsProceedings of the ACM on Programming Languages10.1145/35712147:POPL(604-631)Online publication date: 11-Jan-2023
  • (2023)Termination of triangular polynomial loopsFormal Methods in System Design10.1007/s10703-023-00440-zOnline publication date: 4-Dec-2023
  • (2022)Neural termination analysisProceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3540250.3549120(633-645)Online publication date: 7-Nov-2022
  • (2022)O-Minimal Invariants for Discrete-Time Dynamical SystemsACM Transactions on Computational Logic10.1145/350129923:2(1-20)Online publication date: 14-Jan-2022
  • Show More Cited By

View Options

Get Access

Login options

Full Access

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media