Avoiding Redundant Specialization during Partial Evaluation

Existing partial evaluators use a strategy called polyvariant specialization, which involves specializing program points on the known portions of their arguments, and re-using such specializations only when these known portions match exactly. We show that this re-use criterion is overly restrictive, and misses opportunities for sharing in residual programs, thus producing large residual programs containing redundant specializations. We develop a criterion for re-use based on computing the domains of specializations, describe an approximate implementation of this criterion based on types, and show its implementation in our partial evaluation system FUSE. In addition, we describe several extensions to our mechanism to make it compatible with more powerful specialization strategies and to increase its efficiency. After evaluating our algorithm''s usefulness, we relate it to existing work in partial evaluation and machine learning.

[1]  Anders Haraldsson A program manipulation system based on partial evaluation , 1977 .

[2]  John Darlington,et al.  A Transformation System for Developing Recursive Programs , 1977, J. ACM.

[3]  Kenneth M. Kahn,et al.  A Partial Evaluator of Lisp Programs Written in Prolog , 1982, ICLP.

[4]  R. Schooler,et al.  PARTIAL EVALUATION AS A MEANS OF LANGUAGE EXTENSIBILITY , 1984 .

[5]  Carlo Ghezzi,et al.  Program Simplification via Symbolic Interpretation , 1985, FSTTCS.

[6]  Peter Sestoft,et al.  An experiment in partial evaluation: the generation of a compiler generator , 1985, SIGP.

[7]  Peter Sestoft,et al.  The structure of a self-applicable partial evaluator , 1985, Programs as Data Objects.

[8]  William D. Clinger,et al.  Revised3 report on the algorithmic language scheme , 1986, SIGP.

[9]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

[10]  Alan Bundy,et al.  Explanation-Based Generalisation = Partial Evaluation , 1988, Artif. Intell..

[11]  Charles Consel,et al.  New Insights into Partial Evaluation: the SCHISM Experiment , 1988, ESOP.

[12]  Karel De Vlaminck,et al.  Partial evaluation: its application to compiler generator generation , 1989 .

[13]  Charles Consel Analyse de programmes, evaluation partielle et generation de compilateurs , 1989 .

[14]  Williams Ludwell Harrison,et al.  The interprocedural analysis and automatic parallelization of Scheme programs , 1990, LISP Symb. Comput..

[15]  V. Rich Personal communication , 1989, Nature.

[16]  Andrew Berlin A Compilation Strategy for Numerical Programs Based on Partial Evaluation , 1989 .

[17]  Erik Ruf,et al.  Computing Types During Program Specialization , 1990 .

[18]  John Hughes,et al.  Towards Binding-Time Improvement for Free , 1990, Functional Programming.

[19]  Daniel W. Weise Graphs as an Intermediate Representation for Partial Evaluation , 1990 .

[20]  Charles Consel,et al.  Binding time analysis for high order untyped functional languages , 1990, LISP and Functional Programming.

[21]  Alexander Aiken,et al.  Static type inference in a dynamically typed language , 1991, POPL '91.

[22]  Neil D. Jones,et al.  Compiler Generation by Partial Evaluation: A Case Study , 1991, Struct. Program..

[23]  Anders Bondorf,et al.  Automatic Autoprojection of Higher Order Recursive Equations , 1990, Sci. Comput. Program..

[24]  Olivier Danvy,et al.  Static and dynamic semantics processing , 1991, POPL '91.

[25]  Anders Bondorf,et al.  Automatic Autoprojection of Recursive Equations with Global Variables and Abstract Data Types , 1991, Sci. Comput. Program..

[26]  Erik Ruf,et al.  Automatic Online Partial Evaluation , 1991, FPCA.

[27]  Neil D. Jones,et al.  A partial evaluator for the untyped lambda-calculus , 1991, Journal of Functional Programming.

[28]  Erik Ruf,et al.  Using Types to Avoid Redundant Specialization , 1991, PEPM.

[29]  Olin Shivers,et al.  Control-flow analysis of higher-order languages of taming lambda , 1991 .

[30]  Olivier Danvy,et al.  For a Better Support of Static Data Flow , 1991, FPCA.

[31]  Erik Ruf,et al.  Preserving Information during Online Partial Evaluation , 1992 .

[32]  Erik Ruf,et al.  Improving the Accuracy of Higher-Order Specialization using Control Flow Analysis , 1992, PEPM.

[33]  Daniel Weise,et al.  Towards a New Perspective on Partial Evaluation , 1992, PEPM.

[34]  Erik Ruf,et al.  Opportunities for Online Partial Evaluation , 1992 .

[35]  Ken Kennedy,et al.  Procedure cloning , 1992, Proceedings of the 1992 International Conference on Computer Languages.

[36]  Siau-Cheng Khoo,et al.  Parameterized partial evaluation , 1993, TOPL.