Skip to main content

Formalizing the Debugging Process in Haskell

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 3722))

Abstract

Due to its absence of side effects, it is usually claimed that reasoning about functional programs is simpler than reasoning about their imperative counterparts. Unfortunately, due to the absence of practical debuggers, finding bugs in lazy functional languages has been much more complex until quite recently. One of the easiest to use Haskell debuggers is Hood, whose behavior is based on the concept of observation of intermediate data structures. However, it can be hard to understand how it works when dealing with complex situations.

In this paper, we introduce debugging facilities in the STG abstract machine. Our goal is to obtain debugging information as close to the one obtained by the Hood debugger as possible. By extending the STG abstract machine, we do not only provide a formal framework to the debugging process, but also an alternative method to implement debuggers.

Research supported by the Spanish MCYT project TIC2003–07848–C02–01, and the Marie Curie project MRTN-CT-2003-505121/TAROT.

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   84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   109.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. Chitil, O., Runciman, C., Wallace, M.: Freja, Hat and Hood — a comparative evaluation of three systems for tracing and debugging lazy functional programs. In: Mohnen, M., Koopman, P. (eds.) IFL 2000. LNCS, vol. 2011, pp. 176–193. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  2. Encina, A., Llana, L., Rubio, F.: Formalizing the debugging process in Haskell, extended version (2005), http://dalila.sip.ucm.es/miembros/albertoe/

  3. Encina, A., Peña, R.: Proving the correctness of the STG machine. In: Arts, T., Mohnen, M. (eds.) IFL 2002. LNCS, vol. 2312, pp. 88–104. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  4. Encina, A., Peña, R.: Formally deriving an STG machine. In: Principles and Practice of Declarative Programming (PPDP 2003), pp. 102–112. ACM, New York (2003)

    Google Scholar 

  5. Ennals, R., Peyton Jones, S.: HsDebug: Debugging lazy programs by not being lazy. In: 7th Haskell Workshop, pp. 84–87. ACM, New York (2003)

    Chapter  Google Scholar 

  6. Gill, A.: Debugging Haskell by observing intermediate data structures. In: 4th Haskell Workshop. Technical Report of the University of Nottingham (2000)

    Google Scholar 

  7. Gill, A.: Hood homepage (2005), http://www.haskell.org/hood

  8. Hidalgo-Herrero, M., Ortega-Mallén, Y.: Continuation semantics for parallel Haskell dialects. In: Riis Nielson, H. (ed.) ESOP 1996. LNCS, vol. 1058, pp. 303–321. Springer, Heidelberg (1996)

    Google Scholar 

  9. Klusik, U., Loogen, R., Priebe, S., Rubio, F.: Implementation skeletons in Eden: Low-effort parallel programming. In: Mohnen, M., Koopman, P. (eds.) IFL 2000. LNCS, vol. 2011, pp. 71–88. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  10. Nilsson, H.: Declarative debugging for lazy functional languages. PhD thesis, Dpt. Computer and Information Science, Linköping University, Sweden (1998)

    Google Scholar 

  11. Nilsson, H.: How to look busy while being as lazy as ever: The implementation of a lazy functional debugger. Journal of Functional Programming 11(6), 629–671 (2001)

    Article  MATH  MathSciNet  Google Scholar 

  12. Peyton Jones, S.: Implementing lazy functional languages on stock hardware: The spineless tagless G-machine, version 2.5. Journal of Functional Programming 2(2), 127–202 (1992)

    Article  MATH  Google Scholar 

  13. Peyton Jones, S., Hughes, J. (eds.): Report on the Programming Language Haskell 1998 (February 1999), http://www.haskell.org

  14. Pope, B., Naish, L.: Practical aspects of declarative debugging in Haskell 98. In: Principles and Practice of Declarative Programming (PPDP 2003), pp. 230–240. ACM, New York (2003)

    Google Scholar 

  15. Reinke, C.: GHood — graphical visualization and animation of Haskell object observations. In: 5th Haskell Workshop. ENTCS, vol. 59. Elsevier Science, Amsterdam (2001)

    Google Scholar 

  16. Sparud, J., Runciman, C.: Tracing lazy functional computations using redex trails. In: Hartel, P.H., Kuchen, H. (eds.) PLILP 1997. LNCS, vol. 1292, pp. 291–308. Springer, Heidelberg (1997)

    Chapter  Google Scholar 

  17. Wadler, P.: Functional programming: Why no one uses functional languages. SIGPLAN Notices 33(8), 23–27 (1998) Functional Programming Column

    Article  Google Scholar 

  18. Wallace, M., Chitil, O., Brehm, T., Runciman, C.: Multipleview tracing for Haskell: a new Hat. In: 5th Haskell Workshop, pp. 151–170 (2001)

    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

de la Encina, A., Llana, L., Rubio, F. (2005). Formalizing the Debugging Process in Haskell. In: Van Hung, D., Wirsing, M. (eds) Theoretical Aspects of Computing – ICTAC 2005. ICTAC 2005. Lecture Notes in Computer Science, vol 3722. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11560647_14

Download citation

  • DOI: https://doi.org/10.1007/11560647_14

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-29107-7

  • Online ISBN: 978-3-540-32072-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics