Abstract
While the idea of declarative debugging has been around for a quarter of a century, the technology still hasn’t been adopted by working programmers, even by those working in declarative languages. The reason is that making declarative debuggers practical requires solutions to a whole host of problems. In this paper we address one of these problems, which is that retaining a complete record of every step of the execution of a program is infeasible unless the program’s runtime is very short, yet this record forms the space searched by the declarative debugger. Most parts of this search space therefore have to be stored in an implicit form. Each time the search algorithm visits a previously unexplored region of the search space, it must decide how big a part of the search space to rematerialize (which it does by reexecuting a call in the program). If it materializes too much, the machine may start to thrash or even run out of memory and swap space. If it materializes too little, then materializing all the parts of the search space required by a debugging session will require too many reexecutions of (parts of) the program, which will take too long. We present a simple algorithm, the ideal depth strategy, for steering the ideal middle course: minimizing reexecutions while limiting memory consumption to what is feasible. We show that this algorithm performs well even when used on quite long running programs.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Brown, M., Somogyi, Z.: Annotated event traces for declarative debugging (2003) Available from, http://www.cs.mu.oz.au/mercury/
Byrd, L.: Understanding the control flow of Prolog programs. In: Proceedings of the 1980 Logic Programming Workshop, Debrecen, Hungary, July 1980, pp. 127–138 (1980)
MacLarty, I.: Practical declarative debugging of Mercury programs. MSc thesis, University of Melbourne (July 2005)
MacLarty, I., Somogyi, Z., Brown, M.: Divide-and-query and subterm dependency tracking in the Mercury declarative debugger. In: Proceedings of AADEBUG 2005, Monterey, California (September 2005)
Nilsson, H.: Tracing piece by piece: affordable debugging for lazy functional languages. In: Proceedings of ICFP 1999, Paris, France, pp. 36–47 (September 1999)
Nilsson, H., Fritzson, P.: Algorithmic debugging for lazy functional languages. Journal of Functional Programming 4(3), 337–370 (1994)
Nilsson, H., Sparud, J.: The evaluation dependence tree as a basis for lazy functional debugging. Automated Software Engineering 4(2), 121–150 (1997)
Pereira, L.M.: Rational debugging in logic programming. In: Shapiro, E. (ed.) ICLP 1986. LNCS, vol. 225, pp. 203–210. Springer, Heidelberg (1986)
Plaisted, D.A.: An efficient bug location algorithm. In: Proceedings of ICLP 1984, Uppsala, Sweden, pp. 151–158 (July 1984)
Ronsse, M., de Bosschere, K., de Kergommeaux, J.C.: Execution replay and debugging. In: Proceedings of AADEBUG 2000, Munich, Germany (2000)
Shapiro, E.Y.: Algorithmic program debugging. MIT Press, Cambridge (1983)
Somogyi, Z.: Idempotent I/O for safe time travel. In: Proceedings of the AADEBUG 2003, Ghent, Belgium (September 2003)
Somogyi, Z., Henderson, F.: The implementation technology of the Mercury debugger. In: Proceedings of WPLE 1999, Las Cruces, New Mexico, pp. 35–49 (November 1999)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2005 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
MacLarty, I., Somogyi, Z. (2005). Controlling Search Space Materialization in a Practical Declarative Debugger. In: Van Hentenryck, P. (eds) Practical Aspects of Declarative Languages. PADL 2006. Lecture Notes in Computer Science, vol 3819. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11603023_3
Download citation
DOI: https://doi.org/10.1007/11603023_3
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-30947-5
Online ISBN: 978-3-540-31685-5
eBook Packages: Computer ScienceComputer Science (R0)