Abstract
We present a technique to infer lower bounds on the worst-case runtime complexity of integer programs. To this end, we construct symbolic representations of program executions using a framework for iterative, under-approximating program simplification. The core of this simplification is a method for (under-approximating) program acceleration based on recurrence solving and a variation of ranking functions. Afterwards, we deduce asymptotic lower bounds from the resulting simplified programs. We implemented our technique in our tool LoAT and show that it infers non-trivial lower bounds for a large number of examples.
Supported by the DFG grant GI 274/6-1 and the Air Force Research Laboratory (AFRL).
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
Our implementation only supports addition, subtraction, multiplication, division, and exponentiation. Since we consider integer programs, we only allow programs where all variable values are integers (so in contrast to \(x=\frac{1}{2} x\), the assignment \(x=\frac{1}{2} x + \frac{1}{2} x^2\) is permitted). While our program simplification technique preserves this property, we do not allow division or exponentiation in the initial program to ensure its validity.
- 2.
Note that negations can be expressed by negating (in)equations directly, and disjunctions in programs can be expressed using multiple transitions.
- 3.
Programs with \(\mathsf {dh}_\mathcal {T}(\varvec{v}) = \omega \) result from non-termination or non-determinism. As an example, consider the program \(x =\texttt {random}(0,\omega )\); while \(x > 0\) do \(x = x -\,\! 1\) done.
- 4.
In the following, we often use arithmetic terms \(\mathcal {A}(\mathcal {V}_\ell )\) to denote functions \(\mathcal {V}_\ell \rightarrow \mathbb {R}\).
- 5.
For all \(x \in \mathcal {PV}\), \(\mathrm {ren}\circ \eta _1 \circ \eta _2(x) = \mathrm {ren}(\eta _1(\eta _2(x))) = \eta _2(x)[x_1/\eta _1(x_1), \ldots , x_n/\eta _1(x_n), tv _1/\mathrm {ren}( tv _1), \ldots , tv _m/\mathrm {ren}( tv _m)]\) if \(\mathcal {PV}= \{ x_1,\ldots ,x_n \}\) and \(\mathcal {TV}_{\ell _2} = \{ tv _1, \ldots , tv _m \}\).
- 6.
To ease the presentation, we restrict ourselves to binary operations f. For operations of arity \(m\), one would need limit vectors of the form \((\bullet _1, \ldots , \bullet _m)\).
- 7.
The other rules for \(\leadsto \) are implicitly labeled with the identical substitution \(\mathsf {id}\).
- 8.
\(\sigma = [ tv / \frac{1}{2}x^2 + \frac{1}{2} x - 1]\) satisfies the condition \(\varvec{v}(y\sigma ) \in \mathbb {Z}\) for all \(\varvec{v}\in \mathcal {V}\! al _{\ell _0}\) and \(y \in \mathcal {V}_{\ell _0}\).
References
Albert, E., Genaim, S., Masud, A.N.: On the inference of resource usage upper and lower bounds. ACM Trans. Comput. Logic 14(3), 22:1–22:35 (2013)
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)
Alonso-Blas, D.E., Genaim, S.: On the limits of the classical approach to cost analysis. In: Miné, A., Schmidt, D. (eds.) SAS 2012. LNCS, vol. 7460, pp. 405–421. Springer, Heidelberg (2012)
Bagnara, R., Pescetti, A., Zaccagnini, A., Zaffanella, E.: \({\sf PURRS}\): towards computer algebra support for fully automatic worst-case complexity analysis. CoRR abs/cs/0512056 (2005)
Benchmark examples. https://github.com/s-falke/kittel-koat/tree/master/koat-evaluation/examples
Bradley, A.R., Manna, Z., Sipma, H.B.: Linear ranking with reachability. In: Etessami, K., Rajamani, S.K. (eds.) CAV 2005. LNCS, vol. 3576, pp. 491–504. Springer, Heidelberg (2005)
Brockschmidt, M., Cook, B., Fuhs, C.: Better termination proving through cooperation. In: Sharygina, N., Veith, H. (eds.) CAV 2013. LNCS, vol. 8044, pp. 413–429. Springer, Heidelberg (2013)
Brockschmidt, M., Emmes, F., Falke, S., Fuhs, C., Giesl, J.: Alternating runtime and size complexity analysis of integer programs. In: Ábrahám, E., Havelund, K. (eds.) TACAS 2014 (ETAPS). LNCS, vol. 8413, pp. 140–155. Springer, Heidelberg (2014)
Carbonneaux, Q., Hoffmann, J., Shao, Z.: Compositional certified resource bounds. In: Grove, D., Blackburn, S. (eds.) PLDI 2015, pp. 467–478, ACM (2015)
de Moura, L., Bjørner, N.S.: \(\sf Z3\): an efficient SMT solver. In: Ramakrishnan, C.R., Rehof, J. (eds.) TACAS 2008. LNCS, vol. 4963, pp. 337–340. Springer, Heidelberg (2008)
Debray, S., López-García, P., Hermenegildo, M.V., Lin, N.: Lower bound cost estimation for logic programs. In: Maluszynski, J. (ed.) ILPS 1997, pp. 291–305. MIT Press (1997)
Falke, S., Kapur, D., Sinz, C.: Termination analysis of imperative programs using bitvector arithmetic. In: Joshi, R., Müller, P., Podelski, A. (eds.) VSTTE 2012. LNCS, vol. 7152, pp. 261–277. Springer, Heidelberg (2012)
Farzan, A., Kincaid, Z.: Compositional recurrence analysis. In: Kaivola, R., Wahl, T. (eds.) FMCAD 2015, pp. 57–64. IEEE (2015)
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, Heidelberg (2014)
Frohn, F., Giesl, J., Emmes, F., Ströder, T., Aschermann, C., Hensel, J.: Inferring lower bounds for runtime complexity. In: Fernández, M. (ed.) RTA 2015. LIPIcs, vol. 36, pp. 334–349. Dagstuhl Publishing (2015)
Frohn, F., Naaf, M., Hensel, J., Brockschmidt, M., Giesl, J.: Proofs and empirical evaluation of “Lower Runtime Bounds for Integer Programs” (2016). http://aprove.informatik.rwth-aachen.de/eval/integerLower/
Gonnord, L., Halbwachs, N.: Combining widening and acceleration in linear relation analysis. In: Yi, K. (ed.) SAS 2006. LNCS, vol. 4134, pp. 144–160. Springer, Heidelberg (2006)
Hofbauer, D., Lautemann, C.: Termination proofs and the length of derivations. In: Dershowitz, N. (ed.) Rewriting Techniques and Applications. LNCS, vol. 355, pp. 167–177. Springer, Heidelberg (1989)
Hoffmann, J., Aehlig, K., Hofmann, M.: Multivariate amortized resource analysis. ACM Trans. Program. Lang. Syst. 34(3), 14:1–14:62 (2012)
Jeannet, B., Miné, A.: \({\sf APRON}\): a library of numerical abstract domains for static analysis. In: Bouajjani, A., Maler, O. (eds.) CAV 2009. LNCS, vol. 5643, pp. 661–667. Springer, Heidelberg (2009)
Jeannet, B., Schrammel, P., Sankaranarayanan, S.: Abstract acceleration of general linear loops. ACM SIGPLAN Not. 49(1), 529–540 (2014)
Kroening, D., Lewis, M., Weissenbacher, G.: Under-approximating loops in C programs for fast counterexample detection. Form. Meth. Sys. Des. 47(1), 75–92 (2015)
\({\sf LoAT}\). https://github.com/aprove-developers/LoAT
Madhukar, K., Wachter, B., Kroening, D., Lewis, M., Srivas, M.K.: Accelerating invariant generation. In: Kaivola, R., Wahl, T. (eds.) FMCAD 2015, pp. 105–111. IEEE (2015)
Podelski, A., Rybalchenko, A.: A complete method for the synthesis of linear ranking functions. In: Steffen, B., Levi, G. (eds.) VMCAI 2004. LNCS, vol. 2937, pp. 239–251. Springer, Heidelberg (2004)
Sinn, M., Zuleger, F., Veith, H.: A simple and scalable static analysis for bound analysis and amortized complexity analysis. In: Biere, A., Bloem, R. (eds.) CAV 2014. LNCS, vol. 8559, pp. 745–761. Springer, Heidelberg (2014)
Acknowledgments
We thank S. Genaim and J. Böker for discussions and comments.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2016 Springer International Publishing Switzerland
About this paper
Cite this paper
Frohn, F., Naaf, M., Hensel, J., Brockschmidt, M., Giesl, J. (2016). Lower Runtime Bounds for Integer Programs. In: Olivetti, N., Tiwari, A. (eds) Automated Reasoning. IJCAR 2016. Lecture Notes in Computer Science(), vol 9706. Springer, Cham. https://doi.org/10.1007/978-3-319-40229-1_37
Download citation
DOI: https://doi.org/10.1007/978-3-319-40229-1_37
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-40228-4
Online ISBN: 978-3-319-40229-1
eBook Packages: Computer ScienceComputer Science (R0)