Algorithmic debugging for lazy functional languages

  • Henrik Nilsson
  • Peter Fritzson
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 631)


Lazy functional languages have non-strict semantics and are purely declarative, i.e. they support the notion of referential transparency and are devoid of side effects. Traditional debugging techniques are, however, not suited for lazy functional languages since computations generally do not take place in the order one might expect. Since algorithmic debugging allows the user to concentrate on the declarative aspects of program semantics, and will semi-automatically find functions containing bugs, we propose to use this technique for debugging lazy functional programs. In this paper we present an algorithmic debugger for a lazy functional language and some experience in using it. Because of the non-strict semantics of lazy functional languages, arguments to functions are in general partially evaluated expressions. The user is, however, usually more concerned with the values that these expressions represent. We address this problem by providing the user with a strictified view of the execution trace whenever possible.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [1]
    Lennart Augustsson. A compiler for Lazy ML, in Proceedings 1984 ACM Conference on LISP and Functional Programming, pp. 218–227, August 1984.Google Scholar
  2. [2]
    Lennart Augustsson. Personal communication on the lack of suitable debugging tools for lazy functional languages, November 1991.Google Scholar
  3. [3]
    Wlodek Drabent, Simin Nadjm-Tehrani, Jan Maluszynski. The Use of Assertions in Algorithmic Debugging, in Proceedings of the FGCS Conference, pp. 573–581, Tokyo, Japan, 1988.Google Scholar
  4. [4]
    Peter Fritzson, Tibor Gyimothy, Mariam Kamkar, and Nahid Shahmehri. Generalized Algorithmic Debugging and Testing, in Proceedings of the ACM SIGPLAN'91, pp. 317–326, Toronto, Ontario, Canada, June 1991.Google Scholar
  5. [5]
    Wolfgang Henhapl, Stefan Kaes, Gregor Snelting. Utilizing Fifth Generation Technology in Software Development Tools, report PI-R3/91, Technische Hochschule Darmstadt, March 1991.Google Scholar
  6. [6]
    Thomas Johnsson. Efficient Compilation of Lazy Evaluation, in Proceedings of the ACM SIGPLAN 1984 Symposium on Compiler Construction, SIGPLAN Notices 19(6), pp. 58–69, June 1984.Google Scholar
  7. [7]
    Lee Naish. Declarative debugging of lazy functional programs, report 92/6, Department of Computer Science, University of Melbourne, Australia, 1992.Google Scholar
  8. [8]
    Henrik Nilsson. Freja: a small, non-strict, purely functional language, MSc dissertation, Department of Computer Science and Applied Mathematics, Aston University, Birmingham, England, 1991.Google Scholar
  9. [9]
    Simon L. Peyton Jones. The Implementation of Functional Programming Languages, Prentice Hall, 1987.Google Scholar
  10. [10]
    Rudolph E. Seviora. Knowledge-Based Program Debugging Systems, in IEEE Software 4(3), pp. 20–32, May 1987.Google Scholar
  11. [11]
    Nahid Shahmehri. Generalized Algorithmic Debugging, PhD thesis, Department of Computer and Information Science, Linköping University, Linköping, Sweden, December 1991.Google Scholar
  12. [12]
    E. Y. Shapiro. Algorithmic Program Debugging, MIT Press, May 1982.Google Scholar
  13. [13]
    David A. Turner. Miranda: a non-strict functional language with polymorphic types, in Proceedings of the IFIP International Conference on Functional Programming Languages and Computer Architecture, Nancy, Springer Lecture Notes in Computer Science, LNCS 201, 1985.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1992

Authors and Affiliations

  • Henrik Nilsson
    • 1
  • Peter Fritzson
    • 1
  1. 1.Programming Environments Laboratory Department of Computer and Information ScienceLinköping UniversityLinköpingSweden

Personalised recommendations