Skip to main content
Log in

Calculating accumulations

  • Regular Papers
  • Published:
New Generation Computing Aims and scope Submit manuscript

Abstract

Theaccumulation strategy consists of generalizing a function over an algebraic data structure by inclusion of an extra parameter, anaccumulating parameter, for reusing and propagating intermediate results. However, there remain two major difficulties in this accumulation strategy. One is to determinewhere andwhen to generalize the original function. The other, surprisingly not yet receiving its worthy consideration, is how to manipulate accumulations. To overcome these difficulties, we propose to formulate accumulations ashigher order catamorphisms, and provide several general transformation rules for calculating accumulations (i.e., finding and manipulating accumulations) bycalculation-based (rather than a search-based) program transformation methods. Some examples are given for illustration.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Similar content being viewed by others

References

  1. Bird, R., “Tabulation techniques for recursive programs,”ACM Computing Surveys, 12, 4, pp. 403–417, 1980.

    Article  MATH  MathSciNet  Google Scholar 

  2. Bird, R., “The promotion and accumulation strategies in transformational programming,”ACM Transactions on Programming Languages and Systems, 6, 4, pp. 487–504, 1984.

    Article  MATH  MathSciNet  Google Scholar 

  3. Bird, R., “An introduction to the theory of lists,” inLogic of Programming and Calculi of Discrete Design (M. Broy, ed.), Springer-Verlag, pp. 5–42, 1987.

  4. Bird, R. and de Moor, O.,Algebras of Programming, Prentice Hall, 1996.

  5. Burstall, R. and Darlington, J., “A transformation system for developing recursive programs,”Journal of the ACM, 24, 1, pp. 44–67, Jan. 1977.

    Article  MATH  MathSciNet  Google Scholar 

  6. Feather, M., “A survey and classification of some program transformation techniques,” inTC2 IFIP Working Conference on Program Specification and Transformation (Bad Tolz, Germany), North Holland, pp. 165–195, 1987.

  7. Fokkinga, M., “A gentle introduction to category theory — the calculational approach —,”Tech. Rep. Lecture Notes, Dept. INF, University of Twente, The Netherlands, Sept. 1992.

    Google Scholar 

  8. Fokkinga, M., “Law and Order in Algorithmics,”Ph.D thesis, Dept. INF, University of Twente, The Netherlands, 1992.

    Google Scholar 

  9. Fokkinga, M., Jeuring, J., Meertens, L. and Meijer, E., “A translation from attribute grammars to catamorphisms,”Squiggolist, pp. 1–6, Nov. 1990.

  10. Gibbons, J., “Upwards and downwards accumulations on trees,” inMathematics of Program Construction, LNCS 669, Springer-Verlag, pp. 122–138, 1992.

  11. Gill, A., Launchbury, J. and Jones, S. P., “A short cut to deforestation,” inProc. Conference on Functional Programming Languages and Computer Architecture, Copenhagen, Jun. 1993, pp. 223–232.

  12. Hagino, T., “Category Theoretic Approach to Data Types,”Ph.D thesis, University of Edinburgh, 1987.

  13. Henderson, P.,Functional Programming: Application and Implementation, Prentice Hall International, 1980.

  14. Hu, Z., Iwasaki, H. and Takeichi, M., “Promotion strategies for parallelizing tree algorithms,” in11st Conf. Proc. Jpn Soc. for Software Sci. and Technical (JSSST ’94), Osaka, Japan, Nov. 1994, pp. 421–424.

  15. Hu, Z., Iwasaki, H. and Takeichi, M., “Deriving structural hylomorphisms from recursive definitions,” inACM SIGPLAN International Conference on Functional Programming, Philadelphia, PA, May 1996, ACM Press, pp. 73–82.

  16. Hu, Z., Iwasaki, H., Takeichi, M. and Takano, A., “Tupling calculation eliminates multiple data traversals,” inACM SIGPLAN International Conference on Functional Programming, Amsterdam, The Netherlands, Jun. 1997, ACM Press, pp. 164–175.

  17. Hu, Z., Takeichi, M. and Chin, W., “Parallelization in calculational forms,” in25th ACM Symposium on Principles of Programming Languages, San Diego, California, USA, Jan. 1998, pp. 316–328.

  18. Hughes, R. J. M., “A novel representation of lists and its application to the function reverse,”Information Processing Letters, 22, 3, pp. 141–144, Mar. 1986.

    Article  Google Scholar 

  19. Jeuring, J.,“Theories for Algorithm Calculation,” Ph.D thesis, Faculty of Science, Utrecht University, 1993.

  20. Malcolm, G., “Data structures and program transformation,”Science of Computer Programming, 14, pp. 255–279, Aug. 1990.

    Article  MATH  MathSciNet  Google Scholar 

  21. Meijer, E., “Calculating Compilers,”Ph.D thesis, University of Nijmegen, Toernooiveld, Nijmegen, The Netherlands, 1992.

    Google Scholar 

  22. Meijer, E., Fokkinga, M. and Paterson, R., “Functional programming with bananas, lenses, envelopes and barbed wire,” inProc. Conference on Functional Programming Languages and Computer Architecture, Cambridge, Massachuetts, Aug. 1991,LNCS 523, pp. 124–144.

  23. Michie, D., “Memo functions and machine learning,”Nature 218, pp. 19–22, 1968.

    Article  Google Scholar 

  24. Pettorossi, A. and Proietti, M., “Rules and strategies for program transformation,” inIFIP TC2/WG2.1 State-of-the-Art Report, LNCS 755, pp. 263–303, 1993.

  25. Pettorossi, A. and Skowron, A., “Higher-order generalization in program derivation,” inConf. on Theory and Practice of Software Development, Pisa, Italy, 1987,LNCS 250, Springer Verlag, pp. 182–196.

  26. Sheard, T. and Fegaras, L., “A fold for all seasons,” inProc. Conference on Functional Programming Languages and Computer Architecture, Copenhagen, Jun. 1993, pp. 233–242.

  27. Takano, A. and Meijer, E., “Shortcut deforestation in calculational form,” inProc. Conference on Functional Programming Languages and Computer Architecture, La Jolla, California, Jun. 1995, pp. 306–313.

  28. Yamashita, N., “Build-in Memoisation Mechanism for Functional Programs,”Master thesis, Dept. of Information Engineering, University of Tokyo, 1995.

