Calculating polynomial runtime properties

  • Authors:
  • Hugh Anderson;Siau-Cheng Khoo;Stefan Andrei;Beatrice Luca

  • Affiliations:
  • Department of Computer Science, School of Computing, National University of Singapore;Department of Computer Science, School of Computing, National University of Singapore;Department of Computer Science, School of Computing, National University of Singapore;Department of Computer Science, School of Computing, National University of Singapore

  • Venue:
  • APLAS'05 Proceedings of the Third Asian conference on Programming Languages and Systems
  • Year:
  • 2005

Quantified Score

Hi-index 0.00

Visualization

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.