More Precise Yet Widely Applicable Cost Analysis
Cost analysis aims at determining the amount of resources required to run a program in terms of its input data sizes. Automatically inferring precise bounds, while at the same time being able to handle a wide class of programs, is a main challenge in cost analysis. (1) Existing methods which rely on computer algebra systems (CAS) to solve the obtained cost recurrence equations (CR) are very precise when applicable, but handle a very restricted class of CR. (2) Specific solvers developed for CR tend to sacrifice accuracy for wider applicability. In this paper, we present a novel approach to inferring precise upper and lower bounds on CR which, when compared to (1), is strictly more widely applicable while precision is kept and when compared to (2), is in practice more precise (obtaining even tighter complexity orders), keeps wide applicability and, besides, can be applied to obtain useful lower bounds as well. The main novelty is that we are able to accurately bound the worst-case/best-case cost of each iteration of the program loops and, then, by summing the resulting sequences, we achieve very precise upper/lower bounds.
KeywordsCost Analysis Recurrence Relation Cost Relation Cost Model Ranking Function
Unable to display preview. Download preview PDF.
- 2.Albert, E., Arenas, P., Genaim, S., Puebla, G.: Closed-Form Upper Bounds in Static Cost Analysis. Journal of Automated Reasoning (to appear, 2010)Google Scholar
- 4.Bagnara, R., Pescetti, A., Zaccagnini, A., Zaffanella, E.: PURRS: Towards Computer Algebra Support for Fully Automatic Worst-Case Complexity Analysis. Technical report (2005), arXiv:cs/0512056, http://arxiv.org/
- 7.Cousot, P., Halbwachs, N.: Automatic discovery of linear restraints among variables of a program. In: Proc. POPL. ACM, New York (1978)Google Scholar
- 8.Crary, K., Weirich, S.: Resource bound certification. In: POPL 2000. ACM Press, New York (2000)Google Scholar
- 9.Gulwani, S., Mehra, K.K., Chilimbi, T.M.: Speed: precise and efficient static estimation of program computational complexity. In: POPL, pp. 127–139. ACM, New York (2009)Google Scholar
- 11.Marriot, K., Stuckey, P.: Programming with Constraints: An Introduction. The MIT Press, Cambridge (1998)Google Scholar
- 12.Maxima.sourceforge.net. Maxima, a Computer Algebra System. Version 5.21.1 (2009), http://maxima.sourceforge.net/
- 13.Wegbreit, B.: Mechanical Program Analysis. Communications of the ACM 18(9) (1975)Google Scholar