Skip to main content

Automated Amortised Resource Analysis for Term Rewrite Systems

  • Conference paper
  • First Online:
Functional and Logic Programming (FLOPS 2018)

Abstract

Based on earlier work on amortised resource analysis, we establish a novel automated amortised resource analysis for term rewrite systems. The method is presented in an inference system akin to a type system and gives rise to polynomial bounds on the innermost runtime complexity of the analysed term rewrite system. Our analysis does not restrict the input rewrite system in any way. This facilitates integration in a general framework for resource analysis of programs. In particular, we have implemented the method and integrated it into our tool .

This research is partly supported by DARPA/AFRL contract number FA8750-17-C-088.

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 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.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

Similar content being viewed by others

Notes

  1. 1.

    See http://haskell.org/.

  2. 2.

    We use the SMT Solvers z3 (https://github.com/Z3Prover/z3/wiki) and MiniSmt (http://cl-informatik.uibk.ac.at/software/minismt/).

  3. 3.

    Detailed data is available at http://cl-informatik.uibk.ac.at/software/tct/experiments/ara_flops/.

  4. 4.

    We refer to Version 10.4 of the Termination Problem Database, available from http://cl2-informatik.uibk.ac.at/mercurial.cgi/TPDB.

  5. 5.

    See https://aprove-developers.github.io/trs_complexity_via_its/ for detailed results of AProVE. Timeout: 300 s, Intel Xeon with 4 cores at 2.33 GHz and 16 GB of RAM.

References

  1. Sleator, D., Tarjan, R.: Self-adjusting binary trees. In: Proceedings of the 15th STOC, pp. 235–245. ACM (1983)

    Google Scholar 

  2. Tarjan, R.: Amortized computational complexity. SIAM J. Alg. Disc. Methods 6(2), 306–318 (1985)

    Article  MathSciNet  Google Scholar 

  3. Hoffmann, J., Das, A., Weng, S.: Towards automatic resource bound analysis for OCaml. In: Proceedings of the 44th POPL, pp. 359–373. ACM (2017)

    Article  Google Scholar 

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

    Article  MathSciNet  Google Scholar 

  5. 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 

  6. Sinn, M., Zuleger, F., Veith, H.: A simple and scalable static analysis for bound analysis and amortized complexity analysis. In: Proceedings of the Software Engineering. LNI, vol. 252, pp. 101–102 (2016)

    Google Scholar 

  7. Okasaki, C.: Purely Functional Data Structures. Cambridge University Press, Cambridge (1999)

    MATH  Google Scholar 

  8. Hofmann, M., Moser, G.: Amortised resource analysis and typed polynomial interpretations. In: Dowek, G. (ed.) RTA 2014. LNCS, vol. 8560, pp. 272–286. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-08918-8_19

    Chapter  MATH  Google Scholar 

  9. Hofmann, M., Moser, G.: Multivariate amortised resource analysis for term rewrite systems. In: Proceedings of the 13th TLCA. LIPIcs, vol. 38, pp. 241–256 (2015)

    Google Scholar 

  10. Avanzini, M., Lago, U.D.: Automating sized-type inference for complexity analysis. In: PACMPL, vol. 1, pp. 43:1–43:29 (2017)

    Article  Google Scholar 

  11. 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, Heidelberg (2016). https://doi.org/10.1007/978-3-662-49674-9_24

    Chapter  Google Scholar 

  12. Moser, G., Schneckenreither, M.: Amortised analysis for bestcase lowerbounds (2018, submitted)

    Google Scholar 

  13. Schneckenreither, M.: Amortized resource analysis for term rewrite systems. Master’s thesis, University of Innsbruck (2018). https://www.uibk.ac.at/wipl/team/team/docs/masterthesis_schneckenreither.pdf

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

    Book  Google Scholar 

  15. TeReSe: Term Rewriting Systems. Cambridge Tracks in Theoretical Computer Science, vol. 55. Cambridge University Press (2003)

    Google Scholar 

  16. Thiemann, R.: The DP framework for proving termination of term rewriting. Ph.D. thesis, University of Aachen, Department of Computer Science (2007)

    Google Scholar 

  17. Barrett, C., Fontaine, P., Tinelli, C.: The SMT-LIB Standard: Version 2.6. Technical report, Department of Computer Science, The University of Iowa (2017). www.SMT-LIB.org

  18. Farkas, J.: Theorie der einfachen ungleichungen. Journal für die reine und angewandte Mathematik 124, 1–27 (1902)

    MathSciNet  MATH  Google Scholar 

  19. Hoffmann, J.: Types with potential: polynomial resource bounds via automatic amortized analysis. Ph.D. thesis, Ludwig-Maximilians-Universiät München (2011)

    Google Scholar 

  20. Hoffmann, J., Aehlig, K., Hofmann, M.: Multivariate amortized resource analysis. TOPLAS 34(3), 14 (2012)

    Article  Google Scholar 

  21. Glenstrup, A.: Terminator II: stopping partial evaluation of fully recursive programs. Master’s thesis, Technical report DIKU-TR-99/8, DIKU (1999)

    Google Scholar 

  22. Frederiksen, C.: Automatic runtime analysis for first order functional programs. Master’s thesis, DIKU TOPPS D-470, DIKU (2002)

    Google Scholar 

  23. Avanzini, M., Lago, U.D., Moser, G.: Analysing the complexity of functional programs: higher-order meets first-order. In: Proceedings of the 20th ICFP, pp. 152–164. ACM (2015)

    Google Scholar 

  24. Naaf, M., Frohn, F., Brockschmidt, M., Fuhs, C., Giesl, J.: Complexity analysis for term rewriting by integer transition systems. In: Dixon, C., Finger, M. (eds.) FroCoS 2017. LNCS (LNAI), vol. 10483, pp. 132–150. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-66167-4_8

    Chapter  MATH  Google Scholar 

  25. 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. JAR 58(1), 3–31 (2017)

    Article  MathSciNet  Google Scholar 

  26. Flores-Montoya, A.: CoFloCo: system description. In: 15th International Workshop on Termination, vol. 20 (2016)

    Google Scholar 

  27. Nipkow, T.: Amortized complexity verified. In: Urban, C., Zhang, X. (eds.) ITP 2015. LNCS, vol. 9236, pp. 310–324. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-22102-1_21

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding authors

Correspondence to Georg Moser or Manuel Schneckenreither .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer International Publishing AG, part of Springer Nature

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Moser, G., Schneckenreither, M. (2018). Automated Amortised Resource Analysis for Term Rewrite Systems. In: Gallagher, J., Sulzmann, M. (eds) Functional and Logic Programming. FLOPS 2018. Lecture Notes in Computer Science(), vol 10818. Springer, Cham. https://doi.org/10.1007/978-3-319-90686-7_14

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-90686-7_14

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-90685-0

  • Online ISBN: 978-3-319-90686-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics