Debugging programs written in lazy functional languages is difficult, and there are currently no realistic, general purpose debugging tools available. The basic problem is that computations in general do not take place in the order one might expect. Furthermore, lazy functional languages to a large extent free programmers from concerns regarding operational issues such as evaluation order, i.e. they are ‘declarative’. Debugging should therefore take place at the same, high level of abstraction. Thus, we propose to use algorithmic debugging for lazy functional languages, since this technique allows the user to focus on the declarative semantics of a program.
However, algorithmic debugging is based on tracing, and since the trace reflects the operational behaviour of the traced program, the trace should be transformed to abstract away these details if we wish to debug as declaratively as possible. We call this transformation strictification, because it makes the trace more like a trace from a strict language.
In this thesis, we present a strictifying algorithmic debugger for a small lazy functional language, and some experience from using it. We also discuss its main shortcomings, and outline a number of ideas for building a more realistic debugger. The single most pressing problem is the size of a complete trace. We propose to use a piecemeal tracing scheme to overcome this, by which only a part of the trace is stored at any one time, other parts being created on demand by re-executing the program.
Diss. Linköping : Univ., 1994