Download references

Author information

Authors and Affiliations

Authors

Additional information

Zhenjiang Hu, Dr.Eng.: He is an Assistant Professor in Information Engineering at the University of Tokyo. He received his BS and MS in Computer Science from Shanghai Jiao Tong University in 1988 and 1990 respectively, and his Dr. Eng. degree in Information Engineering from the University of Tokyo in 1996. His current research concerns programming languages, functional programming, program transformation, and parallel processing.

Hideya Iwasaki, Dr.Eng.: He is an Associate Professor in Information Engineering at the University of Tokyo. He received the M.E. degree in 1985, the Dr. Eng. degree in 1988 from the University of Tokyo. His research interests are list processing languages, functional languages, parallel processing, and constructive algorithmics.

Masato Takeichi, Dr.Eng.: He is Professor in Mathematical Engineering and Information Engineering at the University of Tokyo since 1993. After graduation from the University of Tokyo, he joined the faculty at the University of Electro-Communications in Tokyo before he went back to work at the University of Tokyo in 1987. His research concerns the design and implementation of functional programming languages, and calculational program transformation systems.

About this article

Cite this article

Hu, Z., Iwasaki, H. & Takeichi, M. Calculating accumulations. New Gener Comput 17, 153–173 (1999). https://doi.org/10.1007/BF03037434

Download citation

  • Received:

  • Revised:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF03037434

Keywords

Navigation