Detecting multiphase linear ranking functions for single-path linear-constraint loops

Abstract

Single-path linear-constraint loops are important since many analyses in different fields can be reduced to termination proof synthesis for such loops. In 2017, Ben-Amram and Genaim provided a complete polynomial-time solution to the problem of existence and of synthesis of multiphase linear ranking functions (\(M\varPhi \hbox {RFs}\)) of bounded depth to prove the termination of a single-path linear-constraint loop. However, an open question whether one can precompute a bound on the depth of a \(M\varPhi \hbox {RF}\) for a given loop is raised and the solution has not been accomplished so far. In this paper, we propose an approach to depth bound detection and synthesis of \(M\varPhi \hbox {RFs}\) for rational single-path linear-constraint loops. We take a step further based on the work of Ben-Amram and Genaim, and detect the depth bound for a certain class of rational single-path linear-constraint loops. Furthermore, the effectiveness of our approach is presented with experimental evidence. The depth bound can be precomputed for loops where existing tools fail to infer a \(M\varPhi \hbox {RF}\) or prove that none exists.

This is a preview of subscription content, access via your institution.

References

  1. 1.

    Bagnara, R., Mesnard, F.: Eventual linear ranking functions. In: In Proceedings of the 15th International Symposium on Principles and Practice of Declarative Programming, pp. 229–238. ACM Press (2013)

  2. 2.

    Ben-Amram, A.M., Genaim, S.: Ranking functions for linear-constraint loops. J. ACM 61(4), 26:1–26:55 (2014)

    MathSciNet  Article  Google Scholar 

  3. 3.

    Ben-Amram, A.M., Genaim, S.: On multiphase-linear ranking functions. In: International Conference on Computer Aided Verification, pp. 601–620. Springer International Publishing, Cham (2017)

  4. 4.

    Bradley, A.R., Manna, Z., Sipma, H.B.: Linear ranking with reachability. In: Computer Aided Verification, pp. 491–504. Springer, Berlin (2005)

  5. 5.

    Bradley, A.R., Manna, Z., Sipma, H.B.: The polyranking principle. In: Proceedings of the 32nd International Conference on Automata, Languages and Programming, ICALP’05, pp. 1349–1361. Springer, Berlin (2005)

  6. 6.

    Chen, H.Y., Flur, S., Mukhopadhyay, S.: Termination proofs for linear simple loops. Int. J. Softw. Tools Technol. Transf. 17(1), 47–57 (2015)

    Article  Google Scholar 

  7. 7.

    Chen, Y., Xia, B., Yang, L., Zhan, N., Zhou, C.: Discovering non-linear ranking functions by solving semi-algebraic systems. In: Theoretical Aspects of Computing—ICTAC 2007, pp. 34–49. Springer, Berlin (2007)

  8. 8.

    Chen, Y.-F., Heizmann, M., Lengál, O., Li, Y., Tsai, M.-H., Turrini, A., Zhang, L.: Advanced automata-based algorithms for program termination checking. In: Proceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2018, pp. 135–150. ACM (2018)

  9. 9.

    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 (2001)

  10. 10.

    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 (2002)

  11. 11.

    Cook, B., Gotsman, A., Podelski, A., Rybalchenko, A., Vardi, M.Y.: Proving that programs eventually do something good. In: Proceedings of the 34th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’07, pp. 265–276. ACM (2007)

  12. 12.

    Cook, B., Gulwani, S., Lev-Ami, T., Rybalchenko, A., Sagiv, M.: Proving conditional termination. In: Proceedings of the 20th International Conference on Computer Aided Verification, CAV ’08, pp. 328–340. Springer, Berlin (2008)

  13. 13.

    Cook, B., Podelski, A., Rybalchenko, A.: Termination proofs for systems code. In: Proceedings of the 27th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’06, pp. 415–426. ACM (2006)

  14. 14.

    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. Springer, Berlin (2005)

  15. 15.

    Fedyukovich, G., Zhang, Y., Gupta, A.: Syntax-guided termination analysis. In: International Conference on Computer Aided Verification, pp. 124–143. Springer International Publishing, Cham (2018)

  16. 16.

    Ganty, P., Genaim, S.: Proving termination starting from the end. In: International Conference on Computer Aided Verification, pp. 397–412. Springer, Berlin (2013)

  17. 17.

    Larraz, D., Oliveras, A., Enric R.-C., Albert R.: Proving termination of imperative programs using MAX-SMT. In: Formal Methods in Computer-Aided Design, pp. 218–225 (2014)

  18. 18.

    Leike, J., Heizmann, M.: Ranking templates for linear loops. In: Tools and Algorithms for the Construction and Analysis of Systems, pp. 172–186. Springer, Berlin (2014)

  19. 19.

    Leike, J., Heizmann, M.: Geometric nontermination arguments. In: International Conference on Tools and Algorithms for the Construction and Analysis of Systems, pp. 266–283. Springer International Publishing, Cham (2018)

  20. 20.

    Leroux, J., Sutre, G.: Flat counter automata almost everywhere! In: In International Symposium on Automated Technology for Verification and Analysis, pp. 489–503. Springer, Berlin (2005)

  21. 21.

    Li, Y.: Termination of semi-algebraic loop programs. In: International Symposium on Dependable software Engineering: Theories, Tools and Applications (SETTA’17), pp. 131–146. Springer (2017)

  22. 22.

    Li, Y.: Witness to non-termination of linear programs. Theor. Comput. Sci. 681, 75–100 (2017)

    MathSciNet  Article  Google Scholar 

  23. 23.

    Li, Y., Zhu, G., Feng, Y.: The l-depth eventual linear ranking functions for single-path linear constraint loops. In: International Symposium on Theoretical Aspects of Software Engineering, pp. 30–37. IEEE (2016)

  24. 24.

    Ouaknine, J., Worrell, J.: On linear recurrence sequences and loop termination. ACM SIGLOG News 2(2), 4–13 (2015)

    Article  Google Scholar 

  25. 25.

    Podelski, A., Rybalchenko, A.: A complete method for the synthesis of linear ranking functions. In: Verification, Model Checking, and Abstract Interpretation, pp. 239–251. Springer, Berlin (2004)

  26. 26.

    Schrijver, A.: Theory of Linear and Integer Programming. Wiley, New York (1986)

    Google Scholar 

  27. 27.

    Turing, A.M.: On computable numbers, with an application to the entscheidungs problem. Proc Lond. Math. Soc. 42(2), 230–265 (1937)

    Article  Google Scholar 

Download references

Author information

Affiliations

Authors

Corresponding author

Correspondence to Yi Li.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

This work was supported in part by the National Nature Science Foundation of China under Grant Nos. (61070192, 61572024, 61103110, 61472429, 91018008, 61303074, 61170240), Beijing Nature Science Foundation under Grant No. 4122041, National HighTech Research Development Program of China under Grant No. 2007AA01Z414, National Science and Technology Major Project of China under Grant No. 2012ZX01039-004, and Natural Science Foundation of Chongqing under Grant No. cstc2019jcyjAX0982.

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Yuan, Y., Li, Y. & Shi, W. Detecting multiphase linear ranking functions for single-path linear-constraint loops. Int J Softw Tools Technol Transfer 23, 55–67 (2021). https://doi.org/10.1007/s10009-019-00527-1

Download citation

Keywords

  • Termination analysis
  • Multiphase linear ranking functions
  • Depth bound
  • Single-path linear-constraint loops