Abstract
This paper presents a system of cost derivation for higher-order and polymorphic functional programs based on a notion of sized types and exploiting a type-and-effect system approach. The paper gives an operational semantics of cost for a simple strict functional language in terms of λ-calculus β-reduction steps and introduces type rules describing cost effects. The type system is based on intersection types. The use of discrete polymorphism (intersection types) instead of the usual parametric polymorphism approach improves the analysis and solves, in many cases, the “size aliasing problem” that has been identified as a limitation on previous type-and-effect approaches. Finally we provide a proof of the soundness of our effect system with respect to the cost semantics.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Amtoft, T., Nielson, F., Nielson, H.R.: Type and Effect Systems: Behaviours for Concurrency. Imperial College Press (1999)
Banerjee, A., Jensen, T.: Modular control-flow analysis with rank 2 intersection types. Mathematical. Structures in Comp. Sci. 13(1), 87–124 (2003)
Barendregt, H.: The Lambda Calculus. Its Syntax and Semantics. In: Studies in Logic and the Foundations of Mathematics, vol. 103, North-Holland, Amsterdam (1984)
Barendregt, H., Coppo, M., Dezani-Ciancaglini, M.: A filter lambda model and the completeness of type assignment. The Journal of Symbolic Logic 48(4), 931–940 (1983)
Carlier, S., Polakow, J., Wells, J.B., Kfoury, A.J.: System e: Expansion variables for flexible typing with linear and non-linear types and intersection types. In: Schmidt, D. (ed.) ESOP 2004. LNCS, vol. 2986, pp. 294–309. Springer, Heidelberg (2004)
Chin, W.-N., Khoo, S.-C.: Calculating Sized Types. Higher-Order and Symbolic Computing 14(2,3) (2001)
Coppo, M., Dezani-Ciancaglini, M.: An extension of the basic functionality theory for the λ-calculus. Notre-Dame Journal of Formal Logic 21(4), 685–693 (1980)
Coppo, M., Giannini, P.: Principal types and unification for simple intersection type systems. Information and Computation 122(1) (1995)
Lago, U.D., Martini, S.: An invariant cost model for the lambda calculus. In: Beckmann, A., Berger, U., Löwe, B., Tucker, J.V. (eds.) CiE 2006. LNCS, vol. 3988, pp. 105–114. Springer, Heidelberg (2006)
Damiani, F.: Rank 2 intersection types for local definitions and conditional expressions. ACM Transactions On Programming Languages and Systems 25(4), 401–451 (2003)
Damiani, F., Giannini, P.: A decidable intersection type system based on relevance. In: Theoretical Aspects of Computer Science. LNCS, Springer, Heidelberg (1994)
Damiani, F.: Rank-2 Intersection and Polymorphic Recursion. In: Urzyczyn, P. (ed.) TLCA 2005. LNCS, vol. 3461, pp. 146–161. Springer, Heidelberg (2005)
Davies, R., Pfenning, F.: Intersection types and computational effects. In: ICFP, pp. 198–208 (2000)
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)
Felleisen, M., Friedman, D.P.: Control Operators, the SECD-Machine and the λ-Calculus. In: Wirsing, M. (ed.) Formal Description of Programming Concepts III, pp. 193–217. Elsevier, Amsterdam (1986)
Grobauer, B.: Cost Recurrences for DML Programs. In: Proc. 2001 ACM Intl. Conf. on Functional Programming – ICFP 2001, Florence, Italy (September 2001)
Hofmann, M., Jost, S.: Type-based amortised heap-space analysis (for an object-oriented language). In: Sestoft, P. (ed.) ESOP 2006 and ETAPS 2006. LNCS, vol. 3924, pp. 22–37. Springer, Heidelberg (2006)
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)
Jim, T.: Rank 2 type systems and recursive definitions. Technical Report MIT/LCS/TM-531, Massachusetts Institute of Technology, Laboratory for Computer Science (November 1995)
Kfoury, A.J., Wells, J.B.: Principality and decidable type inference for finite-rank intersection types. In: Assaf, J. (ed.) popl99, pp. 161–174. ACM Press, New York (1999)
Launchbury, J.: A Natural Semantics for Lazy Evaluation. In: Proc. 1993 ACM Symp. on Principles of Prog. Langs. – POPL 1993, pp. 144–154 (1993)
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)
Pottinger, G.: A type assignement for the strongly normalizable terms. In: Hindley, J.R., Seldin, J.P. (eds.) To H.B. Curry, Essays in Combinatory Logic, Lambda-calculus and Formalism, pp. 561–577. Academic Press, San Diego (1980)
Portillo, A.J.R., Hammond, K., Loidl, H.-W., Vasconcelos, P.: Cost analysis using automatic size and time inference. In: Peña, R., Arts, T. (eds.) IFL 2002. LNCS, vol. 2670, pp. 232–247. 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, pp. 65–78, Orlando, FL (June 1994)
Simoes, H.R., Hammond, K., Florido, M., Vasconcelos, P.: Using intersection types for cost-analysis of higher-order polymorphic functional programs. Technical report (2006), http://www.dcs.st-and.ac.uk/~kh/papers/itypes_cost.pdf
van Bakel, S.: Intersection Type Disciplines in Lambda Calculus and Applicative Term Rewriting Systems. PhD thesis, Department of Computer Science, University of Nijmegen (1993)
van Bakel, S.: Rank 2 intersection type assignment in term rewriting systems. Fundam. Inform. 26(2), 141–166 (1996)
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 2007 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Simões, H.R., Hammond, K., Florido, M., Vasconcelos, P. (2007). Using Intersection Types for Cost-Analysis of Higher-Order Polymorphic Functional Programs. In: Altenkirch, T., McBride, C. (eds) Types for Proofs and Programs. TYPES 2006. Lecture Notes in Computer Science, vol 4502. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-74464-1_15
Download citation
DOI: https://doi.org/10.1007/978-3-540-74464-1_15
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-74463-4
Online ISBN: 978-3-540-74464-1
eBook Packages: Computer ScienceComputer Science (R0)