skip to main content
article
Open access

ACE: an automatic complexity evaluator

Published: 01 April 1988 Publication History

Abstract

There has been a great deal of research done on the evaluation of the complexity of particular algorithms; little effort, however, has been devoted to the mechanization of this evaluation. The ACE (Automatic Complexity Evaluator) system is able to analyze reasonably large programs, like sorting programs, in a fully mechanical way. A time-complexity function is derived from the initial functional program. This function is transformed into its nonrecursive equivalent according to MacCarthy's recursion induction principle, using a predefined library of recursive definitions. As the complexity is not a decidable property, this transformation will not be possible in all cases. The richer the predefined library is, the more likely the system is to succeed. The operations performed by ACE are described and the use of the system is illustrated with the analysis of a sorting algorithm. Related works and further improvements are discussed in the conclusion.

References

[1]
AHO, A. V., HOPCROFT, J. E., AND ULLMAN, J. D. The Design and Analysis of Computer Algorithms. Addison-Wesley, Reading, Mass., 1974.
[2]
BACKUS, J.W. Can programming be liberated from the Von Neumann style? A functional style and its algebra of programs. Commun. ACM 21, 8 (Aug. 1978), 613-641.
[3]
BACKUS, J.W. The algebra of functional programs: function level reasoning, linear equations, and extended definitions. Lecture Notes in Computer Science, 27. Springer-Verlag, New York, 1981, 1-43.
[4]
BURSTALL, R. M., AND DARLINGTON, J. A transformation system for developing recursive programs. J. ACM 24, 1 (Jan. 1977), 44-67.
[5]
COHEN, J. Computer-assisted microanalysis of programs. Commun. ACM 25, 10 (Oct. 1982), 724-733.
[6]
DARLINGTON, J., AND BURSTALL, R.M. A system which automatically improves programs. Acta Inf. 6, 1 (1976), 41-60.
[7]
DARLINGTON, J. Program transformation. In Functional Programming and Its Applications. J. Darlington, P. Henderson, and D. Turner, Eds. Cambridge University Press, 1982.
[8]
FEATHER, M.S. A system for assisting program transformation, ACM Trans. Program. Lang. Syst. 4, 1 (Jan. 1982), 1-20.
[9]
GUTTAG, J. V., HORNINO, J., AND WILLIAMS, J. FP with data abstraction and strong typing. In Proceedings of 1981 Conference on Functional Programming, Languages, and Computer Architecture (Portsmouth, 1981). ACM, New York, 1981, 11-24.
[10]
KNUTH, D. E. The Art of Computer Programming. Addison-Wesley, Reading, Mass., 1973.
[11]
LE M~TAYER, D. Analysis of functional programs by program transformation. In Proceedings of 1987 France-Japan Artificial Intelligence and Computer Science Symposium (Cannes, 1987). North-Holland, Amsterdam.
[12]
MACCARTHY, J. A basis for a mathematical theory of computation. In Computer Programming and Formal Systems. P. Braffort, and D. Hirsberg, Eds. North-Holland, Amsterdam, 1963.
[13]
MANNA, Z., NESS, S., AND VUILLEMIN, J. Inductive methods for proving properties of programs. Commun. ACM 16, 8 (Aug. 1973), 491-502.
[14]
STANAT, n. F., AND MACALLISTER, D.F. Discrete Mathematics in Computer Science. Prentice- Hall, Englewood Cliffs, N.J., 1977.
[15]
WEGBREIT, B. Mechanical program analysis. Commun. ACM 18, 9 (Sept. 1975), 528-539.
[16]
WEGBREIT, B. Goal-directed program transformation. IEEE Trans. Softw. Eng. SE-2, 2 (June 1976), 69-80.
[17]
WILLIAMS, J. On the development of the algebra of functional programs. ACM Trans. Program. Lang. Syst. 4, 4 (Oct. 82), 733-757.

Cited By

View all

Recommendations

Reviews

D. John Cooke

The ACE system provides a partial procedure for finding the worst-case complexity of FP programs. The notion of complexity used is essentially the (order of magnitude of the) number of recursive calls necessary for the program evaluation; as such, the complexity is expressed as a composite of standard functions such as exponentials and logarithms. Having such a measure facilitates comparison of different equivalent programs such as might be obtained by a program transformation system. This is paradoxical because ACE uses the FP algebra to perform transformations and simplifications of Cf, the complexity function for the program under investigation ( Cf is derived by a straightforward syntax-directed translation from the given FP program, f). Subsequently, recursion induction is used to extract a nonrecursive function. Other topics that the reader will encounter include fixpoint theory, folding, computational induction, and the splitting of complex conditionals into a set of simpler forms that each involve a single condition (following McCarthy). Unfortunately, as complexity is inexorably related to termination and termination is undecidable, the system does not always successfully yield a complexity function for a given program. Adding more transformations, more information on `standard' functions, and better approximating functions extends the set of programs on which ACE will succeed. The addition of more rules within the system, however, makes the rule selection process harder and the system slower—but that's another problem. The paper flows well; it consists of two introductory sections, two technical sections, a sizable example (example 3 of section 5 includes illustrations of most of the technical points mentioned earlier), and a conclusion. There is little comparable material in the literature, but all related background is adequately cross-referenced for those who need to brush up on their theory. The ACE system, emanating from ESPRIT project 302 (funded by the EEC), is a very neat application of established theory that is used to harness the emerging technology of program transformation. The use of the FP algebra is central to the methodology, but extensions to other similar languages are clearly possible by using FP as an internal/intermediate form. There are a few bothersome typographical errors and other minor irritations (most notably `verify' for `satisfy,' lower case `o' for the function composition symbol 3:9D, and :3WCfor the atom that is the empty sequence rather than &fgr; as used by Backus in his original FP paper) but all in all this is a very readable paper describing interesting and useful work.

Access critical reviews of Computing literature here

Become a reviewer for Computing Reviews.

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Programming Languages and Systems
ACM Transactions on Programming Languages and Systems  Volume 10, Issue 2
April 1988
154 pages
ISSN:0164-0925
EISSN:1558-4593
DOI:10.1145/42190
Issue’s Table of Contents

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 April 1988
Published in TOPLAS Volume 10, Issue 2

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)94
  • Downloads (Last 6 weeks)17
Reflects downloads up to 24 Dec 2024

Other Metrics

Citations

Cited By

View all

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media