Optimal Lambda Lifting in Quadratic Time
- Cite this paper as:
- 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
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(n3) 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(n3) to O(n2). 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(n3). Their algorithm, however, suggested that dominator trees might be used to develop an O(n2) 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(n2) optimal lambda lifting algorithm.
Unable to display preview. Download preview PDF.