Removing redundant arguments automatically

The application of automatic transformation processes during the formal development and optimization of programs can introduce encumbrances in the generated code that programmers usually (or presumably) do not write. An example is the introduction of redundant arguments in the functions defined in the program. Redundancy of a parameter means that replacing it by any expression does not change the result. In this work, we provide methods for the analysis and elimination of redundant arguments in term rewriting systems as a model for the programs that can be written in more sophisticated languages. On the basis of the uselessness of redundant arguments, we also propose an erasure procedure which may avoid wasteful computations while still preserving the semantics (under ascertained conditions). A prototype implementation of these methods has been undertaken, which demonstrates the practicality of our approach.

[1]  Paliath Narendran,et al.  On sufficient-completeness and related properties of term rewriting systems , 1987, Acta Informatica.

[2]  Ashish Tiwari,et al.  Deciding Fundamental Properties of Right-(Ground or Variable) Rewrite Systems by Rewrite Closure , 2004, IJCAR.

[3]  Valérie Gouranton Deriving Analysers by Folding/Unfolding of Natural Semantics and a Case Study: Slicing , 1998, SAS.

[4]  José Meseguer,et al.  A Sufficient Completeness Reasoning Tool for Partial Specifications , 2005, RTA.

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

[6]  Salvador Lucas,et al.  Context-sensitive Computations in Functional and Functional Logic Programs , 1998, J. Funct. Log. Program..

[7]  Jürgen Giesl,et al.  Automated Termination Proofs with AProVE , 2004, RTA.

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

[9]  Rakesh M. Verma Algorithms and reductions for rewriting problems II , 2002, Inf. Process. Lett..

[10]  Alberto Pettorossi,et al.  Rules and strategies for transforming functional and logic programs , 1996, CSUR.

[11]  Naoki Kobayashi Type-based useless variable elimination , 1999, PEPM '00.

[12]  Aart Middeldorp,et al.  Decidable call-by-need computations in term rewriting , 2005, Inf. Comput..

[13]  Alan Mycroft,et al.  Optimising Compilation , 1992 .

[14]  M. Hanus,et al.  Curry: An Integrated Functional Logic Language , 2003 .

[15]  Harald Ganzinger,et al.  Programs as Data Objects , 1986, Lecture Notes in Computer Science.

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

[17]  Michio Oyamaguchi The reachability and joinability problems for right-ground term-rewriting systems , 1991 .

[18]  Bart Demoen,et al.  Heap Memory Management in Prolog with Tabling: Principles and Practice , 2001, J. Funct. Log. Program..

[19]  J. Van Leeuwen,et al.  Handbook of theoretical computer science - Part A: Algorithms and complexity; Part B: Formal models and semantics , 1990 .

[20]  I. V. Ramakrishnan,et al.  Small domains spell fast strictness analysis , 1989, POPL '90.

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

[22]  Michael Leuschel,et al.  Partial Deduction of the Ground Representation and its Application to Integrity Checking , 1995, ILPS.

[23]  David W. Binkley,et al.  Program slicing , 2008, 2008 Frontiers of Software Maintenance.

[24]  Sophie Tison,et al.  Decidability of the Confluence of Ground Term Rewriting Systems , 1985, LICS.

[25]  Enno Ohlebusch,et al.  Term Rewriting Systems , 2002 .

[26]  Hubert Comon Sequentiality, monadic second-order logic and tree automata , 2000 .

[27]  Salvador Lucas,et al.  An Evaluation Semantics for Narrowing-Based Functional Logic Languages , 2001, J. Funct. Log. Program..

[28]  María Alpuente,et al.  Partial evaluation of functional logic programs , 1998, TOPL.

[29]  Michael Hanus,et al.  The Integration of Functions into Logic Programming: From Theory to Practice , 1994, J. Log. Program..

[30]  Salvador Lucas,et al.  Redundancy of Arguments Reduced to Induction , 2002, WFLP.

[31]  Jean H. Gallier,et al.  Reductions in Tree Replacement Systems , 1985, Theor. Comput. Sci..

[32]  Chang Liu,et al.  Term rewriting and all that , 2000, SOEN.

[33]  Thomas P. Jensen,et al.  Strictness Analysis in Logical Form , 1991, FPCA.

[34]  Jürgen Giesl,et al.  Termination of term rewriting using dependency pairs , 2000, Theor. Comput. Sci..

[35]  J. Kuper Partiality in Logic and Computation - Aspects of Undefinedness , 1994 .

[36]  Dieter Hofbauer An upper bound on the derivational complexity of Knuth-Bendix orderings , 2003, Inf. Comput..

[37]  Yanhong A. Liu,et al.  Eliminating dead code on recursive data , 1999, Sci. Comput. Program..

[38]  Salvador Lucas Transfinite Rewriting Semantics for Term Rewriting Systems , 2001, RTA.

[39]  Salvador Lucas,et al.  Removing Redundant Arguments of Functions , 2002, AMAST.

[40]  Yoshikatsu Ohta,et al.  The Joinability and Unification Problems for Confluent Semi-constructor TRSs , 2004, RTA.

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

