Abstract
In this paper we introduce an algorithm for detecting strictness information in typed functional programs. Our algorithm is based on a type inference system which allows to exploit the type structure of the language for the investigation of program properties. The detection of strictness information can be performed in a complete way, by reducing it to the solution of a set of constraints involving type variables. A key feature of our method is that it is compositional and there is a notion of principal type scheme. Even though the language considered in the paper is the simply typed lambda-calculus with a fixpoint constructor and arithmetic constants we can generalize our approach to polymorphic languages like Lazy ML. Although focused on strictness our method can also be applied to the investigation of other program properties, like dead code and binding time.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
H. P. Barendregt, M. Coppo, and M. Dezani-Ciancaglini. A filter lambda model and the completeness of type assignment. Journal of Symbolic Logic, 48:931–940, 1983.
P. N. Benton. Strictness Analysis of Lazy Functional Programs. PhD thesis, University of Cambridge, Pembroke College, 1992.
G. L. Burn, C. Hankin, and S. Abramsky. Strictness Analysis for Higher-Order Functions. Science of Computer Programming, 7:249–278, 1986.
M. Coppo, F. Damiani, and P. Giannini. On Strictness and Totality. Internal report. Dipartimento di Informatica, Universitá di Torino, 1996.
M. Coppo, F. Damiani, and P. Giannini. Refinement Types for Program Analysis. In SAS'96, LNCS 1145, pages 143–158. Springer, 1996.
M. Coppo and M. Dezani-Ciancaglini. An extension of basic functional theory for lambda-calculus. Notre Dame Journal of Formal Logic, 21(4):685–693, 1980.
M. Coppo and A. Ferrari. Type inference, abstract interpretation and strictness analysis. Theoretical Computer Science, 121:113–145, 1993.
D. Dussart and F. Henglein and C. Mossin. Polymorphic Recursion and Subtype Qualifications: Polymorphic Binding-Time Analysis in Polynomial Time. In SAS'95, LNCS 983, pages 118–135. Springer, 1995.
M. J. C. Gordon, R. Milner, and C. P. Wadsworth. Edinburg LCF. LNCS 78. Springer, 1979.
C. Hankin and D. Le Métayer. A Type-Based Framework for Program Analysis. In SAS'94, LNCS 864, pages 380–394. Springer, 1994.
C. Hankin and D. Le Métayer. Deriving algorithms for type inference systems: Applications to strictness analysis. In POPL'94, pages 202–212. ACM, 1994.
C. Hankin and D. Le Métayer. Lazy type inference and program analysis. Science of Computer Programming, 25:219–249, 1995.
R. Hindley. The principal types schemes for an object in combinatory logic. Transactions of American Mathematical Society, 146:29–60, 1969.
T. P. Jensen. Abstract Interpretation in Logical Form. PhD thesis, University of London, Imperial College, 1992.
G. Kahn. Natural semantics. In K. Fuchi and M. Nivat, editors, Programming Of Future Generation Computer. Elsevier Sciences B.V. (North-Holland), 1988.
T. M. Kuo and P. Mishra. Strictness analysis: a new perspective based on type inference. In Functional Programming Languages and Computer Architecture, pages 260–272. ACM, 1989.
R. Milner. A Theory of Type Polymorphism in Programming. Journal of Computer and System Science, 17:348–375, 1978.
J. Palsberg and P. O'Keefe. A Type System Equivalent to Flow Analysis. In POPL'95, pages 367–378. ACM, 1995.
A. M. Pitts. Operationally-Based Theories of Program Equivalence. Summer School on Semantics and Logics of Computation, Cambridge UK, 25–29 Sep 1995.
K. L. Solberg. Annotated Type Systems for Program Analysis. PhD thesis, Aarhus University, Denmark, 1995.
K. L. Solberg, H. R. Nielson, and F. Nielson. Strictness and Totality Analysis. In SAS'94, LNCS 864, pages 408–422. Springer, 1994.
S. van Bakel. Intersection Type Disciplines in Lambda Calculus and Applicative Term Rewriting Systems. PhD thesis, Katholieke Universiteit Nijmegen, 1993.
D. A. Wright. Reduction Types and Intensionality in the Lambda-Calculus. PhD thesis, University of Tasmania, 1992.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1997 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Damiani, F., Giannini, P. (1997). An inference algorithm for strictness. In: de Groote, P., Roger Hindley, J. (eds) Typed Lambda Calculi and Applications. TLCA 1997. Lecture Notes in Computer Science, vol 1210. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-62688-3_33
Download citation
DOI: https://doi.org/10.1007/3-540-62688-3_33
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-62688-6
Online ISBN: 978-3-540-68438-1
eBook Packages: Springer Book Archive