Skip to main content
Log in

Termination proofs for linear simple loops

  • Regular Paper
  • Published:
International Journal on Software Tools for Technology Transfer Aims and scope Submit manuscript

Abstract

Analysis of termination and other liveness properties of a program can be reduced to termination proof synthesis for simple loops, i.e., loops with only variable updates in the loop body. Among simple loops, the subset of linear simple loops (LSLs) is particularly interesting because it is common in practice and expressive in theory. Existing techniques can successfully synthesize a linear ranking function for an LSL if there exists one. However, when a terminating LSL does not have a linear ranking function, these techniques fail. In this paper, we describe an automatic method that generates proofs of (universal) termination for LSLs based on the synthesis of disjunctive ranking relations. The method repeatedly finds linear ranking functions on partitions of the state space and checks whether the transitive closure of the transition relation is included in the union of the ranking relations. Our method extends the work of Podelski and Rybalchenko (A complete method for the synthesis of linear ranking functions. In: Proceedings of the 5th international conference on VMCAI, Jan 2004, Venice, Italy, pp 239–251, 2004). We have implemented a prototype of the method and have shown experimental evidence of the effectiveness of our method.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4

Similar content being viewed by others

References

  1. Balaban, I., Cohen, A., Pnueli, A.: Ranking abstraction of recursive programs. In: Proceedings of the verification, model checking, and abstract interpretation (VMCAI06), pp. 267–281. Springer, Berlin (2006)

  2. Berdine, J., Chawdhary, A., Cook, B., Distefano, D., O’Hearn, P.: Variance analyses from invariance analyses. In: Proceedings of the 34th annual ACM SIGPLAN-SIGACT symposium on principles of programming languages (POPL ’07), New York, NY, USA, pp. 211–224 (2007) (ISBN 1-59593-575-4)

  3. Berdine, J., Cook, B., Distefano, D., OHearn, P. W.: Automatic termination proofs for programs with shape-shifting heaps. In: Proceedings of the 18th international conference on computer aided verification (CAV), lecture notes in computer science vol. 4144, pp. 386–400 (2006)

  4. Bradley, A.R.: polyrank: tools for termination analysis. http://theory.stanford.edu/arbrad/software/polyrank.html (2005)

  5. Bradley, A.R., Manna, Z., Sipma, H.B.: Linear ranking with reachability. In: Proceedings of the computer aided verification (CAV), pp. 491–504. Springer, Berlin (2005)

  6. Bradley, A.R., Manna, Z., Sipma, H.B.: Termination of polynomial programs. In: Proceedings of the verification, model checking, and abstract interpretation (VMCAI2005), vol. 3385 of LNCS, pp. 113–129. Springer, Berlin (2005)

  7. Bradley, A.R., Manna, Z., Sipma, H.B.: The polyranking principle. In: Proceedings of the 32nd international colloquim on automata, languages and programming (ICALP), Lisbon, Portugal, 11–15 July 2005, pp. 1349–1361. Springer, Berlin (2005)

  8. Braverman, M.: Termination of integer linear programs. In: Proceedings of the 18th international conference on computer aided verification (CAV), lecture notes in computer science vol. 4144, pp. 372–385 (2006)

  9. Chawdhary, A., Cook, B., Gulwani, S., Sagiv, M., Hongseok Y.:Ranking abstractions, Technical report (2008)

  10. Yi Chen, H., Flur, S., Mukhopadhyay, S.: LSL test suite. https://tigerbytes2.lsu.edu/users/hchen11/lsl/

  11. Colon, M. , Uribe, T.: Generating finite-state abstractions of reactive systems using decision procedures. In:Proceedings of the computer aided verification (CAV), pp. 293–304. Springer, Berlin (1998)

  12. Colón, M., Sipma, H.: Synthesis of linear ranking functions. In: Proceedings of the 7th international conference on tools and algorithms for the construction and analysis of systems (TACAS 2001), pp. 67–81. Springer, London (2001) (ISBN 3-540-41865-2) http://dl.acm.org/citation.cfm?id=646485.694449

  13. Colón, M., Sipma, H.: Practical methods for proving program termination. In: Proceedings of the 14th international conference on computer aided verification (CAV ’02), pp. 442–454. Springer, London (2002) (ISBN 3-540-43997-8). http://dl.acm.org/citation.cfm?id=647771.734281

  14. Cook, B., Gulwani S., Lev-ami, T., Rybalchenko, A., S.: Mooly proving conditional termination. In: Proceedings of the computer aided verification (CAV) lecture notes in computer science vol. 5123, pp. 328–340. Springer, Berlin (2008)

  15. Cook, B., Podelski, A., Rybalchenko, A.: Abstraction refinement for termination. In: Proceedings of the static analysis symposium (SAS2005), vol. 3672 of LNCS, pp. 87–101. Springer, Berlin (2005)

  16. Cook, B., Podelski, A., Rybalchenko, A.: Termination proofs for systems code. In: Proceedings of the 2006 ACM SIGPLAN conference on programming language design and implementation (PLDI ’06), pp. 415–426. New York, NY, USA, (2006) (ISBN 1-59593-320-4)

  17. Cook, B., Rybalchenko, A.: Proving that programs eventually do something good. In: Proceedings of the principles of programming languages (POPL06), pp. 265–276. Springer, Berlin (2007)

  18. Cousot, P.: Proving program invariance and termination by parametric abstraction, Lagrangian relaxation and semidefinite programming. In: Proceedings of the 6th international conference on verification, model checking and abstract interpretation (VMCAI’05), pp. 1–24. Paris, LNCS 3385, Springer, Berlin (2005) (ISBN 978-3-540-24297-0). doi:10.1007/b105073, http://www.springerlink.com/content/qkufe4uekjgyja4f

  19. Cousot, P., Cousot, R.: An abstract interpretation framework for termination. In: Field, J., Hicks, M. (eds.) Proceedings of the 39th ACM SIGPLAN-SIGACT symposium on principles of programming languages (POPL), Philadelphia, USA, 22–28 Jan 2012, pp. 245–258. ACM (2012) (ISBN 978-1-4503-1083-3)

  20. Gulwani, S., Jain, S., Koskinen E.: Control-flow refinement and progress invariants for bound analysis. SIGPLAN Not. 44, 375–385, (2009) (ISSN 0362–1340)

    Google Scholar 

  21. Gulwani, S., Mehra, K.K., Chilimbi, T.: SPEED: precise and efficient static estimation of program computational complexity. In: Proceedings of the 36th annual ACM SIGPLAN-SIGACT symposium on principles of programming languages (POPL ’09), pp. 127–139. New York, NY, USA, ACM (2009) (ISBN 978-1-60558-379-2)

  22. Kroening, D., Sharygina, N., Tsitovich, A., Wintersteiger, C., Termination analysis with compositional transition invariants. In: Proceedings of CAV, vol. 6174 of LNCS, pp. 89–103. Springer, Berlin (2010) (ISBN 978-3-642-14294-9)

  23. Podelski, A., Rybalchenk, A.: Software model checking of liveness properties via transition invariants. Technical report (2003)

  24. Podelski, A., Rybalchenko, A.: A complete method for the synthesis of linear ranking functions. In: Proceedings of the VMCAI, pp. 239–251 (2004)

  25. Podelski, A., Rybalchenko, A.: Transition invariants. In: Proceedings of the LICS, pp. 32–41 (2004)

  26. Podelski, A., Rybalchenko, A.: Transition predicate abstraction and fair termination. In: Proceedings of the 32nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages (POPL ’05). ACM (2005)

  27. Ramsey, F.P.: On a problem of formal logic. In: Proceedings of the London Mathematical Society, vol. 30, pp. 491–504 (1930)

  28. RankFinder, A.R.: http://www.mpi-sws.org/ybal/rankfinder/

  29. Schrijver, A.: Theory of linear and integer programming. Wiley, New York (1986) (ISBN 0-471-90854-1)

  30. Tiwari, A.: Termination of linear programs. In: Alur, R., Peled, D. (eds.) Proceedings of the CAV, vol. 3114 of lecture notes in computer science, pp. 70–82. Springer, Berlin (2004) (ISBN 3-540-22342-8)

  31. Turing, A.M.: Checking a large routine. In: Report of a conference on high speed automatic calculating machines, pp. 67–69 (1948)

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Hong Yi Chen.

Additional information

This research is partially supported by NSF under the Grant 0965024. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.

A preliminary version of this paper appears in proceedings of SAS 2012.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Chen, H.Y., Flur, S. & Mukhopadhyay, S. Termination proofs for linear simple loops. Int J Softw Tools Technol Transfer 17, 47–57 (2015). https://doi.org/10.1007/s10009-013-0288-8

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10009-013-0288-8

Keywords

Navigation