International Symposium on Programming

Programming 1980: International Symposium on Programming pp 269-281

The theory and practice of transforming call-by-need into call-by-value

  • Alan Mycroft
Conference paper

DOI: 10.1007/3-540-09981-6_19

Volume 83 of the book series Lecture Notes in Computer Science (LNCS)
Cite this paper as:
Mycroft A. (1980) The theory and practice of transforming call-by-need into call-by-value. In: Robinet B. (eds) International Symposium on Programming. Programming 1980. Lecture Notes in Computer Science, vol 83. Springer, Berlin, Heidelberg


Call-by-need (which is an equivalent but more efficient implementation of call-by-name for applicative languages) is quite expensive with current hardware and also does not permit full use of the tricks (such as memo functions and recursion removal) associated with the cheaper call-by-value. However the latter mechanism may fail to terminate for perfectly well-defined equations and also invalidates some program transformation schemata.

Here a method is developed which determines lower and upper bounds on the definedness of terms and functions, this being specialised to provide sufficient conditions to change the order and position of evaluation keeping within the restriction of strong equivalence. This technique is also specialised into an algorithm analogous to type-checking for practical use which can also be used to drive a program transformation package aimed at transforming call-by-need into call-by-value at ‘compile’ time.

We also note that many classical problems can be put in the framework of proving the strong equivalence where weak equivalence is easy to show (for example the Darlington/Burstall fold/unfold program transformation).

Download to read the full conference paper text

Copyright information

© Springer-Verlag 1980

Authors and Affiliations

  • Alan Mycroft
    • 1
  1. 1.Dept. of Computer ScienceUniversity of EdinburghUK