skip to main content
10.5555/1760700.1760720guideproceedingsArticle/Chapter ViewAbstractPublication PagesConference Proceedingsacm-pubtype
Article

Introducing debugging capabilities to natural semantics

Published: 27 June 2006 Publication History

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.

References

[1]
O. Chitil, C. Runciman, and M. Wallace. Freja, Hat and Hood -- a comparative evaluation of three systems for tracing and debugging lazy functional programs. In Implementation of Functional Languages (IFL'00), LNCS 2011, pages 176-193. Springer-Verlag, 2001.
[2]
A. Encina, L. Llana, and F. Rubio. Introducing debugging capabilities to natural semantics (extended version). http://dalila.sip.ucm.es/~albertoe/publics/psiExtd.ps, 2006.
[3]
A. Encina and R. Peña. Proving the correctness of the STG machine. In Implementation of Functional Languages (IFL'01), LNCS 2312, pages 88-104. Springer-Verlag, 2001.
[4]
A. Encina and R. Peña. Formally deriving an STG machine. In Principles and Practice of Declarative Programming (PPDP'03), pages 102-112. ACM, 2003.
[5]
A. Encina, I. Rodríguez, and F. Rubio. Testing speculative work in a lazy/eager parallel functional language. In Languages and Compilers for Parallel Computing (LCPC'05), LNCS. Springer-Verlag, 2005.
[6]
R. Ennals and S. Peyton Jones. HsDebug: Debugging lazy programs by not being lazy. In Proceedings of the 7th Haskell Workshop, pages 84-87. ACM, 2003.
[7]
A. Gill. Debugging Haskell by observing intermediate data structures. In Proceedings of the 4th Haskell Workshop. Technical Report of the University of Nottingham, 2000.
[8]
A. Gill. Hood homepage. http://www.haskell.org/hood, 2006.
[9]
M. Hidalgo-Herrero and Y. Ortega-Mallén. Continuation semantics for parallel Haskell dialects. In First Asian Symposium on Programming Languages and Systems (APLAS'03), LNCS 1058, pages 303-321. Springer-Verlag, 2003.
[10]
N. Jones and A. Mycroft. Data flow analysis of applicative programs using minimal function graphs. In Symposium on Principles of Programming Languages (POPL'86), pages 296-306. ACM, 1986.
[11]
N. Jones and M. Rosendahl. Higher order minimal function graphs. Journal of Functional and Logic Programming, 2, Feb. 1997.
[12]
U. Klusik, R. Loogen, S. Priebe, and F. Rubio. Implementation skeletons in Eden: Low-effort parallel programming. In Implementation of Functional Languages (IFL'00), LNCS 2011, pages 71-88. Springer-Verlag, 2001.
[13]
J. Launchbury. A Natural Semantics for Lazy Evaluation. In Proc. Conference on Principles of Programming Languages, POPL'93. ACM, 1993.
[14]
H. Nilsson. Declarative debugging for lazy functional languages. PhD thesis, Depat. of Computer and Information Science, Linköping University, Sweden, 1998.
[15]
H. Nilsson. 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.
[16]
C. Pareja, R. Peña, F. Rubio, and C. Segura. Adding traces to a lazy functional evaluator. In Eurocast 2001, LNCS 2178, pages 627-641. Springer-Verlag, 2001.
[17]
R. Peña and F. Rubio. Parallel functional programming at two levels of abstraction. In Principles and Practice of Declarative Programming (PPDP'01), pages 187-198. ACM, 2001.
[18]
S. Peyton Jones and J. Hughes, editors. Report on the Programming Language Haskell 98. http://www.haskell.org, February 1999.
[19]
B. Pope and L. Naish. Practical aspects of declarative debugging in Haskell 98. In Principles and Practice of Declarative Programming (PPDP'03), pages 230-240. ACM, 2003.
[20]
C. Reinke. GHood -- graphical visualization and animation of Haskell object observations. In Proceedings of the 5th Haskell Workshop, volume 59 of ENTCS. Elsevier Science, 2001.
[21]
P. Sestoft. Deriving a Lazy Abstract Machine. Journal of Functional Programming, 7(3):231-264, May 1997.
[22]
J. Sparud and C. Runciman. Tracing lazy functional computations using redex trails. In Programming Languages, Implementations, Logics and Programs (PLILP'97), LNCS 1292, pages 291-308. Springer-Verlag, 1997.
[23]
P. Wadler. Functional programming: Why no one uses functional languages. SIGPLAN Notices, 33(8):23-27, August 1998. Functional Programming Column.
[24]
M. Wallace, O. Chitil, T. Brehm, and C. Runciman. Multipleview tracing for Haskell: a new Hat. In Proc. of the 5th Haskell Workshop, pages 151-170, 2001.

Cited By

View all
  • (2007)Observing intermediate structures in a parallel lazy functional languageProceedings of the 9th ACM SIGPLAN international conference on Principles and practice of declarative programming10.1145/1273920.1273935(109-120)Online publication date: 14-Jul-2007

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Guide Proceedings
PSI'06: Proceedings of the 6th international Andrei Ershov memorial conference on Perspectives of systems informatics
June 2006
496 pages
ISBN:9783540708803
  • Editors:
  • Irina Virbitskaite,
  • Andrei Voronkov

Publisher

Springer-Verlag

Berlin, Heidelberg

Publication History

Published: 27 June 2006

Author Tags

  1. debugging
  2. functional programming
  3. semantics

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)0
  • Downloads (Last 6 weeks)0
Reflects downloads up to 30 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2007)Observing intermediate structures in a parallel lazy functional languageProceedings of the 9th ACM SIGPLAN international conference on Principles and practice of declarative programming10.1145/1273920.1273935(109-120)Online publication date: 14-Jul-2007

View Options

View options

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media