skip to main content
10.1145/258948.258964acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
Article
Free access

Tupling calculation eliminates multiple data traversals

Published: 01 August 1997 Publication History

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]
R.M. Burstall and J. Darlington. A transformation system for developing recursive programs. Journal of the ACM, 24(1):44-67, January 1977.
[2]
R. Bird. Tabulation techniques for recursive programs. ACM Computing Surveys, 12(4):403-417, 1980.
[3]
R. Bird. Using circular programs to eliminate multiple traversals of data. Acta Informatica, 21:239- 250, 1984.
[4]
W. Chin and M. Hagiya. A transformation method for dynamic-sized tabulation. A cta Inforrnatica, 32:93-115, 1995.
[5]
W. Chin. Towards an automated tupling strategy. In Proc. Conference on Partial Evaluation and Program Manipulation, pages 119-132, Copenhagen, June 1993. ACM Press.
[6]
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.
[7]
N.H. Cohen. Eliminating redundant recursive calls. A CM 7~ansaction on Programming Languages and Systems, 5(3):265-299, July 1983.
[8]
M. Fokkinga. Tupling and mutumorphisms. Squiggolist, 1(4), 1989.
[9]
M. Fokkinga. Law and Order in Algorithmics. Ph.D thesis, Dept. INF, University of Twente, The Netherlands, 1992.
[10]
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.
[11]
T. Hagino. Category Theoretic Approach to Data Types. Ph.D thesis, University of Edinburgh, 1987.
[12]
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.
[13]
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.
[14]
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.
[15]
Y.A. Liu. Incremental Computation: A Semantics- Based Systematic Transformation Approach. PhD thesis, Department of Computer Science, Cornell University, 1996.
[16]
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.
[17]
L. Meertens. Paramorphisms. Formal Aspects of Computing, 4(5):413-424, 1992.
[18]
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.
[19]
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.
[20]
D. Michie. Menlo functions and machine learning. Nature, 218:19-22, 1968.
[21]
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.
[22]
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).
[23]
S.L. Peyton Jones. The implementation of functional programming languages. Prentice-Hall, 1988.
[24]
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.
[25]
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.
[26]
M. Takeichi. Partial parametrization eliminates multiple traversals of data structures. A cta lnformatica, 24:57-77, 1987.
[27]
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.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

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

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 August 1997

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Article

Conference

ICFP97
Sponsor:
ICFP97: International Conference on Functional Programming 1997
June 9 - 11, 1997
Amsterdam, The Netherlands

Acceptance Rates

ICFP '97 Paper Acceptance Rate 25 of 78 submissions, 32%;
Overall Acceptance Rate 333 of 1,064 submissions, 31%

Upcoming Conference

ICFP '25
ACM SIGPLAN International Conference on Functional Programming
October 12 - 18, 2025
Singapore , Singapore

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)178
  • Downloads (Last 6 weeks)28
Reflects downloads up to 05 Jan 2025

Other Metrics

Citations

Cited By

View all

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media