Abstract
The process of lambda lifting flattens a program by lifting all local function definitions to the global level. Optimal lambda lifting computes the minimal set of extraneous parameters needed by each function as is done by the O(n 3) equation-based algorithm proposed by Johnsson. In contrast, modern lambda lifting algorithms have used a graph-based approach to compute the set of extraneous parameters needed by each function. Danvy and Schultz proposed an algorithm that reduced the complexity of lambda lifting from O(n 3) to O(n 2). Their algorithm, however, is an approximation of optimal lambda lifting. Morazán and Mucha proposed an optimal graph-based algorithm at the expense of raising the complexity to O(n 3). Their algorithm, however, suggested that dominator trees might be used to develop an O(n 2) algorithm. This article explores the relationship between the call graph of a program, its dominator tree, and lambda lifting by developing algorithms for successively richer sets of programs. The result of this exploration is an O(n 2) optimal lambda lifting algorithm.
Access provided by Autonomous University of Puebla. Download to read the full chapter text
Chapter PDF
Similar content being viewed by others
Keywords
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
Consel, C.: A Tour of Schism: A Partial Evaluation System for Higher-Order Applicative Languages. In: Proc. of the Symp. on Partial Evaluation and Semantics-Based Program Manipulation, June 1993, pp. 145–154. ACM Press, New York (1993)
Danvy, O., Schultz, U.P.: Lambda-Dropping: Transforming Recursive Equations into Programs with Block Structure. Theoretical Computer Science 248(1–2), 243–287 (2000)
Danvy, O., Schultz, U.P.: Lambda-Lifting in Quadratic Time. Journal of Functional and Logic Programming 2004(1) (July 2004)
Friedman, D.P., Wand, M., Haynes, C.T.: Essentials of Programming Languages. The MIT Press, Cambridge (2001)
Gibbons, A.: Algorithmic Graph Theory. Cambridge University Press, Cambridge (1985)
Gould, R.: Graph Theory. The Benjamin/Cummings Publishing Company, Inc. (1988)
Matthews, J., Findler, R., Graunke, P., Krishnamurthi, S., Felleisen, M.: Automatically Restructuring Programs for the Web. Automated Software Engineering 11(4), 337–364 (2004)
Johnsson, T.: Lambda Lifting: Transforming Programs to Recursive Equations. In: Proc. of a Conf. on Functional Prog. Lang. and Comp. Arch., pp. 190–203. Springer, New York (1985)
Johnsson, T.: Target Code Generation from G-Machine Code. In: Fasel, J.H., Keller, R.M. (eds.) Graph Reduction: Proceedings of a Workshop at Santa Fé, New Mexico, New York, NY, pp. 119–159. Springer, Heidelberg (1987)
Jones, S.L.P.: The Implementation of Functional Programming Languages. Prentice-Hall International Series in Computer Science. Prentice-Hall, Upper Saddle River (1987)
Jones, S.L.P., Lester, D.: A Modular Fully-lazy Lambda Lifter in HASKELL. Software - Practice and Experience 21(5), 479–506 (1991)
Jones, S.L.P., Lester, D.: Implementing Functional Languages: A Tutorial. Prentice Hall International Series in Computer Science (1992)
Morazán, M.T.: Towards Closureless Functional Languages. In: Arabnia, H. (ed.) Proc. of the Int. Conf. on Prog. Lang. and Compilers, pp. 57–63. CSREA Press (2005)
Morazán, M.T., Mucha, B.: Improved Graph-Based Lambda Lifting. In: Arabnia, H. (ed.) Proc. of the Int. Conf. on Prog. Lang. and Compilers, June 2006, pp. 896–902. CSREA Press (2006)
Oliva, D.P., Ramsdell, J.D., Wand, M.: The VLISP Verified PreScheme Compiler. Lisp and Symbolic Computation 8(1-2), 111–182 (1995)
Alstrup, S., Harel, D., Lauridsen, P.W., Thorup, M.: Dominators in Linear Time. SIAM Journal on Computing 28(6), 2117–2132 (1999)
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 2008 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Morazán, M.T., Schultz, U.P. (2008). Optimal Lambda Lifting in Quadratic Time. In: Chitil, O., Horváth, Z., Zsók, V. (eds) Implementation and Application of Functional Languages. IFL 2007. Lecture Notes in Computer Science, vol 5083. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-85373-2_3
Download citation
DOI: https://doi.org/10.1007/978-3-540-85373-2_3
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-85372-5
Online ISBN: 978-3-540-85373-2
eBook Packages: Computer ScienceComputer Science (R0)