Abstract
This paper is concerned with the time-analysis of functional programs. Techniques which enable us to reason formally about a program's execution costs have had relatively little attention in the study of functional programming. We concentrate here on the construction of equations which compute the time-complexity of expressions in a lazy higher-order language.
The problem with higher-order functions is that complexity is dependent on the cost of applying functional parameters. Structures called cost-closures are introduced to allow us to model both functional parameters and the cost of their application.
The problem with laziness is that complexity is dependent on context. Projections are used to characterise the context in which an expression is evaluated, and cost-equations are parameterised by this context-description to give a compositional time-analysis. Using this form of context information we introduce two types of time-equation: sufficient-time equations and necessary-time equations, which together provide bounds on the exact time-complexity.
This work was partially supported by ESPRIT Basic Research Action P3124
Chapter PDF
Similar content being viewed by others
Keywords
- Context Information
- Projection Transformer
- Functional Language
- Primitive Function
- Functional Programming Language
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
S. Abramsky and C.L. Hankin, editors. Abstract Interpretation of Declarative Languages. Ellis Horwood, 1987.
B. Bjerner and S. Holmström. A compositional approach to time analysis of first order lazy functional programs. In Functional Programming Languages and computer architecture, conference proceedings. ACM press, 1989.
B. Bjerner. Time Complexity of Programs in Type Theory. PhD thesis, Chalmers University of Technology, 1989.
G.L. Burn. A relationship between abstract interpretation and projection analysis (extended abstract). In 17th ACM Symposium on Principals of Programming Languages, January 1990.
K. Davis and P. Wadler. Backwards strictness analysis: Proved and improved. In Proceedings of Glasgow Workshop on Functional Programming, August 1989.
P. Flajolet. Mathematical methods in the analysis of algorithms and data structures. Report 400, INRIA, Le Chesnay, France, May 1985.
T. Hickey and J. Cohen. Automating program analysis. J. ACM, 35:185–220, January 1988.
R. J. M. Hughes. Backwards analysis of functional programs. DoC Research Report CSC/87/R3, University of Glasgow, March 1987.
D. LeMétayer. Mechanical analysis of program complexity. In ACM SIGPLAN 85 Symposium, July 1985.
D. LeMétayer. Analysis of functional programs by program transformation. In Second France-Japan Artificial Intelligence and Computer Science Symposium. North-Holland, 1988.
M. Rosendahl. Automatic complexity analysis. In Functional Programming Languages and computer architecture, conference proceedings. ACM press, 1989.
D. Sands. Complexity analysis for a higher order language. Technical Report DOC 88/14, Imperial College, October 1988.
P. Wadler. Strictness analysis aids time analysis. In 15th ACM Symposium on Principals of Programming Languages, January 1988.
B. Wegbreit. Mechanical program analysis. C.ACM, 18:528–539, September 1975.
P. Wadler and R. J. M. Hughes. Projections for strictness analysis. In 1987 Conference on Functional Programming and Computer Architecture, Portland, Oregon, September 1987.
S. C. Wray. Programming techniques for functional languages. Technical Report 92, University of Cambridge Computer Laboratory, June 1986.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1990 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Sands, D. (1990). Complexity analysis for a lazy higher-order language. In: Jones, N. (eds) ESOP '90. ESOP 1990. Lecture Notes in Computer Science, vol 432. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-52592-0_74
Download citation
DOI: https://doi.org/10.1007/3-540-52592-0_74
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-52592-9
Online ISBN: 978-3-540-47045-8
eBook Packages: Springer Book Archive