Algorithmic debugging for lazy functional languages
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.
- Lennart Augustsson. A compiler for Lazy ML, in Proceedings 1984 ACM Conference on LISP and Functional Programming, pp. 218–227, August 1984.Google Scholar
- Lennart Augustsson. Personal communication on the lack of suitable debugging tools for lazy functional languages, November 1991.Google Scholar
- 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
- 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
- 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
- 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
- Lee Naish. Declarative debugging of lazy functional programs, report 92/6, Department of Computer Science, University of Melbourne, Australia, 1992.Google Scholar
- 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
- Simon L. Peyton Jones. The Implementation of Functional Programming Languages, Prentice Hall, 1987.Google Scholar
- Rudolph E. Seviora. Knowledge-Based Program Debugging Systems, in IEEE Software 4(3), pp. 20–32, May 1987.Google Scholar
- Nahid Shahmehri. Generalized Algorithmic Debugging, PhD thesis, Department of Computer and Information Science, Linköping University, Linköping, Sweden, December 1991.Google Scholar
- E. Y. Shapiro. Algorithmic Program Debugging, MIT Press, May 1982.Google Scholar
- 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