[42]  Claude Marché,et al.  Proving Termination of Rewriting with C i ME , 2003 .

[43]  Alan Mycroft,et al.  The Theory and Practice of Transforming Call-by-need into Call-by-value , 1980, Symposium on Programming.

[44]  Wolfgang Thomas,et al.  Automata on Infinite Objects , 1991, Handbook of Theoretical Computer Science, Volume B: Formal Models and Sematics.

[45]  Aart Middeldorp,et al.  Decidable Call by Need Computations in term Rewriting (Extended Abstract) , 1997, CADE.

[46]  Benjamin Goldberg,et al.  Escape analysis on lists , 1992, PLDI '92.

[47]  María Alpuente,et al.  Specialization of lazy functional logic programs , 1997, PEPM.

[48]  Michael Leuschel,et al.  Redundant Argument Filtering of Logic Programs , 1996, LOPSTR.

[49]  Michael Leuschel,et al.  On the Power of Homeomorphic Embedding for Online Termination , 1998, SAS.

[50]  Vincent van Oostrom,et al.  Meaningless Terms in Rewriting , 1996, J. Funct. Log. Program..

[51]  Philip Wadler,et al.  Projections for strictness analysis , 1987, FPCA.

[52]  Tibor Gyimóthy,et al.  Static and Dynamic Slicing of Constraint Logic Programs , 2004, Automated Software Engineering.

[53]  Chris Hankin,et al.  The theory of strictness analysis for higher order functions , 1985, Programs as Data Objects.

[54]  B. Robinet International Symposium on Programming , 1980, Lecture Notes in Computer Science.

[55]  Bernhard Steffen,et al.  Partial dead code elimination , 1994, PLDI '94.

[56]  Geoffrey L. Burn,et al.  Lazy functional languages - abstract interpretation and compilation , 1991, Research monographs in parallel and distributed computing.

[57]  Michaël Rusinowitch,et al.  Algorithms and Reductions for Rewriting Problems , 1998, Fundam. Informaticae.

[58]  Michael Hanus,et al.  Curry: an integrated functional logic language (version 0 , 2003 .

[59]  Simon L. Peyton Jones,et al.  Imperative functional programming , 1993, POPL '93.

[60]  James W. Thatcher,et al.  Generalized finite automata theory with an application to a decision problem of second-order logic , 1968, Mathematical systems theory.

[61]  Emmanuel Kounalis,et al.  Completeness in Data Type Specifications , 1985, European Conference on Computer Algebra.

[62]  María Alpuente,et al.  Narrowing-Driven Partial Evaluation of Functional Logic Programs , 1996, ESOP.

[63]  Sophie Tison,et al.  Decidability of the Confluence of Finite Ground Term Rewrite Systems and of Other Related Term Rewrite Systems , 1990, Inf. Comput..

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

[65]  Marko C. J. D. van Eekelen,et al.  Functional Programming and Parallel Graph Rewriting , 1993 .

[66]  Radhia Cousot,et al.  Higher-order abstract interpretation (and application to comportment analysis generalizing strictness, termination, projection and PER analysis of functional languages) , 1994, Proceedings of 1994 IEEE International Conference on Computer Languages (ICCL'94).

[67]  Paola Giannini,et al.  Type-Based Useless-Code Elimination for Functional Programs , 2000, SAIG.

[68]  Hubert Comon,et al.  Sequentiality, second order monadic logic and tree automata , 1995, Proceedings of Tenth Annual IEEE Symposium on Logic in Computer Science.

[69]  Harald Ganzinger Rewriting techniques and applications : 7th International Conference, RTA-96, New Brunswick, NJ, USA, July 27-30, 1996 : proceedings , 1996 .

[70]  Florent Jacquemard,et al.  Decidable Approximations of Term Rewriting Systems , 1996, RTA.

[71]  Salvador Lucas Context-sensitive rewriting strategies , 2002 .

[72]  Bernhard Gramlich On interreduction of semi-complete term rewriting systems , 2001, Theor. Comput. Sci..

[73]  Peter Padawitz,et al.  Computing in Horn Clause Theories , 1988, EATCS Monographs on Theoretical Computer Science.

[74]  Mitchell Wand,et al.  Constraint systems for useless variable elimination , 1999, POPL '99.

[75]  M. Rabin Decidability of second-order theories and automata on infinite trees , 1968 .

[76]  Daniel J. Rosenkrantz,et al.  Sufficient-completeness, ground-reducibility and their complexity , 1991, Acta Informatica.

[77]  Alberto Pettorossi,et al.  A Comparative Revisitation of Some Program Transformation Techniques , 1996, Dagstuhl Seminar on Partial Evaluation.

[78]  Salvador Lucas,et al.  Specialization of inductively sequential functional logic programs , 1999, ICFP '99.

[79]  Daniel Le Métayer,et al.  Computer-Time Garbage Collection by Sharing Analysis , 1989, FPCA.

[80]  Mireille Ducassé,et al.  A Backward Slicing Algorithm for Prolog , 1996, SAS.

[81]  M. Oyamaguchi,et al.  The reachability problem for quasi-ground term rewriting systems , 1986 .