The book Partial Evaluation and Automatic Program Generation
gives a comprehensive presentation of partial evaluation: theory,
techniques, and applications. It is suitable for self-study, and for
graduate courses and advanced undergraduate courses on program
transformation techniques. See the preface
and the table of contents.
Let p be a program which takes two inputs d1 and d2. Ordinarily, the application of p to (d1,d2) would be evaluated in one step:
Evaluate p with input (d1, d2), to produce the result res.
However, alternatively it may be evaluated in two steps:
(1) Partially evaluate p with input d1, to produce a new program r.
(2) Evaluate r with input d2, to produce the result res.
The program r is a specialized version of p (for the particular value
d1 of the first input), and is called a residual program. The
process of producing r (in step 1) is called partial
evaluation, or program specialization. The benefit of
partial evaluation is speed of execution: the specialized program r is
often much faster than the general program p.
Getting a paper copy may be harder; the book is out of print. You may find it second-hand somewhere, or else you may contact Peter Sestoft to see if we have any copies left.