Skip to main content

Controlling Search Space Materialization in a Practical Declarative Debugger

  • Conference paper
  • 308 Accesses

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 3819))

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

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Brown, M., Somogyi, Z.: Annotated event traces for declarative debugging (2003) Available from, http://www.cs.mu.oz.au/mercury/

  2. 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)

    Google Scholar 

  3. MacLarty, I.: Practical declarative debugging of Mercury programs. MSc thesis, University of Melbourne (July 2005)

    Google Scholar 

  4. 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)

    Google Scholar 

  5. Nilsson, H.: Tracing piece by piece: affordable debugging for lazy functional languages. In: Proceedings of ICFP 1999, Paris, France, pp. 36–47 (September 1999)

    Google Scholar 

  6. Nilsson, H., Fritzson, P.: Algorithmic debugging for lazy functional languages. Journal of Functional Programming 4(3), 337–370 (1994)

    Article  Google Scholar 

  7. Nilsson, H., Sparud, J.: The evaluation dependence tree as a basis for lazy functional debugging. Automated Software Engineering 4(2), 121–150 (1997)

    Article  Google Scholar 

  8. Pereira, L.M.: Rational debugging in logic programming. In: Shapiro, E. (ed.) ICLP 1986. LNCS, vol. 225, pp. 203–210. Springer, Heidelberg (1986)

    Google Scholar 

  9. Plaisted, D.A.: An efficient bug location algorithm. In: Proceedings of ICLP 1984, Uppsala, Sweden, pp. 151–158 (July 1984)

    Google Scholar 

  10. Ronsse, M., de Bosschere, K., de Kergommeaux, J.C.: Execution replay and debugging. In: Proceedings of AADEBUG 2000, Munich, Germany (2000)

    Google Scholar 

  11. Shapiro, E.Y.: Algorithmic program debugging. MIT Press, Cambridge (1983)

    Google Scholar 

  12. Somogyi, Z.: Idempotent I/O for safe time travel. In: Proceedings of the AADEBUG 2003, Ghent, Belgium (September 2003)

    Google Scholar 

  13. 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)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics