Abstract
This paper presents a type-based analysis for inferring size- and cost-equations for recursive, higher-order and polymorphic functional programs without requiring user annotations or unusual syntax. Our type reconstruction algorithm is capable of inferring first-order cost equations for a non-trivial subset of higher-order, recursive and polymorphic functions. We illustrate the approach with reference to some standard examples of recursive programs.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Amtoft, T., Nielson, F., Nielson, H.R.: Type and Effect Systems: Behaviours for Concurrency. Imperial College Press, London (1999)
Benzinger, R.: Automated Complexity Analysis of Nuprl Extracted Programs. Journal of Functional Programming 11(1), 3–31 (2001)
Chin, W.-N., Khoo, S.-C.: Calculating Sized Types. Higher-Order and Symbolic Computing 14(2,3) (2001)
Damas, L., Milner, A.J.R.G.: Principal Type-Schemes for Functional Programs. In: Proc. 1982 ACM Symp. on Principles of Prog. Langs. – POPL 1982, pp. 207–212 (1982)
Dornic, V., Jouvelot, P., Gifford, D.K.: Polymorphic Time Systems for Estimating Program Complexity. ACM Letters on Prog. Lang. and Systems 1(1), 33–45 (1992)
Hughes, R.J.M., Pareto, L., Sabry, A.: Proving the Correctness of Reactive Systems using Sized Types. In: Proc 1996 ACM Symposium on Principles of Programming Languages – POPL 1996, St Petersburg, FL (January 1996)
Le Métayer, D.: ACE: An Automatic Complexity Evaluator. ACM Transactions on Programming Languages and Systems 10(2) (April 1988)
Levy, H., Lessman, F.: Finite Difference Equations. Macmillan, Basingstoke (1961)
Loidl, H.-W., Hammond, K.: A Sized Time System for a Parallel Functional Language. In: Glasgow Workshop on Functional Programming, Ullapool (July 1996)
Milner, A.J.R.G.: A Theory of Type Polymorphism in Programming. J. Computer System Sciences 17(3), 348–375 (1976)
Nielson, F., Nielson, H., Hankin, C.: Principles of Program Analysis. Springer, Heidelberg (1999)
Rebón Portillo, Á., Hammond, K., Loidl, H.-W., Vasconcelos, P.B.: Cost Analysis using Automatic Size and Time Inference. In: Peña, R., Arts, T. (eds.) IFL 2002. LNCS, vol. 2670, Springer, Heidelberg (2003)
Reistad, B., Gifford, D.K.: Static Dependent Costs for Estimating Execution Time. In: Proc. 1994 ACM Conference on Lisp and Functional Programming – LFP 1994, June 1994, pp. 65–78, Orlando, FL (1994)
Rosendahl, M.: Automatic Complexity Analysis. In: Proc. 1989 Intl. Conf. on Functional Prog. Langs. and Comp. Arch. – FPCA 1989, pp. 144–156 (1989)
Turner, D.A.: Elementary Strong Functional Programming. In: Hartel, P.H., Plasmeijer, R. (eds.) FPLE 1995. LNCS, vol. 1022, Springer, Heidelberg (1995)
Vasconcelos, P.B., Hammond, K.: A Type and Effect System for Costing Recursive, Higher-Order and Polymorphic Functional Programs (2004) (in preparation)
Wegbreit, B.: Mechanical Program Analysis. Comm. of the ACM 18(9) (1975)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2004 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Vasconcelos, P.B., Hammond, K. (2004). Inferring Cost Equations for Recursive, Polymorphic and Higher-Order Functional Programs. In: Trinder, P., Michaelson, G.J., Peña, R. (eds) Implementation of Functional Languages. IFL 2003. Lecture Notes in Computer Science, vol 3145. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-27861-0_6
Download citation
DOI: https://doi.org/10.1007/978-3-540-27861-0_6
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-23727-3
Online ISBN: 978-3-540-27861-0
eBook Packages: Computer ScienceComputer Science (R0)