Partial evaluation of programs
Christopher John Hogger · 1990
Abstract In general, a program caters for a multitude of cases; we know that the execution of a most-general query to a relation will extract from the program all the possible cases covered by that relation. Sometimes, however, we are interested only in particular queries-or in particular classes of query-which make more specialized uses of the program. Under this assumption it is generally more efficient to specialize the program itself before executing the queries, so that it will not waste time considering cases that can no longer arise. The standard technique for specializing a program in this way is partial evaluation. As an example, consider this simple program for testing whether a list L is (strictly) ordered:3