Skip to main content

Removing Redundant Arguments of Functions*

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((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.

Work partially supported by CICYT TIC2001-2705-C03-01, Acciones Integradas HI2000-0161, HA2001-0059, HU2001-0019, and Generalitat Valenciana GV01-424.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  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. M. Alpuente, S. Escobar, S. Lucas. Removing Redundants Arguments of Functions. Technical report DSIC-II/8/02, UPV, 2002.

    Google Scholar 

  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. M. Alpuente, M. Falaschi, and G. Vidal. Partial Evaluation of Functional Logic Programs. ACM TOPLAS, 20(4):768–844, 1998.

    Article  Google Scholar 

  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. A. V. Aho, R. Sethi, and J. D. Ullman. Compilers, Principles Techniques and Tools. Addison-Wesley, 1986.

    Google Scholar 

  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. F. Baader and T. Nipkow. Term Rewriting and All That. Cambridge University Press, 1998.

    Google Scholar 

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

    Article  MATH  MathSciNet  Google Scholar 

  11. J. Gallagher. Tutorial on Specialisation of Logic Programs. In Proc. of PEPM’93, pages 88–98. ACM, New York, 1993.

    Google Scholar 

  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. B. Gramlich. On Interreduction of Semi-Complete Term Rewriting Systems. Theoretical Computer Science, 258(1–2):435–451, 2001.

    Article  MATH  MathSciNet  Google Scholar 

  14. M. Hanus. Curry: An Integrated Functional Logic Language. Available at http://www.informatik.uni-kiel.de/~curry, 2001.

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

    MathSciNet  Google Scholar 

  18. D. Kapur, P. Narendran, and Z. Zhang. On sufficient-completeness and related properties of term rewriting systems. Acta Informatica 24:395–416, 1987.

    Article  MATH  MathSciNet  Google Scholar 

  19. N. Kobayashi. Type-based useless variable elimination. In roc. of PEPM-00, pages 84–93, ACM Press, 2000.

    Google Scholar 

  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. 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. J. Kuper. Partiality in Logic and Computation. Aspects of Undefinedness. PhD Thesis, Universiteit Twente, February 1994.

    Google Scholar 

  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. 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. 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. 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. 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. S. Lucas. Transfinite Rewriting Semantics for Term Rewriting Systems Proc. of RTA’01, LNCS 2051:216–230. Springer-Verlag, Berlin, 2001.

    Google Scholar 

  29. M. Oyamaguchi. The reachability and joinability problems for right-ground term rewriting systems. Journal of Information Processing, 13(3), pp. 347–354, 1990.

    MathSciNet  Google Scholar 

  30. P. Padawitz. Computing in Horn Clause Theories. EATCS Monographs on Theoretical Computer Science, vol. 16. Springer-Verlag, Berlin, 1988.

    Google Scholar 

  31. A. Pettorossi and M. Proietti. Transformation of logic programs: Foundations and techniques. J. Logic Program. 19,20, 261–320.

    Google Scholar 

  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. 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. R. Plasmeijer and M. van Eekelen. Functional Programming and Parallel Graph Rewriting. Addison Wesley, 1993.

    Google Scholar 

  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. M. Wand and I. Siveroni. Constraint systems for useless variable elimination. In Proc. of POPL’99, pages 291–302, ACM Press, 1999.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2002 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Alpuente, M., Escobar, S., Lucas, S. (2002). Removing Redundant Arguments of Functions* . In: Kirchner, H., Ringeissen, C. (eds) Algebraic Methodology and Software Technology. AMAST 2002. Lecture Notes in Computer Science, vol 2422. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45719-4_9

Download citation

  • DOI: https://doi.org/10.1007/3-540-45719-4_9

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-44144-1

  • Online ISBN: 978-3-540-45719-0

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics