Optimal Lambda Lifting in Quadratic Time

  • Authors:
  • Marco T. Morazán;Ulrik P. Schultz

  • Affiliations:
  • Seton Hall University, South Orange, USA;University of Southern Denmark, Odense, Denmark

  • Venue:
  • Implementation and Application of Functional Languages
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

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(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.