Redundant Argument Filtering of Logic Programs

This paper is concerned with the problem of removing redundant arguments from logic programs. Such arguments can be removed without affecting correctness, in a certain sense. Most program specialisation techniques, even though they filter arguments and remove clauses, fail to remove a substantial number of redundant arguments, yielding in some cases rather inefficient residual programs. We formalise the notion of a redundant argument and show that one cannot effectively remove all redundant arguments. We then give a safe, effective approximation of the notion of a redundant argument and describe several simple and efficient algorithms based on the approximative notion. We conduct extensive experiments with our algorithms on mechanically generated programs illustrating the practical benefits of our approach.

[1]  John P. Gallagher,et al.  Ensuring Global Termination of Partial Deduction while Allowing Flexible Polyvariance , 1995, ICLP.

[2]  Thomas W. Reps,et al.  Program Specialization via Program Slicing , 1996, Dagstuhl Seminar on Partial Evaluation.

[3]  Helmut Seidl Parameter Reduction of Higher Level Grammars , 1987, Theor. Comput. Sci..

[4]  Philip Wadler,et al.  Deforestation: Transforming Programs to Eliminate Trees , 1990, Theor. Comput. Sci..

[5]  Alberto Pettorossi,et al.  The Loop Absorption and the Generalization Strategies for the Development of Logic Programs and Partial Deduction , 1993, J. Log. Program..

[6]  J. Davenport Editor , 1960 .

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

[8]  Robert Glück,et al.  Controlling conjunctive partial deduction of definite logic programs , 1996 .

[9]  Robert Glück,et al.  Partial Deduction and Driving are Equivalent , 1994, PLILP.

[10]  Bart Demoen,et al.  On the Transformation of a Prolog Program to a More Efficient Binary Program , 1992, LOPSTR.

[11]  Michael Leuschel,et al.  Global Control for Partial Deduction through Characteristic Atoms and Global Trees , 1996, Dagstuhl Seminar on Partial Evaluation.

[12]  John Wylie Lloyd,et al.  Foundations of Logic Programming , 1987, Symbolic Computation.

[13]  Michael Leuschel,et al.  Conjunctive Partial Deduction in Practice , 1996, LOPSTR.

[14]  Wei-Ngan Chin,et al.  Automatic methods for program transformation , 1990 .

[15]  Alberto Pettorossi,et al.  Unfolding - Definition - Folding, in this Order, for Avaoiding Unnecessary Variables in Logic Programs , 1991, PLILP.

[16]  John P. Gallagher,et al.  Deletion of Redundant Unary Type Predicates from Logic Programs , 1992, LOPSTR.

[17]  Michael Leuschel,et al.  Ecological Partial Deduction: Preserving Characteristic Trees Without Constraints , 1995, LOPSTR.

[18]  John P. Gallagher,et al.  The Applicability of Logic Program Analysis and Transformation to Theorem Proving , 1994, CADE.

[19]  Robert Glück,et al.  Towards Unifying Partial Evaluation, Deforestation, Supercompilation, and GPC , 1994, ESOP.

[20]  John W. Lloyd,et al.  Partial Evaluation in Logic Programming , 1991, J. Log. Program..

[21]  Robert Glück,et al.  An Algorithm of Generalization in Positive Supercompilation , 1995, ILPS.

[22]  Jan Komorowski,et al.  Partial evaluation as a means for inferencing data structures in an applicative language: a theory and implementation in the case of prolog , 1982, POPL '82.

[23]  Mireille Ducassé,et al.  Hybrid Backward Slicing Algorithm Producing Executable Slices for Prolog , 1995, LPE.

[24]  Bern Martens On the semantics of meta-programming and the control of partial deduction in logic programming , 1994 .

[25]  David Andre De Waal,et al.  Analysis and transformation of proof procedures , 1994 .

[26]  Patricia M. Hill,et al.  Supporting Transformations for the Partial Evaluation of Logic Programs , 1993, J. Log. Comput..

[27]  Alberto Pettorossi,et al.  Transformation of Logic Programs: Foundations and Techniques , 1994, J. Log. Program..

[28]  J. W. Lloyd Logic Programming, Proceedings of the 1995 International Symposium, Portland, Oregon, USA, December 4-7, 1995 , 1995, ILPS.

[29]  Frank Tip,et al.  A survey of program slicing techniques , 1994, J. Program. Lang..

[30]  Michael Maher A Conceptual Embedding of Folding into Partial Deduction: Towards a Maximal Integration , 1996 .

[31]  John P. Gallagher,et al.  Tutorial on specialisation of logic programs , 1993, PEPM '93.