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.
- 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 ScholarDigital Library
- Bir80 R. Bird. Tabulation techniques for recursive programs. ACM Computing Surveys, 12(4):403-417, 1980. Google ScholarDigital Library
- Bir84 R. Bird. Using circular programs to eliminate multiple traversals of data. Acta Informatica, 21:239- 250, 1984.Google ScholarDigital Library
- CH95 W. Chin and M. Hagiya. A transformation method for dynamic-sized tabulation. A cta Inforrnatica, 32:93-115, 1995. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- Coh83 N.H. Cohen. Eliminating redundant recursive calls. A CM 7~ansaction on Programming Languages and Systems, 5(3):265-299, July 1983. Google ScholarDigital Library
- Fok89 M. Fokkinga. Tupling and mutumorphisms. Squiggolist, 1(4), 1989.Google Scholar
- Fok92 M. Fokkinga. Law and Order in Algorithmics. Ph.D thesis, Dept. INF, University of Twente, The Netherlands, 1992.Google Scholar
- 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 ScholarDigital Library
- Hag87 T. Hagino. Category Theoretic Approach to Data Types. Ph.D thesis, University of Edinburgh, 1987.Google Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- Liu96 Y.A. Liu. Incremental Computation: A Semantics- Based Systematic Transformation Approach. PhD thesis, Department of Computer Science, Cornell University, 1996. Google ScholarDigital Library
- 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 ScholarDigital Library
- Mee92 L. Meertens. Paramorphisms. Formal Aspects of Computing, 4(5):413-424, 1992.Google ScholarCross Ref
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- Mic68 D. Michie. Menlo functions and machine learning. Nature, 218:19-22, 1968.Google ScholarCross Ref
- 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 ScholarDigital Library
- 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 ScholarCross Ref
- Pey88 S.L. Peyton Jones. The implementation of functional programming languages. Prentice-Hall, 1988. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- Tak87 M. Takeichi. Partial parametrization eliminates multiple traversals of data structures. A cta lnformatica, 24:57-77, 1987. Google ScholarDigital Library
- 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 ScholarDigital Library
Index Terms
- Tupling calculation eliminates multiple data traversals
Recommendations
Towards an automated tupling strategy
PEPM '93: Proceedings of the 1993 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulationThe tupling transformation strategy can be used to merge loops together by combining recursive calls and also to eliminate redundant calls for a class of programs. The clever (and difficult) step of this transformation strategy is to find an appropriate ...
Tupling calculation eliminates multiple data traversals
ICFP '97: Proceedings of the second ACM SIGPLAN international conference on Functional programmingTupling 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 ...
Redundant Call Elimination via Tupling
Program Transformation: Theoretical Foundations and Basic Techniques. Part 2Redundant call elimination has been an important program optimisation process as it can produce super-linear speedup in optimised programs. In this paper, we investigate use of the tupling transformation in achieving this optimisation over a first-order ...
Comments