Skip to main content

Introducing Debugging Capabilities to Natural Semantics

  • Conference paper
Perspectives of Systems Informatics (PSI 2006)

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

  • 541 Accesses

Abstract

Reasoning about functional programs is simpler than reasoning about their imperative counterparts. However, finding bugs in lazy functional languages has been more complex until quite recently. The reason was that not much work was done on developing practical debuggers. Fortunately, several debuggers exist nowadays. One of the easiest to use Haskell debuggers is Hood, whose behavior is based on the concept of observation of intermediate data structures. However, although using Hood can be simple when observing some structures, it is known that it can be hard to understand how it works when dealing with complex situations.

In this paper, we formalize the behavior of the Hood debugger by extending Sestoft’s natural semantics. Moreover, we also indicate how to derive an abstract machine including such debugging information. By doing so, we do not only provide a formal foundation, but we also provide an alternative method to implement debuggers. In fact, we have already implemented a prototype of the abstract machine commented in this paper.

Work partially supported by the MCYT project TIC2003-07848-C02-01, the JCCLM project PAC-03-001, and the Marie Curie project MRTN-CT-2003-505121/TAROT.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

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

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others

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.: Introducing debugging capabilities to natural semantics (extended version) (2006), http://dalila.sip.ucm.es/~albertoe/publics/psiExtd.ps

  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’03), pp. 102–112. ACM Press, New York (2003)

    Google Scholar 

  5. Encina, A., Rodríguez, I., Rubio, F.: Testing speculative work in a lazy/eager parallel functional language. In: Ayguadé, E., et al. (eds.) LCPC 2005. LNCS, vol. 4339, Springer, Heidelberg (2006)

    Chapter  Google Scholar 

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

    Chapter  Google Scholar 

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

    Google Scholar 

  8. Gill, A.: Hood homepage (2006), http://www.haskell.org/hood

  9. Ortega-Mallén, Y., Hidalgo-Herrero, M.: Continuation Semantics for Parallel Haskell Dialects. In: Ohori, A. (ed.) APLAS 2003. LNCS, vol. 2895, pp. 303–321. Springer, Heidelberg (2003)

    Google Scholar 

  10. Jones, N., Mycroft, A.: Data flow analysis of applicative programs using minimal function graphs. In: Symposium on Principles of Programming Languages (POPL’86), pp. 296–306. ACM Press, New York (1986)

    Google Scholar 

  11. Jones, N., Rosendahl, M.: Higher order minimal function graphs. Journal of Functional and Logic Programming 2 (1997)

    Google Scholar 

  12. Klusik, U., et al.: 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 

  13. Launchbury, J.: A Natural Semantics for Lazy Evaluation. In: Proc. Conference on Principles of Programming Languages, POPL’93, ACM Press, New York (1993)

    Google Scholar 

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

    Google Scholar 

  15. 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 

  16. Pareja, C., et al.: Adding traces to a lazy functional evaluator. In: Moreno-Díaz Jr., R., Buchberger, B., Freire, J.-L. (eds.) EUROCAST 2001. LNCS, vol. 2178, pp. 627–641. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  17. Peña, R., Rubio, F.: Parallel functional programming at two levels of abstraction. In: Principles and Practice of Declarative Programming (PPDP’01), pp. 187–198. ACM Press, New York (2001)

    Chapter  Google Scholar 

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

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

    Google Scholar 

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

    Google Scholar 

  21. Sestoft, P.: Deriving a Lazy Abstract Machine. Journal of Functional Programming 7(3), 231–264 (1997)

    Article  MATH  MathSciNet  Google Scholar 

  22. 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 

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

    Article  Google Scholar 

  24. Wallace, M., et al.: Multipleview tracing for Haskell: a new Hat. In: Proc. of the 5th Haskell Workshop, pp. 151–170 (2001)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Irina Virbitskaite Andrei Voronkov

Rights and permissions

Reprints and permissions

Copyright information

© 2007 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

de la Encina, A., Llana, L., Rubio, F. (2007). Introducing Debugging Capabilities to Natural Semantics. In: Virbitskaite, I., Voronkov, A. (eds) Perspectives of Systems Informatics. PSI 2006. Lecture Notes in Computer Science, vol 4378. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-70881-0_18

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-70881-0_18

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-70880-3

  • Online ISBN: 978-3-540-70881-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics