Skip to main content

Complexity Analysis for Term Rewriting by Integer Transition Systems

  • Conference paper
  • First Online:
Book cover Frontiers of Combining Systems (FroCoS 2017)

Part of the book series: Lecture Notes in Computer Science ((LNAI,volume 10483))

Included in the following conference series:

Abstract

We present a new method to infer upper bounds on the innermost runtime complexity of term rewrite systems (TRSs), which benefits from recent advances on complexity analysis of integer transition systems (ITSs). To this end, we develop a transformation from TRSs to a generalized notion of ITSs with (possibly non-tail) recursion. To analyze their complexity, we introduce a modular technique which allows us to use existing tools for standard ITSs in order to infer complexity bounds for our generalized ITSs. The key idea of our technique is a summarization method that allows us to analyze components of the transition system independently. We implemented our contributions in the tool AProVE, and our experiments show that one can now infer bounds for significantly more TRSs than with previous state-of-the-art tools for term rewriting.

Supported by DFG grant GI 274/6-1 and the Air Force Research Laboratory (AFRL).

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 54.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 69.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    In this way, the complexity of \(\mathsf{gt}\) is 0, whereas comparisons have complexity 1 with the slightly more complicated encoding from [8]. Since this difference does not affect the asymptotic complexity of Example 2, we use the simpler encoding for the sake of readability.

  2. 2.

    Termination Problems Data Base, the collection of examples used at the annual Termination and Complexity Competition, see http://termination-portal.org.

  3. 3.

    See [29] for an adaption of an amortized analysis as in [27] to term rewriting. However, [29] is not automated, and it is restricted to ground rewriting with orthogonal rules.

  4. 4.

    See http://termination-portal.org/wiki/Termination_Competition/.

References

  1. Albert, E., Arenas, P., Genaim, S., Puebla, G.: Closed-form upper bounds in static cost analysis. J. Autom. Reasoning 46(2), 161–203 (2011)

    Article  MathSciNet  MATH  Google Scholar 

  2. Albert, E., Arenas, P., Genaim, S., Puebla, G., Zanardini, D.: Cost analysis of object-oriented bytecode programs. Theor. Comput. Sc. 413(1), 142–159 (2012)

    Article  MathSciNet  MATH  Google Scholar 

  3. Albert, E., Genaim, S., Gutièrrez, R.: A transformational approach to resource analysis with typed-norms. In: Gupta, G., Peña, R. (eds.) LOPSTR 2013. LNCS, vol. 8901, pp. 38–53. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-14125-1_3

    Google Scholar 

  4. Alias, C., Darte, A., Feautrier, P., Gonnord, L.: Multi-dimensional rankings, program termination, and complexity bounds of flowchart programs. In: Cousot, R., Martel, M. (eds.) SAS 2010. LNCS, vol. 6337, pp. 117–133. Springer, Heidelberg (2010). doi:10.1007/978-3-642-15769-1_8

    Chapter  Google Scholar 

  5. AProVE. https://aprove-developers.github.io/trs_complexity_via_its/

  6. Avanzini, M., Felgenhauer, B.: Type introduction for runtime complexity analysis. In: WST 2014, pp. 1–5 (2014). http://www.easychair.org/smart-program/VSL2014/WST-proceedings.pdf

  7. Avanzini, M., Moser, G., Schaper, M.: TcT: Tyrolean complexity tool. In: Chechik, M., Raskin, J.F. (eds.) TACAS 2016. LNCS, vol. 9636, pp. 407–423. Springer, Berlin, Heidelberg (2016). https://doi.org/10.1007/978-3-662-49674-9_24

    Chapter  Google Scholar 

  8. Avanzini, M., Moser, G.: A combination framework for complexity. Inform. Comput. 248, 22–55 (2016)

    Article  MathSciNet  MATH  Google Scholar 

  9. Baader, F., Nipkow, T.: Term Rewriting and All That. Cambridge U. Press, Cambridge (1998)

    Book  MATH  Google Scholar 

  10. Baillot, P., Dal Lago, U., Moyen, J.Y.: On quasi-interpretations, blind abstractions and implicit complexity. Math. Struct. Compt. Sci. 22(4), 549–580 (2012)

    Article  MathSciNet  MATH  Google Scholar 

  11. Blanc, R., Henzinger, T.A., Hottelier, T., Kovàcs, L.: ABC: Algebraic bound computation for loops. In: Clarke, E.M., Voronkov, A. (eds.) LPAR 2010. LNCS, vol. 6355, pp. 103–118. Springer, Berlin, Heidelberg (2010). https://doi.org/10.1007/978-3-642-17511-4_7

    Chapter  Google Scholar 

  12. Bonfante, G., Cichon, A., Marion, J.Y., Touzet, H.: Algorithms with polynomial interpretation termination proof. J. Funct. Program. 11(1), 33–53 (2001)

    Article  MathSciNet  MATH  Google Scholar 

  13. Brockschmidt, M., Emmes, F., Falke, S., Fuhs, C., Giesl, J.: Analyzing runtime and size complexity of integer programs. ACM TOPLAS 38(4), 13 (2016)

    Article  Google Scholar 

  14. Carbonneaux, Q., Hoffmann, J., Shao, Z.: Compositional certified resource bounds. In: PLDI 2015, pp. 467–478 (2015)

    Google Scholar 

  15. Debray, S., Lin, N.: Cost analysis of logic programs. TOPLAS 15(5), 826–875 (1993)

    Article  Google Scholar 

  16. Flores-Montoya, A., Hähnle, R.: Resource analysis of complex programs with cost equations. In: Garrigue, J. (ed.) APLAS 2014. LNCS, vol. 8858, pp. 275–295. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-12736-1_15

    Google Scholar 

  17. Flores-Montoya, A.: Upper and lower amortized cost bounds of programs expressed as cost relations. In: Fitzgerald, J., Heitmeyer, C., Gnesi, S., Philippou, A. (eds.) FM 2016. LNCS, vol. 9995, pp. 254–273. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-48989-6_16

    Chapter  Google Scholar 

  18. Frohn, F., Naaf, M., Hensel, J., Brockschmidt, M., Giesl, J.: Lower runtime bounds for integer programs. In: Olivetti, N., Tiwari, A. (eds.) IJCAR 2016. LNCS, vol. 9706, pp. 550–567. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-40229-1_37

    Google Scholar 

  19. Frohn, F., Giesl, J.: Analyzing runtime complexity via innermost runtime complexity. In: LPAR 2017, pp. 249–268 (2017)

    Google Scholar 

  20. Frohn, F., Giesl, J., Hensel, J., Aschermann, C., Ströder, T.: Lower bounds for runtime complexity of term rewriting. J. Autom. Reasoning 59(1), 121–163 (2017)

    Article  MathSciNet  MATH  Google Scholar 

  21. Fuhs, C., Giesl, J., Parting, M., Schneider-Kamp, P., Swiderski, S.: Proving termination by dep. pairs and inductive theorem proving. JAR 47(2), 133–160 (2011)

    Article  MATH  Google Scholar 

  22. Giesl, J., Aschermann, C., Brockschmidt, M., Emmes, F., Frohn, F., Fuhs, C., Hensel, J., Otto, C., Plücker, M., Schneider-Kamp, P., Ströder, T., Swiderski, S., Thiemann, R.: Analyzing program termination and complexity automatically with AProVE. J. Autom. Reasoning 58, 3–31 (2017)

    Article  MathSciNet  MATH  Google Scholar 

  23. Gulwani, S.: SPEED: Symbolic complexity bound analysis. In: Bouajjani, A., Maler, O. (eds.) CAV 2009. LNCS, vol. 5643, pp. 51–62. Springer, Berlin, Heidelberg (2009). https://doi.org/10.1007/978-3-642-02658-4_7

    Chapter  Google Scholar 

  24. Hirokawa, N., Moser, G.: Automated complexity analysis based on the dependency pair method. In: Armando, A., Baumgartner, P., Dowek, G. (eds.) IJCAR 2008. LNCS, vol. 5195, pp. 364–379. Springer, Berlin, Heidelberg (2008). https://doi.org/10.1007/978-3-540-71070-7_32

    Chapter  Google Scholar 

  25. Hofbauer, D., Lautemann, C.: Termination proofs and the length of derivations. In: Dershowitz, N. (ed.) RTA 1989. LNCS, vol. 355, pp. 167–177. Springer, Heidelberg (1989). doi:10.1007/3-540-51081-8_107

    Chapter  Google Scholar 

  26. Hoffmann, J.: Types with Potential: Polynomial Resource Bounds via Automatic Amortized Analysis. Ph.D. thesis, Ludwig-Maximilians-University Munich (2011)

    Google Scholar 

  27. Hoffmann, J., Aehlig, K., Hofmann, M.: Multivariate amortized resource analysis. ACM Trans. Program. Lang. Syst. 34(3), 14 (2012)

    Article  MATH  Google Scholar 

  28. Hoffmann, J., Das, A., Weng, S.C.: Towards automatic resource bound analysis for OCaml. In: POPL 2017, pp. 359–373 (2017)

    Google Scholar 

  29. Hofmann, M., Moser, G.: Multivariate amortised resource analysis for term rewrite systems. In: TLCA 2015, pp. 241–256 (2015)

    Google Scholar 

  30. Kapur, D., Narendran, P., Zhang, H.: On sufficient completeness and related properties of term rewriting systems. Acta Informatica 24, 395–415 (1987)

    Article  MathSciNet  MATH  Google Scholar 

  31. Emmanuel, K.: Completeness in data type specifications. In: Caviness, B.F. (ed.) EUROCAL 1985. LNCS, vol. 204, pp. 348–362. Springer, Heidelberg (1985). doi:10.1007/3-540-15984-3_291

    Google Scholar 

  32. Noschinski, L., Emmes, F., Giesl, J.: Analyzing innermost runtime complexity of term rewriting by dependency pairs. J. Autom. Reasoning 51(1), 27–56 (2013)

    Article  MathSciNet  MATH  Google Scholar 

  33. Serrano, A., López-García, P., Hermenegildo, M.: Resource usage analysis of logic programs via abstract interpretation using sized types. Theory Pract. Logic Program. 14(4–5), 739–754 (2014)

    Article  MATH  Google Scholar 

  34. Sinn, M., Zuleger, F., Veith, H.: Complexity and resource bound analysis of imperative programs using difference constraints. J. Autom. Reasoning 59(1), 3–45 (2017)

    Article  MathSciNet  MATH  Google Scholar 

  35. Wegbreit, B.: Mechanical program analysis. Commun. ACM 18, 528–539 (1975)

    Article  MathSciNet  MATH  Google Scholar 

  36. Zankl, H., Korp, M.: Modular complexity analysis for term rewriting. Logical Meth. Comput. Sci. 10(1), 1–34 (2014)

    Article  MathSciNet  MATH  Google Scholar 

  37. Zantema, H.: Termination of term rewriting: interpretation and type elimination. J. Symbol. Comput. 17(1), 23–50 (1994)

    Article  MathSciNet  MATH  Google Scholar 

Download references

Acknowledgments

We thank A. Flores-Montoya for his help with CoFloCo and the anonymous reviewers for their suggestions and comments.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jürgen Giesl .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2017 Springer International Publishing AG

About this paper

Cite this paper

Naaf, M., Frohn, F., Brockschmidt, M., Fuhs, C., Giesl, J. (2017). Complexity Analysis for Term Rewriting by Integer Transition Systems. In: Dixon, C., Finger, M. (eds) Frontiers of Combining Systems. FroCoS 2017. Lecture Notes in Computer Science(), vol 10483. Springer, Cham. https://doi.org/10.1007/978-3-319-66167-4_8

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-66167-4_8

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-66166-7

  • Online ISBN: 978-3-319-66167-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics