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.
References
Arsac J., Kodratoff Y.: Some techniques for recursion removal for recursive functions. ACM TOPLAS 4, 2, 295–322 (1982)
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)
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)
Bauer F. L. et al.: The Munich project CIP. Volume II: The transformation system CIP-S. LNCS 292, Springer: Berlin-Heidelberg-New York (1987)
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)
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)
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)
Berghammer R.: Transformational programming with non-deterministic and higher-order constructs. In preparation
Bird R.: The promotion and accumulation strategies in transformational programming. ACM TOPLAS 6, 4, 487–504 (1984)
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)
Burstall R. M., Darlington J.: A transformation system for developing recursive programs. Journal ACM 24, 1, 44–67 (1977)
Curry H. B., Feys R.: Combinatoric logic, Volume I. North-Holland: Amsterdam (1958)
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)
Harrison P. G.: Linearisation: An optimisation for nonlinear functional programs. Science of Computer Programming 10, 281–318 (1988)
Hoare C. A. R.: Proof of correctness of data representation. Acta Informatica 1, 271–278 (1972)
Loeckx J., Sieber K.: The foundations of program verification. Teubner: Stuttgart (1984)
Manna Z.: Mathematical theory of computation. McGraw-Hill: New York (1974)
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)
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)
Pettorossi A.: A powerful strategy for deriving efficient programs by transformation. Symp. on LISP and Functional Programming, Austin (Texas), ACM, 273–281 (1984)
Stoy J. E.: Denotational semantics: The Scott-Strachey approach to programming language theory. MIT Press: Cambridge (1977)
Zierer H.: Programmierung mit Funktionsobjekten: Konstruktive Erzeugung semantischer Bereiche und Anwendung auf die partielle Auswertung. Dissertation, Institut für Informatik, TU München (1988)
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
Author information
Authors and Affiliations
Editor information
Rights 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