Skip to main content
Log in

Deriving very efficient algorithms for evaluating linear recurrence relations using the program transformation technique

  • Published:
Acta Informatica Aims and scope Submit manuscript

Summary

Using the program transformation technique we derive some algorithms for evaluating linear recurrence relations in logarithmic time. The particular case of the Fibonacci function is first considered and a comparison with the conventional matrix exponentiation algorithm is made. This comparison allows us also to contrast the transformation technique and the stepwise refinement technique underlining some interesting features of the former one. Through the examples given we also explain why those features are interesting for a useful and reliable program construction methodology.

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. Arsac, J., Kodratoff, Y.: Some techniques for recursion removal from recursive functions. ACM Trans. Progr. Lang. Syst. 4, 2, 295–322 (1982)

    Google Scholar 

  2. Aubin, A.: Mechanizing structural induction: Part I and II. Theor. Comput. Sci. 9, 3, 329–362 (1979)

    Google Scholar 

  3. Backus, J.: Can programming be liberated from the von Neumann style? A functional style and its algebra of programs. CACM 21, 8, 613–641 (1978)

    Google Scholar 

  4. Bauer, F.L., Broy, M., Partsch, H., Pepper, P., Wössner, H.: Systematics of transformation rules, TUM-INT-BER-77-12-0350. München: Institut für Informatik, Technische Universität, 1978

    Google Scholar 

  5. Bauer, F.L., Partsch, H., Pepper, P., Wössner, H.: Notes on the project CIP: outline of a transformation system, TUM-INFO-7729. München: Institut für Informatik, Technische Universität, 1977

    Google Scholar 

  6. Bauer, F.L. and Wössner, H.: Algorithmic language and program development. Berlin, Heidelberg, New York: Springer 1981

    Google Scholar 

  7. Broy, M., Krieg-Brückner, B.: Derivation of invariant assertions during program development by transformation. ACM Trans. Progr. Lang. Syst. 2, 3, 321–337 (1980)

    Article  Google Scholar 

  8. Burstall, R.M., Darlington, J.: A transformation system for developing recursive programs. JACM 24, 1, 44–67 (1977)

    Google Scholar 

  9. Burstall, R.M., Feather, M.: Program development by transformation: an overview. Proc. ‘Les Fondements de la Programmation’. Amirchahy, M., Neel, D. (eds.) Toulouse, pp. 45–55. IRIASEFI, France 1977

    Google Scholar 

  10. Chatelin, P.: Self-redefinition as a program manipulation strategy. Proc. Symp. Artif. Intellig. Progr. Lang. ACM SIGPLAN Notices and SIGART Newsletter, 174–179 (1977)

  11. Cohen, N.H.: Source-to-source improvement of recursive programs. Ph. D. Thesis, Harvard University, TR. 13–80, Aiken Computation Lab., Cambridge, MA, 1980

    Google Scholar 

  12. Dahl, O-J., Dijkstra, E.W., Hoare, C.A.R.: Structured Programming. London: Academic Press 1972

    Google Scholar 

  13. Darlington, J., Burstall, R.M.: A system which automatically improves programs. Acta Informat. 6, 41–60 (1976)

    Google Scholar 

  14. Feather, M.S.: ZAP program transformation system: Primer and user manual, DAI Research Report No. 54, Dept. of Artificial Intelligence, University of Edinburgh, 1978

  15. Feather, M.S.: A system for developing programs by transformation. Ph. D. Thesis, University of Edinburgh, 1979

  16. Feather, M.S.: A system for assisting program transformation. ACM Trans. Progr. Lang. Syst. 4, 1, 1–20 (1982)

    Google Scholar 

  17. Floyd, R.W.: The paradigms of programming. CACM 22, 8, 455–460 (1979)

    Google Scholar 

  18. Gries, D., Levin, G.: Computing Fibonacci Numbers (and similarly defined functions) in log time. Info. Proc. Lett. 10, 68–75 (1980)

    Google Scholar 

  19. Hoggatt, V.E. Jr.: Fibonacci and Lucas Numbers. Boston: Houghton Mifflin Co. 1969

    Google Scholar 

  20. Huet, G., Lang, B.: Proving and applying program transformations expressed with second-order patterns. Acta Informat. 11, 31–55 (1978)

    Google Scholar 

  21. Kott, L.: About transformation system: A theoretical study. 3ème Colloque International sur la Programmation, 232–247, Dunod, Paris 1978

    Google Scholar 

  22. Liu, C.L.: Introduction to Combinatorial Mathematics. McGraw-Hill 1968

  23. Partsch, H., Pepper, P.: Program transformations on different levels of programming, TUM-INFO-7715. München: Institut für Informatik, Technische Universität, 1977

    Google Scholar 

  24. Partsch, H., Steinbrüggen, R.: A comprehensive survey on program transformation systems, TUM 18108. München: Institut für Informatik, Technische Universität, 1981

    Google Scholar 

  25. Pettorossi, A.: Improving memory utilization in transforming programs. MFCS, Zakopane, Poland. Lecture Notes in Computer Science n. 64, 416–425. Berlin-Heidelberg-New York: Springer, 1978

    Google Scholar 

  26. Pettorossi, A.: Transformation of programs and use of “tupling strategy”. Proc. of Informatica '77 Conference, Bled, Yugoslavia, 3-103, 1–6 (1977)

    Google Scholar 

  27. Pettorossi, A.: Derivation of an 0 (k 2log n) algorithm for computing order-k Fibonacci numbers from the 0 (k 3log n) matrix multiplication method. Info. Proc. Lett. 11, 4, 5, 172–179 (1980)

    Google Scholar 

  28. Schwarz, J.: Verifying the safe use of destructive operations in applicative programs. 3ème Colloque International sur la Programmation, pp. 394–410, Dunod, Paris 1978

    Google Scholar 

  29. Steinbrüggen, R.: Equivalent recursive definitions of certain number theoretical functions, TUMINFO-7714. München: Institut für Informatik, Technische Universität, 1977

    Google Scholar 

  30. Urbanek, F.J.: An 0 (log n) algorithm for computing the nth element of the solution of a difference equation. Info. Proc. Lett. 11, 2, 66–67 (1980)

    Google Scholar 

  31. Walker, S.A. and Strong, H.R.: Characterizations of flowchartable recursions. Proc. 4th ACM Conference on Theory of Computing, Denver, Colorado, pp. 18–34, 1972

    Google Scholar 

  32. Wand, M.: Continuation-based program transformation strategies. JACM 27, 1, 164–180 (1980)

    Google Scholar 

  33. Wegbreit, B.: Goal-directed program transformation. IEEE Trans. Software Eng. SE-2, 69–79 (1976)

    Google Scholar 

  34. Wilson, T.C., Shortt, J.: An 0 (log n) algorithm for computing general order-k Fibonacci numbers. Info. Proc. Lett. 10, 2, 68–75 (1980)

    Google Scholar 

  35. Wirth, N.: Program development by stepwise refinement. CACM 14, 4, 221–227 (1971)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Pettorossi, A., Burstall, R.M. Deriving very efficient algorithms for evaluating linear recurrence relations using the program transformation technique. Acta Informatica 18, 181–206 (1982). https://doi.org/10.1007/BF00264438

Download citation

  • Received:

  • Issue Date:

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

Keywords

Navigation