Program development using lambda abstraction

  • Alberto Pettorossi
Session 7 Programming Methodology
Part of the Lecture Notes in Computer Science book series (LNCS, volume 287)


We study the problem of avoiding multiple traversals of data structures in functional programming. A solution proposed in [Bir84] makes use of lazy evaluation and local recursion. We show that analogous perfomances can be achieved using higher order functions and lambda abstractions. The solution we propose works for the call-by-value evaluation rule and it does not require local recursion. We also show through some examples that higher order functions allow us to simulate the use of pointers of a Pascal-like language. We finally spend a few words on a theory of strategies for program development.


Program Transformation Efficient Program Recursive Definition High Order Function Prolog Program 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

7. References

  1. [AbV84]
    Abdali, K.S. and Vytopil, J.: "Generalization Heuristics for Theorems Related to Recursively Defined Functions" Report Buro Voor Systeemontwikkeling. Postbus 8348, Utrecht, Netherlands (1984).Google Scholar
  2. [Aub76]
    Aubin, R.: "Mechanizing Structural Induction" Ph.D. Thesis, Dept. of Artificial Intelligence, University of Edinburgh (1976).Google Scholar
  3. [Bac78]
    Backus, J.: "Can Programming be Liberated from the Von Neumann Style?" Comm. A.C.M. 21(8) (1978), pp. 613–641.Google Scholar
  4. [Bir84]
    Bird, R.S.: "Using Circular Programs to Eliminate Multiple Traversal of Data" Acta Informatica 21 (1984), pp. 239–250.CrossRefGoogle Scholar
  5. [Bir86]
    Bird, R.S.: "An Introduction to the Theory of Lists" Technical Monograph PRG-56, Oxford University Computing Laboratory, Oxford, England (1986).Google Scholar
  6. [BoM75]
    Boyer, R.S. and Moore, J.S.: "Proving Theorems About LISP Functions" J.A.C.M. 22, 1 (1975), pp. 129–144.Google Scholar
  7. [BuD77]
    Burstall, R.M. and Darlington, J.: "A Transformation System for Developing Recursive Programs" J.A.C.M. Vol.24, 1 (1977), pp. 44–67.Google Scholar
  8. [ChM79]
    Chirica, L.M. and Martin, D.F.: "An Order-Algebraic Definition of Knuthian Semantics" Mathematical System Theory 13, 1–27 (1979), pp. 1–27.CrossRefGoogle Scholar
  9. [Dar81]
    Darlington, J.: "An Experimental Program Transformation and Synthesis System" Artificial Intelligence 16, (1981), pp. 1–46.CrossRefGoogle Scholar
  10. [Ers82]
    Ershov, A. P.: "Mixed Computation: Potential Applications and Problems for Study" Theoretical Computer Science Vol.18, (1982), pp. 41–67.CrossRefGoogle Scholar
  11. [Fea86]
    Feather, M.S.: "A Survey and Classification of Some Program Transformation Techniques" Proc. TC2 IFIP Working Conference on Program Specification and Transformation. Bad Tölz, Germany (ed. L. Meertens) (1986).Google Scholar
  12. [JøS86]
    Jørring, U. and Scherlis, W. L.: "Compilers and Staging Transformations" Thirteenth Annual A.C.M. Symposium on Principles of Programming Languages, St. Petersburgh Beach, Florida, USA (1986), pp. 86–96.Google Scholar
  13. [Myc81]
    Mycroft, A.: "Abstract Interpretations and Optimising Transformations for Applicative Programs" Ph.D. Thesis, Computer Science Department, University of Edinburgh, Scotland (1981).Google Scholar
  14. [Pet78]
    Pettorossi, A.: "Improving Memory Utilization in Transforming Recursive Programs" Proc. MFCS 78, Zakopane (Poland), Lecture Notes in Computer Science n.64, Springer Verlag (1978), pp. 416–425.Google Scholar
  15. [Pet84]
    Pettorossi, A.: "A Powerful Strategy for Deriving Efficient Programs by Transformation" ACM Symposium on Lisp and Functional Programming, Austin, Texas (1984), pp.273–281.Google Scholar
  16. [PeS87]
    Pettorossi, A. and A. Skowron: "Higher Order Generalization in Program Derivation" Proc. Intern. Joint Conference on Theory and Practice of Software Development. Pisa, Italy. Lecture Notes in Computer Science n. 250, Springer-Verlag (1987), pp. 182–196.Google Scholar
  17. [Sch81]
    Scherlis, W. L.: "Program Improvement by Internal Specialization" A.C.M. Eighth Symposium on Principles of Programming Languages, (1981), pp. 146–160.Google Scholar
  18. [ScS85]
    Scherlis, W. L., and Scott, D.: "Semantical Based Programming Tools" Mathematical Foundations of Software Development, TAPSOFT '85, Lecture Notes in Computer Science n. 185, Springer-Verlag, Berlin (1985), pp. 52–59.Google Scholar
  19. [Swi85]
    Swierstra, D.: "Communication 513 SAU-15". IFIP WG.2.1, Sausalito, California, USA (1985).Google Scholar
  20. [Tak87]
    Takeichi, M.: "Partial Parametrization Eliminates Multiple Traversals of Data Structures" Acta Informatica 24, (1987), pp.57–77.CrossRefGoogle Scholar
  21. [Wad85]
    Wadler, P.L.: "Listlessness is Better than Laziness" Ph. D. Thesis, Computer Science Department, CMU-CS-85-171, Carnegie Mellon University, Pittsburgh, USA (1985).Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1987

Authors and Affiliations

  • Alberto Pettorossi
    • 1
  1. 1.IASI-CNRRomaItaly

Personalised recommendations