A closer, automatic approach is that of positive supercompilation [Gluck and Sorensen 1994; 1996; Sorensen et al.
1993], partial evaluation of functional programs has mainly stressed the off-line approach, while supercompilation and partial deduction have concentrated on the on-line approach, which usually provides more accurate specializations.
The techniques we introduce to control termination of the NPE algorithm can be seen as an adaptation to our framework of existing techniques to control termination of partial deduction and (positive) supercompilation. At the local level, we mainly follow the approach of Sorensen and Gluck , which relies on well-quasi orderings to ensuring termination when constructing the so-called partial process trees.
Recently, after it was taken up in Sorensen and Gluck , several works have also adopted the use of (different variants) of the embedding ordering to avoid infinite computations during partial evaluation and supercompilation (e.g., see Alpuente et al.
For instance, Example 5.16 shows a typical optimization that standard PD a la Lloyd-Shepherdson fails to achieve, and an extension for approaching deforestation and supercompilation as in Gluck et al.
) adapted to a functional syntax, while others come from the literature of functional program transformations, such as positive supercompilation [Sorensen et al.
1993] has mainly stressed the former, while supercompilation of functional programs [Turchin 1986; 1988; Soensen and Gluck 1995] and partial deduction of logic programs [Bol 1993; Bruynooghe et al.
Indeed, its techniques and ideas are also relevant to the control of supercompilation and on-line partial evaluation of functional (and perhaps also imperative) languages.
(These examples can also be adapted to prove a similar point about neighborhoods in the context of supercompilation of functional programs.
It has been adapted from the work of Dershowitz  and Dershowitz and Jouannaud , where it is used in the context of term-rewriting systems, for use in supercompilation by Sorensen and Gliick .
Next, there is an interesting relation between the control techniques presented in this article and current practice in supercompilation [Gluck and Sorensen 1996; Sorensen and Gluck 1995; Turchin 1986; Turchin 1988].