Abstract
The software crisis results from our disorderly concepts of "program". These make programming an art, rather than an engineering discipline. Such a discipline would at least require that we have stocks of useful off-the-shelf programs and collections of standard theorems that can be applied repeatedly. We have neither.
Mathematical systems are often distinguished by a set of operations that (a) map a set of entities into itself, (b) have simply understood results, and (c) obey a set of strong algebraic laws. Neither conventional programs nor "object level" functional programs are entities belonging to such a system. The standard operations on conventional programs violate (b) and (c); object level functional programs normally employ lambda abstraction as their program building operation and it violates (a) and (c). Other problems of these program concepts are reviewed.
Function level programs are the entities of just such a mathematical system: programs are built by program-forming operations having good algebraic properties. Hence they are the subject of a large number of general theorems, theorems that are applicable in practice. We give examples. Function level programs also have the possibility of providing solutions to many of the other problems reviewed.
The paper reviews the function level FP system of programs, sketches a function level semantics for it, and from the equations of that semantics develops some moderately general results concerning linear, recursively defined functions, one concerning recursion removal. It then discusses other general, directly applicable results in the literature and shows that they are essentially function level results and are best presented and recognized in that form.
The final section is about optimization; it shows how some FP programs can be transformed into others that run as fast as Fortran programs. It introduces "Fortran constructs" into FP, pure functions that have an obvious corresponding Fortran-like program. It exhibits a number of function level identities for these constructs and shows how these can be used to convert inefficient FP programs into efficient Fortran-like ones.
Download to read the full chapter text
Chapter PDF
References
Backus, J. (1978) Can programming be liberated from the von Neumann style? A functional style and its algebra of programs. CACM 21:8 (August)
Backus, J. (1981a) Is computer science based on the wrong fundamental concept of "program"? An extended concept. in Algorithmic Languages, de Bakker & van Vliet, eds., North-Holland, Amsterdam (1981)
Backus, J. (1981b) The algebra of functional programs: function level reasoning, linear equations, and extended definitions. Lecture Notes in Computer Science #107, Springer-Verlag (April)
Backus, J. (1981c) Function level programs as mathematical objects. Proc. Conf. on Functional Programming Languages and Computer Architecture. ACM (October)
Bird, R. S. (1984) The promotion and accumulation strategies in transformational programming. Trans. Prog. Langs. & Systs. 6,4 ACM (October)
Burstall, R. M., and Darlington, J. (1977) A transformation system for developing recursive programs. JACM 24,1 (January)
Cohen, N. H. (1979) Characterization and elimination of redundancy in recursive programs. Proc. 6th Symp. on Principles of Prog. Langs. ACM
Dijkstra, E. W. (1976) A Discipline of Programming. Prentice-Hall
Guttag, J., Horning, J., and Williams, J. (1981) FP with data abstraction and strong typing. Proc. Conf. on Functional Programming Languages and Computer Architecture. ACM (October)
Halpern, J. Y., Williams, J. H., Wimmers, E. L., and Winkler, T. C. (1985) Denotational semantics and rewrite rules for FP. Proc. 12th Symp. on Princ. Prog. Langs., ACM (January)
Kieburtz, R. B., and Shultis, J. (1981) Transformations of FP program schemes. Proc. Conf. on Functional Programming Languages and Computer Architecture. ACM (October)
Hoare, C. A. R. (1969) An axiomatic basis for computer programming. CACM 12,10 (October)
Hughes, R. J. M. (1982) Super combinators: a new implementation method for applicative languages. Proc. Symp. on LISP and Functional Programming ACM (August)
Manna, Z. (1974) Mathematical Theory of Computation. McGraw-Hill
Mills, H. D. (1975) The new math of computer programming. CACM 18,1 (January)
Stoye, W. R., Clarke, T. J. W. and Norman, A. C. (1984) Some practical methods for rapid combinator reduction. Proc. Symp. on LISP and Functional Programming ACM (August)
Turner, D. A. (1979) A new implementation technique for applicative languages, Software Practice & Experience, vol 9, pp31–49
Turner, D. A. (1981) The semantic elegance of applicative languages. Proc. Conf. on Functional Programming Languages and Computer Architecture. ACM (October)
Wadler, P. (1981) Applicative style programming, program transformation, and list operators. Proc. Conf. on Functional Programming Languages and Computer Architecture. ACM (October)
Wadler, P. (1984) Listlessness is better than laziness: lazy evaluation and garbage collection at compile time. Proc. Symp. on LISP and Functional Programming ACM (August)
Williams, J. H. (1982) On the development of the algebra of functional programs. Trans. Prog. Langs. & Systs. 4,4 ACM (October)
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1985 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Backus, J. (1985). From function level semantics to program transformation and optimization. In: Ehrig, H., Floyd, C., Nivat, M., Thatcher, J. (eds) Mathematical Foundations of Software Development. CAAP 1985. Lecture Notes in Computer Science, vol 185. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-15198-2_5
Download citation
DOI: https://doi.org/10.1007/3-540-15198-2_5
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-15198-2
Online ISBN: 978-3-540-39302-3
eBook Packages: Springer Book Archive