Advertisement

Removing Redundant Arguments of Functions*

  • María Alpuente
  • Santiago Escobar
  • Salvador Lucas
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2422)

Abstract

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 a method 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.

Keywords

Normal Form Logic Program Function Symbol Partial Evaluation Constructor System 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    M. Alpuente, R. Echahed, S. Escobar, S. Lucas. Redundancy of Arguments Reduced to Induction. In Proc. of WFLP’02, ENTCS, to appear, 2002.Google Scholar
  2. 2.
    M. Alpuente, S. Escobar, S. Lucas. Removing Redundants Arguments of Functions. Technical report DSIC-II/8/02, UPV, 2002.Google Scholar
  3. 3.
    M. Alpuente, M. Falaschi, P. Julián, and G. Vidal. Specialization of Lazy Functional Logic Programs. In Proc. of PEPM’97, ACM Sigplan Notices, volume 32(12):151–162. ACM Press, New York, 1997.Google Scholar
  4. 4.
    M. Alpuente, M. Falaschi, and G. Vidal. Partial Evaluation of Functional Logic Programs. ACM TOPLAS, 20(4):768–844, 1998.CrossRefGoogle Scholar
  5. 5.
    M. Alpuente, M. Hanus, S. Lucas, and G. Vidal. Specialization of Inductively Sequential Functional Logic Programs. In Proc. of ICFP’99, ACM Sigplan Notices, 34(9):273–283, ACM Press, New York, 1999.Google Scholar
  6. 6.
    A. V. Aho, R. Sethi, and J. D. Ullman. Compilers, Principles Techniques and Tools. Addison-Wesley, 1986.Google Scholar
  7. 7.
    S. Berardi, M. Coppo, F. Damiani and P. Giannini. Type-Based Useless-Code Elimination for Functional Programs. In Walid Taha, editor, Proc. of SAIG 2000, LNCS 1924:172–189, Springer-Verlang, 2000.Google Scholar
  8. 8.
    F. Baader and T. Nipkow. Term Rewriting and All That. Cambridge University Press, 1998.Google Scholar
  9. 9.
    P. Cousot and R. Cousot. Higher-order abstract interpretation (and application to comportment analysis generalizing strictness, termination, projection and PER analysis of functional languages), invited paper. In Proc. of ICCL’94, pages 95–112. IEEE Computer Society Press, Los Alamitos, California, 1994.Google Scholar
  10. 10.
    M. Dauchet, T. Heuillard, P. Lescanne, and S. Tison. Decidability of the Confluence of Finite Ground Term Rewrite Systems and of Other Related Term Rewriting Systems. Information and Computation, 88:187–201, 1990.zbMATHCrossRefMathSciNetGoogle Scholar
  11. 11.
    J. Gallagher. Tutorial on Specialisation of Logic Programs. In Proc. of PEPM’93, pages 88–98. ACM, New York, 1993.Google Scholar
  12. 12.
    R. Glück and M. Sørensen. Partial deduction and driving are equivalent. In Proc. of PLILP’94, LNCS 844:165–181. Springer-Verlag, Berlin, 1994.Google Scholar
  13. 13.
    B. Gramlich. On Interreduction of Semi-Complete Term Rewriting Systems. Theoretical Computer Science, 258(1–2):435–451, 2001.zbMATHCrossRefMathSciNetGoogle Scholar
  14. 14.
    M. Hanus. Curry: An Integrated Functional Logic Language. Available at http://www.informatik.uni-kiel.de/~curry, 2001.
  15. 15.
    G. Huet and J. J. Lévy. Computations in orthogonal term rewriting systems. In J. L. Lassez and G. Plotkin, editors, Computational logic: essays in honour of J. Alan Robinson, pages 395–414 and 415–443. The MIT Press, Cambridge, MA, 1991.Google Scholar
  16. 16.
    J. Hughes. Backwards Analysis of Functional Programs. In D. Bjørner, A. P. Ershov, and N. D. Jones, editors, IFIP Workshop on Partial Evaluation and Mixed Computation, pages 187–208, 1988.Google Scholar
  17. 17.
    J. W. Klop. Term RewritingSys tems. In S. Abramsky, D. M. Gabbay and T. S. E. Maibaum. Handbook of Logic in Computer Science, volume 3, pages 1–116. Oxford University Press, 1992.MathSciNetGoogle Scholar
  18. 18.
    D. Kapur, P. Narendran, and Z. Zhang. On sufficient-completeness and related properties of term rewriting systems. Acta Informatica 24:395–416, 1987.zbMATHCrossRefMathSciNetGoogle Scholar
  19. 19.
    N. Kobayashi. Type-based useless variable elimination. In roc. of PEPM-00, pages 84–93, ACM Press, 2000.Google Scholar
  20. 20.
    E. Kounalis. Completeness in data type specifications. In B. F. Caviness, editor, Proc. of EUROCAL’85, LNCS 204:348–362. Springer-Verlag, Berlin, 1985.Google Scholar
  21. 21.
    R. Kennaway, V. van Oostrom, F. J. de Vries. Meaningless Terms in Rewriting. In Michael Hanus and Mario Rodríguez-Artalejo, editors, Proc. of ALP’96, LNCS 1139:254–268. Springer-Verlag, Berlin, 1996.Google Scholar
  22. 22.
    J. Kuper. Partiality in Logic and Computation. Aspects of Undefinedness. PhD Thesis, Universiteit Twente, February 1994.Google Scholar
  23. 23.
    M. Leuschel and B. Martens. Partial Deduction of the Ground Representation and Its Application to Integrity Checking. Tech. Rep. CW 210, K. U. Leuven, 1995.Google Scholar
  24. 24.
    M. Leuschel. The ECCE partial deduction system and the DPPD library of benchmarks. Tech. Rep., Accessible via http://www.ecs.soton.ac.uk/~mal/.
  25. 25.
    M. Leuschel and M. H. Sørensen. Redundant Argument Filtering of Logic Programs. In Proc of LOPSTR’96, LNCS 1207:83–103. Springer-Verlag, Berlin, 1996.Google Scholar
  26. 26.
    Y. A. Liu and S. D. Stoller. Eliminating dead code on recursive data. Science of Computer Programming, 2002. To appear. Preliminary version in Proc. of SAS’99, LNCS 1694:211–231. Springer-Verlag, Berlin, 1999.Google Scholar
  27. 27.
    S. Lucas. Context-sensitive computations in functional and functional logic programs. Journal of Functional and Logic Programming, 1998(1):1–61, January 1998.Google Scholar
  28. 28.
    S. Lucas. Transfinite Rewriting Semantics for Term Rewriting Systems Proc. of RTA’01, LNCS 2051:216–230. Springer-Verlag, Berlin, 2001.Google Scholar
  29. 29.
    M. Oyamaguchi. The reachability and joinability problems for right-ground term rewriting systems. Journal of Information Processing, 13(3), pp. 347–354, 1990.MathSciNetGoogle Scholar
  30. 30.
    P. Padawitz. Computing in Horn Clause Theories. EATCS Monographs on Theoretical Computer Science, vol. 16. Springer-Verlag, Berlin, 1988.Google Scholar
  31. 31.
    A. Pettorossi and M. Proietti. Transformation of logic programs: Foundations and techniques. J. Logic Program. 19,20, 261–320.Google Scholar
  32. 32.
    A. Pettorossi and M. Proietti. A comparative revisitation of some program transformation techniques. In Proc. of the 1996 Dagstuhl Seminar on Partial Evaluation, LNCS 1110: 355–385. Springer-Verlag, Berlin, 1996.Google Scholar
  33. 33.
    A. Pettorossi and M. Proietti. A Theory of Logic Program Specialization and Generalization for Dealing with Input Data Properties. In Proc. of the 1996 Dagstuhl Seminar on Partial Evaluation, LNCS 1110: 386–408. Springer-Verlag, Berlin, 1996.Google Scholar
  34. 34.
    R. Plasmeijer and M. van Eekelen. Functional Programming and Parallel Graph Rewriting. Addison Wesley, 1993.Google Scholar
  35. 35.
    M. Schütz, M. Schmidt-Schauss and S. E. Panitz. Strictness analysis by abstract reduction usinga tableau calculus. In A. Mycroft, editor, Proc. of SAS’95, LNCS 983:348–365. Springer-Verlag, 1995.Google Scholar
  36. 36.
    M. Wand and I. Siveroni. Constraint systems for useless variable elimination. In Proc. of POPL’99, pages 291–302, ACM Press, 1999.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2002

Authors and Affiliations

  • María Alpuente
    • 1
  • Santiago Escobar
    • 1
  • Salvador Lucas
    • 1
  1. 1.DSICUPVValenciaSpain

Personalised recommendations