Partial evaluation
Overview
In the field of program transformation, partial evaluation is the technique of specializing a general program P, accepting two parameters of type S and D, with regards to a specific input s Î S.
The transformation function T, called the partial evaluator, takes as parameters the program and the partial input, and produces a specialized program (also called a residual program) Ps such that:
T(P,s) = Ps
Ps(d) = P(s,d)
The advantage of specializing a program is a general increase in efficiency in terms of resources. An interesting example of specialization is when P is an interpreter, and s is a program, designed to be interpreted by P. Partial evaluation will yield an interpreter, designed to run only one piece of code, namely s. The result is in effect, a compiled version of s. This is also called the first Futamura projection, named after Yoshihiko Futamura, who first described it.
Concepts in partial evaluation
References
Contributor: Frederik Hannibal
Last modification: 30/1 2006