Skip to main content

On the use of elements of functional programming in program development by transformations

  • Part III. Case Studies in Development
  • Chapter
  • First Online:
  • 137 Accesses

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 544))

Abstract

In this paper we have demonstrated the use of elements of functional programming such as currying, tupling, and fusion in the context of transformational program development. Formal transformation rules have been given which allow the introduction (or also the elimination) of such elements into programs that are subject to a development. For the proof of any of these rules computational respectively transformational induction has been applied. These two induction principles have both been formulated on the syntactic level. Very often this eases the application of these induction principles as no reference to the underlying formal semantics is needed. If the program development is supposed to be done in a formal calculus (as e.g., in [Pepper 84] or [Bauer et al. 87]), then this is an essential aspect.

The given transformation rules for currying, tupling, and fusion can, on one side, be used if the development aims at a functional program in an FP-like style (cf. [Backus 78]) but, on the other side, also for pure efficiency reasons. Example 1 and Example 2 of the paper demonstrate the efficiency improvement by tupling. Furthermore, function composition with specific functional expressions, viz. abstraction and representation expressions, has lead to the rule RANGE which expresses a change of data type. Finally, in Example 3 a combination of the various rules is demonstrated.

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

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Arsac J., Kodratoff Y.: Some techniques for recursion removal for recursive functions. ACM TOPLAS 4, 2, 295–322 (1982)

    Google Scholar 

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

    Google Scholar 

  3. Bauer F. L. et al.: The Munich project CIP. Volume I: The wide spectrum language CIP-L. LNCS 183, Springer: Berlin-Heidelberg-New York (1985)

    Google Scholar 

  4. Bauer F. L. et al.: The Munich project CIP. Volume II: The transformation system CIP-S. LNCS 292, Springer: Berlin-Heidelberg-New York (1987)

    Google Scholar 

  5. Bauer F. L., Wössner H.: Algorithmische Sprache und Programmentwicklung. Springer: Berlin-Heidelberg-New York (1981) Engl. Version: Algorithmic language and program development. Springer: Berlin-Heidelberg-New York (1982)

    Google Scholar 

  6. Berghammer R.: On the use of composition in transformational programming. Report TUM-I8512, Institut für Informatik, TU München (1985) Also in: Proc. TC 2 Working Conference on Program Specification and Transformation, April 15–17, 1986, Bad Tölz, F.R.G., North-Holland: Amsterdam, 221–242 (1987)

    Google Scholar 

  7. Berghammer R.: A transformational development of several algorithms for testing the existence of cycles in a directed graph. Report TUM-I8615, Institut für Informatik, TU München (1986)

    Google Scholar 

  8. Berghammer R.: Transformational programming with non-deterministic and higher-order constructs. In preparation

    Google Scholar 

  9. Bird R.: The promotion and accumulation strategies in transformational programming. ACM TOPLAS 6, 4, 487–504 (1984)

    Google Scholar 

  10. Broy M.: Algebraic methods for program construction: the project CIP. Report on a Workshop on Program Transformation and Programming Environments, September 12–16, 1983, Munich, F.R.G., NATO ASI Series F: Computer and System Sciences, Vol 8, Springer: Berlin-Heidelberg-New York, 199–222 (1984)

    Google Scholar 

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

    Google Scholar 

  12. Curry H. B., Feys R.: Combinatoric logic, Volume I. North-Holland: Amsterdam (1958)

    Google Scholar 

  13. Feather M. S.: A survey and classification of some program transformation techniques. Proc. TC 2 Working Conference on Program Specification and Transformation, April 15–17,1986, Bad Tölz, F.R.G., North-Holland: Amsterdam, 165–195 (1987)

    Google Scholar 

  14. Harrison P. G.: Linearisation: An optimisation for nonlinear functional programs. Science of Computer Programming 10, 281–318 (1988)

    Google Scholar 

  15. Hoare C. A. R.: Proof of correctness of data representation. Acta Informatica 1, 271–278 (1972)

    Google Scholar 

  16. Loeckx J., Sieber K.: The foundations of program verification. Teubner: Stuttgart (1984)

    Google Scholar 

  17. Manna Z.: Mathematical theory of computation. McGraw-Hill: New York (1974)

    Google Scholar 

  18. Partsch H.: Transformational program development in a particular problem domain. Habilitationsschrift, Institut für Informatik, TU München (1985) Also in: Science of Computer programming 7, 99–241 (1986)

    Google Scholar 

  19. Pepper P.: A simple calculus for program transformations (inclusive of induction). Report TUM-I8409, Institut für Informatik, TU München (1984) Also in: Science of Computer Programming 9, 221–262 (1987)

    Google Scholar 

  20. Pettorossi A.: A powerful strategy for deriving efficient programs by transformation. Symp. on LISP and Functional Programming, Austin (Texas), ACM, 273–281 (1984)

    Google Scholar 

  21. Stoy J. E.: Denotational semantics: The Scott-Strachey approach to programming language theory. MIT Press: Cambridge (1977)

    Google Scholar 

  22. Zierer H.: Programmierung mit Funktionsobjekten: Konstruktive Erzeugung semantischer Bereiche und Anwendung auf die partielle Auswertung. Dissertation, Institut für Informatik, TU München (1988)

    Google Scholar 

  23. Zierer H., Schmidt G., Berghammer R.: An interactive graphical manipulation system for higher objects based on relation algebra. In: Tinhofer G., Schmidt G. (eds.): Proc. 12th Conf. on Graphtheoretic Concepts in Computer Science. Bernried/Starnberger See, June 17–19, 1986, LNCS 246, Springer: Berlin-Heidelberg-New York, 68–81

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Manfred Broy Martin Wirsing

Rights and permissions

Reprints and permissions

Copyright information

© 1991 Springer-Verlag Berlin Heidelberg

About this chapter

Cite this chapter

Berghammer, R., Ehler, H. (1991). On the use of elements of functional programming in program development by transformations. In: Broy, M., Wirsing, M. (eds) Methods of Programming. Lecture Notes in Computer Science, vol 544. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0018274

Download citation

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

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-54576-7

  • Online ISBN: 978-3-540-38491-5

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics