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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
See http://haskell.org/.
- 2.
We use the SMT Solvers z3 (https://github.com/Z3Prover/z3/wiki) and MiniSmt (http://cl-informatik.uibk.ac.at/software/minismt/).
- 3.
Detailed data is available at http://cl-informatik.uibk.ac.at/software/tct/experiments/ara_flops/.
- 4.
We refer to Version 10.4 of the Termination Problem Database, available from http://cl2-informatik.uibk.ac.at/mercurial.cgi/TPDB.
- 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
Sleator, D., Tarjan, R.: Self-adjusting binary trees. In: Proceedings of the 15th STOC, pp. 235–245. ACM (1983)
Tarjan, R.: Amortized computational complexity. SIAM J. Alg. Disc. Methods 6(2), 306–318 (1985)
Hoffmann, J., Das, A., Weng, S.: Towards automatic resource bound analysis for OCaml. In: Proceedings of the 44th POPL, pp. 359–373. ACM (2017)
Albert, E., Arenas, P., Genaim, S., Puebla, G.: Closed-form upper bounds in static cost analysis. JAR 46(2), 161–203 (2011)
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
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)
Okasaki, C.: Purely Functional Data Structures. Cambridge University Press, Cambridge (1999)
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
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)
Avanzini, M., Lago, U.D.: Automating sized-type inference for complexity analysis. In: PACMPL, vol. 1, pp. 43:1–43:29 (2017)
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
Moser, G., Schneckenreither, M.: Amortised analysis for bestcase lowerbounds (2018, submitted)
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
Baader, F., Nipkow, T.: Term Rewriting and All That. Cambridge University Press, Cambridge (1998)
TeReSe: Term Rewriting Systems. Cambridge Tracks in Theoretical Computer Science, vol. 55. Cambridge University Press (2003)
Thiemann, R.: The DP framework for proving termination of term rewriting. Ph.D. thesis, University of Aachen, Department of Computer Science (2007)
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
Farkas, J.: Theorie der einfachen ungleichungen. Journal für die reine und angewandte Mathematik 124, 1–27 (1902)
Hoffmann, J.: Types with potential: polynomial resource bounds via automatic amortized analysis. Ph.D. thesis, Ludwig-Maximilians-Universiät München (2011)
Hoffmann, J., Aehlig, K., Hofmann, M.: Multivariate amortized resource analysis. TOPLAS 34(3), 14 (2012)
Glenstrup, A.: Terminator II: stopping partial evaluation of fully recursive programs. Master’s thesis, Technical report DIKU-TR-99/8, DIKU (1999)
Frederiksen, C.: Automatic runtime analysis for first order functional programs. Master’s thesis, DIKU TOPPS D-470, DIKU (2002)
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)
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
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)
Flores-Montoya, A.: CoFloCo: system description. In: 15th International Workshop on Termination, vol. 20 (2016)
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
Author information
Authors and Affiliations
Corresponding authors
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2018 Springer International Publishing AG, part of Springer Nature
About this paper
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)