Skip to main content

Calculating Polynomial Runtime Properties

  • Conference paper
Programming Languages and Systems (APLAS 2005)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 3780))

Included in the following conference series:

Abstract

Affine size-change analysis has been used for termination analysis of eager functional programming languages. The same style of analysis is also capable of compactly recording and calculating other properties of programs, including their runtime, maximum stack depth, and (relative) path time costs. In this paper we show how precise (not just big- \(\mathcal{O}\)) polynomial bounds on such costs may be calculated on programs, by a characterization as a problem in quantifier elimination. The technique is decidable, and complete for a class of size-change terminating programs with limited-degree polynomial costs. An extension to the technique allows the calculation of some classes of exponential-cost programs. We demonstrate the new technique by recording the calculation in numbers-of-function (or procedure) calls for a simple functional definition language, but it can also be applied to imperative languages. The technique is automated within the reduce computer algebra system.

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

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Aehlig, K., Schwichtenberg, H.: A Syntactical Analysis of Non-Size-Increasing Polynomial Time Computation. ACM Trans. Comput. Logic 3(3), 383–401 (2002)

    Article  MathSciNet  Google Scholar 

  2. Anderson, H., Khoo, S.C.: Affine-based Size-change Termination. In: Ohori, A. (ed.) APLAS 2003. LNCS, vol. 2895, pp. 122–140. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  3. Ball, T., Larus, J.R.: Branch Prediction For Free. In: SIGPLAN Conference on Programming Language Design and Implementation, pp. 300–313 (1993)

    Google Scholar 

  4. Bellantoni, S., Cook, S.: A New Recursion-Theoretic Characterization of the Polytime Functions (Extended Abstract). In: STOC 1992: Proceedings of the twenty-fourth annual ACM symposium on Theory of computing, pp. 283–293. ACM Press, New York (1992)

    Chapter  Google Scholar 

  5. Caseiro, V.H.: Equations for Defining Poly-Time Functions. PhD thesis, University of Oslo (1997)

    Google Scholar 

  6. Caviness, B.F., Johnson, J.R. (eds.): Quantifier Elimination and Cylindrical Algebraic Decomposition. Springer, Heidelberg (1998)

    MATH  Google Scholar 

  7. Collins, G.E.: Quantifier Elimination for Real Closed Fields by Cylindrical Algebraic Decomposition. In: Brakhage, H. (ed.) Automata Theory and Formal Languages, Berlin, vol. 33, pp. 134–183 (1975)

    Google Scholar 

  8. Dolzmann, A., Sturm, T.: REDLOG: Computer algebra meets computer logic. SIGSAM Bulletin (ACM Special Interest Group on Symbolic and Algebraic Manipulation) 31(2), 2–9 (1997)

    MathSciNet  Google Scholar 

  9. Hong, H., et al., http://www.cs.usna.edu/~qepcad/B/QEPCAD.html

  10. Gómez, G., Liu, Y.A.: Automatic Time-Bound Analysis for a Higher-Order Language. In: PEPM 2002: Proceedings of the 2002 ACM SIGPLAN workshop on Partial evaluation and semantics-based program manipulation, pp. 75–86. ACM Press, New York (2002)

    Chapter  Google Scholar 

  11. Grobauer, B.: Cost Recurrences for DML Programs. In: International Conference on Functional Programming, pp. 253–264 (2001)

    Google Scholar 

  12. Hofmann, M.: Linear Types and Non-Size-Increasing Polynomial Time Computation. In: Logic in Computer Science, pp. 464–473 (1999)

    Google Scholar 

  13. Hong, H.: RISC-CLP(Real): Constraint Logic Programming over Real Numbers. In: Benhamou, F., Colmerauer, A. (eds.) Constraint Logic Programming: Selected Research. MIT Press, Cambridge (1993)

    Google Scholar 

  14. Jones, N.: Private communication (June 2003)

    Google Scholar 

  15. Kapur, D.: Automatically Generating Loop Invariants Using Quantifier Elimination. In: Proceedings of the 10th International Conference on Applications of Computer Algebra. ACA and Lamar University (July 2004)

    Google Scholar 

  16. Kaser, O., Ramakrishnan, C.R., Pawagi, S.: On the Conversion of Indirect to Direct Recursion. LOPLAS 2(1-4), 151–164 (1993)

    Article  Google Scholar 

  17. Khoo, S.C., Anderson, H.: Bounded Size-Change Termination. Technical Report TRB6/05, National University of Singapore (June 2005)

    Google Scholar 

  18. Lee, C.S., Jones, N.D., Ben-Amram, A.M.: The Size-Change Principle for Program Termination. In: Conference Record of the 28th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, January 2001, vol. 28, pp. 81–92. ACM Press, New York (2001)

    Google Scholar 

  19. Rosendahl, M.: Automatic Complexity Analysis. In: FPCA 1989: Proceedings of the fourth international conference on Functional programming languages and computer architecture, pp. 144–156. ACM Press, New York (1989)

    Chapter  Google Scholar 

  20. Van Roy, P., Haridi, S.: Concepts, Techniques, and Models of Computer Programming. MIT Press, Cambridge (2004)

    Google Scholar 

  21. Sands, D.: Complexity Analysis for a Lazy Higher-Order Language. In: Jones, N.D. (ed.) ESOP 1990. LNCS, vol. 432, pp. 361–376. Springer, Heidelberg (1990)

    Google Scholar 

  22. Sankaranarayanan, S., Sipma, H., Manna, Z.: Non-linear loop invariant generation using Gröbner bases. In: Proceedings of the 31st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2004, Venice, Italy, January 14-16, pp. 318–329 (2004)

    Google Scholar 

  23. Tarski, A.: A decision method for elementary algebra and geometry. Prepared for publication by J.C.C. Mac Kinsey, Berkeley (1951)

    Google Scholar 

  24. Yu, T., Kaser, O.: A Note on “On the Conversion of Indirect to Direct Recursion”. ACM Trans. Program. Lang. Syst. 19(6), 1085–1087 (1997)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2005 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Anderson, H., Khoo, SC., Andrei, S., Luca, B. (2005). Calculating Polynomial Runtime Properties. In: Yi, K. (eds) Programming Languages and Systems. APLAS 2005. Lecture Notes in Computer Science, vol 3780. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11575467_16

Download citation

  • DOI: https://doi.org/10.1007/11575467_16

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-29735-2

  • Online ISBN: 978-3-540-32247-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics