Skip to main content

Lower Runtime Bounds for Integer Programs

  • Conference paper
  • First Online:
Automated Reasoning (IJCAR 2016)

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

Included in the following conference series:

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

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

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

    Note that negations can be expressed by negating (in)equations directly, and disjunctions in programs can be expressed using multiple transitions.

  3. 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. 4.

    In the following, we often use arithmetic terms \(\mathcal {A}(\mathcal {V}_\ell )\) to denote functions \(\mathcal {V}_\ell \rightarrow \mathbb {R}\).

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

    The other rules for \(\leadsto \) are implicitly labeled with the identical substitution \(\mathsf {id}\).

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

  1. 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)

    Article  MathSciNet  MATH  Google Scholar 

  2. 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)

    Chapter  Google Scholar 

  3. 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)

    Chapter  Google Scholar 

  4. 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)

    Google Scholar 

  5. Benchmark examples. https://github.com/s-falke/kittel-koat/tree/master/koat-evaluation/examples

  6. 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)

    Chapter  Google Scholar 

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

    Chapter  Google Scholar 

  8. 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)

    Chapter  Google Scholar 

  9. Carbonneaux, Q., Hoffmann, J., Shao, Z.: Compositional certified resource bounds. In: Grove, D., Blackburn, S. (eds.) PLDI 2015, pp. 467–478, ACM (2015)

    Google Scholar 

  10. 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)

    Chapter  Google Scholar 

  11. 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)

    Google Scholar 

  12. 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)

    Chapter  Google Scholar 

  13. Farzan, A., Kincaid, Z.: Compositional recurrence analysis. In: Kaivola, R., Wahl, T. (eds.) FMCAD 2015, pp. 57–64. IEEE (2015)

    Google Scholar 

  14. 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)

    Google Scholar 

  15. 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)

    Google Scholar 

  16. 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/

  17. 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)

    Chapter  Google Scholar 

  18. 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)

    Chapter  Google Scholar 

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

    Article  MATH  Google Scholar 

  20. 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)

    Chapter  Google Scholar 

  21. Jeannet, B., Schrammel, P., Sankaranarayanan, S.: Abstract acceleration of general linear loops. ACM SIGPLAN Not. 49(1), 529–540 (2014)

    MATH  Google Scholar 

  22. 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)

    Article  MATH  Google Scholar 

  23. \({\sf LoAT}\). https://github.com/aprove-developers/LoAT

  24. 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)

    Google Scholar 

  25. 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)

    Chapter  Google Scholar 

  26. 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)

    Google Scholar 

Download references

Acknowledgments

We thank S. Genaim and J. Böker for discussions and comments.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to J. Giesl .

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics