Partial Evaluation is Fuller Laziness

Abstract

Partial evaluation of a program p with respect to partial input data s produces a residual program r. If the program r is subsequently run a number of times on values rl~, there is a potentiti overall gain in efficiency since the static computations are performed only once, namely when the residual program r-is generated. In a fully lazy language, a partial function application which is subsequently applied several times yields much of the same sharing. In a lazy lauguage the result of a partial application may be thought of as a " residual graph ". This " residual graph " is not as efficient as a residual program produced by traditional partial evalu-ators, but simple program transformations can improve the sharing properties of a lazy functional program p to match those obtained by partial evaluation. Since we work in a lazy language and do not generate a residual program we avoid the termination problems suffered by all partial evaluators so far. These results also pave the way for a new class of optimizations of lazy functional programs: namely the binding time transformations employed by users and writers of partial evaluators so far. 1 introduction Suppose p is a program taking two input data s and d to produce an answer. A partial evaluator is a program transformer that given p and s generates a residual program r. Calling the partial evaluator mix, we have r=mixps where the residual program fulfills rd=psd Traditionally the first input s is called ter, dynamic. Similarly, computations static and d, the lat-in p depending only on s are called static and the remaining dynamic.

DOI: 10.1145/115865.115890

Extracted Key Phrases

Unfortunately, ACM prohibits us from displaying non-influential references for this paper.

To see the full reference list, please visit http://dl.acm.org/citation.cfm?id=115890.