skip to main content
article
Free Access

Tupling calculation eliminates multiple data traversals

Authors Info & Claims
Published:01 August 1997Publication History
Skip Abstract Section

Abstract

Tupling is a well-known transformation tactic to obtain new efficient recursive functions by grouping some recursive functions into a tuple. It may be applied to eliminate multiple traversals over the common data structure. The major difficulty in tupling transformation is to find what functions are to be tupled and how to transform the tupled function into an efficient one. Previous approaches to tupling transformation are essentially based on fold/unfold transformation. Though general, they suffer from the high cost of keeping track of function calls to avoid infinite unfolding, which prevents them from being used in a compiler.To remedy this situation, we propose a new method to expose recursive structures in recursive definitions and show how this structural information can be explored for calculating out efficient programs by means of tupling. Our new tupling calculation algorithm can eliminate most of multiple data traversals and is easy to be implemented.

References

  1. BD77 R.M. Burstall and J. Darlington. A transformation system for developing recursive programs. Journal of the ACM, 24(1):44-67, January 1977. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Bir80 R. Bird. Tabulation techniques for recursive programs. ACM Computing Surveys, 12(4):403-417, 1980. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Bir84 R. Bird. Using circular programs to eliminate multiple traversals of data. Acta Informatica, 21:239- 250, 1984.Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. CH95 W. Chin and M. Hagiya. A transformation method for dynamic-sized tabulation. A cta Inforrnatica, 32:93-115, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Chi93 W. Chin. Towards an automated tupling strategy. In Proc. Conference on Partial Evaluation and Program Manipulation, pages 119-132, Copenhagen, June 1993. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Chi95 W. Chin. Fusion and tupling transformations: Synergies and confiits. In Proc. Fuji International Workshop on Functional and Logic Programming, pages 106-125, Susono, Japan, July 1995. World Scientific.Google ScholarGoogle Scholar
  7. Coh83 N.H. Cohen. Eliminating redundant recursive calls. A CM 7~ansaction on Programming Languages and Systems, 5(3):265-299, July 1983. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Fok89 M. Fokkinga. Tupling and mutumorphisms. Squiggolist, 1(4), 1989.Google ScholarGoogle Scholar
  9. Fok92 M. Fokkinga. Law and Order in Algorithmics. Ph.D thesis, Dept. INF, University of Twente, The Netherlands, 1992.Google ScholarGoogle Scholar
  10. GLJ93 A. Gill, J. Launchbury, and S. Peyton Jones. A short cut to deforestation. In Proc. Conference on Functional Programming Languages and Computer Architecture, pages 223-232, Copenhagen, June 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Hag87 T. Hagino. Category Theoretic Approach to Data Types. Ph.D thesis, University of Edinburgh, 1987.Google ScholarGoogle Scholar
  12. HIT96a Z. Hu, H. Iwasaki, and M. Takeichi. Construction of list homomorphisms via tupling and fusion. In ~1st International Symposium on Mathematical Foundation of Computer Science, LNCS Ili3, pages 407-418, Cracow, September 1996. Springer- Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. HIT96b Z. Hu, H. Iwasaki, and M. Takeichi. Deriving structural hylomorphisms from recursive definitions. In A CM SlGPLAN International Conference on Functional Programming, pages 73-82, Philadelphia, PA, May 1996. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Hug85 J. Hughes. Lazy memo-functions. In Proc. Conference on Functional Programming Languages and Computer Architecture (LNCS 201), pages 129-149, Nancy, France, September 1985. Springer-Verlag, Berlin. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Liu96 Y.A. Liu. Incremental Computation: A Semantics- Based Systematic Transformation Approach. PhD thesis, Department of Computer Science, Cornell University, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. LS95 J. Launchbury and T. Sheard. Warm fusion: Deriving build-catas from reeursive definitions. In Proc. Conference on Functional Programming Languages and Computer Architecture, pages 314-323, La Jolla, California, June 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Mee92 L. Meertens. Paramorphisms. Formal Aspects of Computing, 4(5):413-424, 1992.Google ScholarGoogle ScholarCross RefCross Ref
  18. MFP91 E. Metier, M. Fokkinga, and R. Paterson. Functional programming with bananas, lenses, envelopes and barbed wire. In Proc. Conference on Functional Programming Languages and Computer Architecture (LNCS 523), pages 124-144, Cambridge, Massachuetts, August 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. MH95 E. Metier and G. Hutton. Bananas in space: Exteding fold and unfold to exponential types. In Proc. Conference on Functional Programming Languages and Computer Architecture, pages 324-333, La Jolla, California, June 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Mic68 D. Michie. Menlo functions and machine learning. Nature, 218:19-22, 1968.Google ScholarGoogle ScholarCross RefCross Ref
  21. OHIT97 Y. Onoue, Z. Hu, H. Iwasaki, and M. Takeichi. A calculational fusion system HYLO. In IFIP TC ~ Working Conference on Algorithmic Languages and Calculi, Le Bischenberg, France, February 1997. Chapman&Hall. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Pet87 A. Pettorossi. Program development using lambda abstraction. In Int'l Conf. on Fundations of Software Technology and Theoretical Computer Science, pages 420-434, Pune, India, 1987. Springer Verlag (LNCS 287). Google ScholarGoogle ScholarCross RefCross Ref
  23. Pey88 S.L. Peyton Jones. The implementation of functional programming languages. Prentice-Hall, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. PP91 M. Proietti and A. Pettorossi. Unfolding-definitionfolding, in this order, for avoiding unnecessary variables in logic progrrams. In 3rd lnt'l Syrup., PLILP'91, pages 247-258, Passau, Germany, August 1991. LNCS 528. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. SF93 T. Sheard and L. Fegaras. A fold for all seasons. In Proc. Conference on Functional Programming Languages and Computer Architecture, pages 233-242, Copenhagen, june 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Tak87 M. Takeichi. Partial parametrization eliminates multiple traversals of data structures. A cta lnformatica, 24:57-77, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. TM95 A. Takano and E. Meijer. Shortcut deforestation in calculational form. In Proc. Conference on Functional Programming Languages and Computer Architecture, pages 306-313, La Jolla, California, June 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Tupling calculation eliminates multiple data traversals

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in

          Full Access

          • Published in

            cover image ACM SIGPLAN Notices
            ACM SIGPLAN Notices  Volume 32, Issue 8
            Aug. 1997
            322 pages
            ISSN:0362-1340
            EISSN:1558-1160
            DOI:10.1145/258949
            Issue’s Table of Contents
            • cover image ACM Conferences
              ICFP '97: Proceedings of the second ACM SIGPLAN international conference on Functional programming
              August 1997
              326 pages
              ISBN:0897919181
              DOI:10.1145/258948

            Copyright © 1997 ACM

            Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 1 August 1997

            Check for updates

            Qualifiers

            • article

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader