skip to main content
article

Lightweight computation tree tracing for lazy functional languages

Published:02 June 2016Publication History
Skip Abstract Section

Abstract

A computation tree of a program execution describes computations of functions and their dependencies. A computation tree describes how a program works and is at the heart of algorithmic debugging. To generate a computation tree, existing algorithmic debuggers either use a complex implementation or yield a less informative approximation. We present a method for lazy functional languages that requires only a simple tracing library to generate a detailed computation tree. With our algorithmic debugger a programmer can debug any Haskell program by only importing our library and annotating suspected functions.

Skip Supplemental Material Section

Supplemental Material

References

  1. B. Braßel and H. Siegel. Debugging lazy functional programs by asking the oracle. In Implementation and Application of Functional Languages, 19th International Workshop, IFL 2007, Freiburg, Germany, September 27-29, 2007. Revised Selected Papers, LNCS 5083, pages 183–200, 2008.Google ScholarGoogle Scholar
  2. R. Caballero, C. Hermanns, and H. Kuchen. Algorithmic debugging of Java programs. Electronic Notes in Theoretical Computer Science, 177:75–89, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. R. Caballero, F. J. L´opez-Fraguas, and M. Rodr´ıguez-Artalejo. Theoretical foundations for the declarative debugging of lazy functional logic programs. In Functional and Logic Programming, LNCS 2024, pages 170–184, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. R. Caballero, E. Martin-Martin, A. Riesco, and S. Tamarit. EDD: A Declarative Debugger for Sequential Erlang Programs. In Tools and Algorithms for the Construction and Analysis of Systems, pages 581–586. Springer, 2014.Google ScholarGoogle Scholar
  5. O. Chitil and T. Davie. Comprehending finite maps for algorithmic debugging of higher-order functional programs. In Proceedings of the International Conference on Principles and Practice of Declarative Programming, PPDP 2008, pages 205–216, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. O. Chitil and Y. Luo. Structure and properties of traces for functional programs. Electronic Notes in Theoretical Computer Science, 176(1):39–63, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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, LNCS 2011. 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. O. Chitil, C. Runciman, and M. Wallace. Transforming Haskell for tracing. In Implementation of Functional Languages, LNCS 2670, pages 165–181. 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. K. Claessen and J. Hughes. QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs. In Proceedings of the Fifth ACM SIGPLAN International Conference on Functional Programming, ICFP 2000, pages 268–279, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Don Stewart. XMonad. http://xmonad.org, 2015.Google ScholarGoogle Scholar
  11. M. Faddegon and O. Chitil. Type Generic Observing. In Trends in Functional Programming, LNCS 8843. Springer, 2014.Google ScholarGoogle Scholar
  12. M. Faddegon and O. Chitil. Algorithmic Debugging of Real-World Haskell Programs: Deriving Dependencies from the Cost Centre Stack. In Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2015, pages 33–42, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. P. Fritzson, N. Shahmehri, M. Kamkar, and T. Gyimothy. Generalized algorithmic debugging and testing. ACM Lett. Program. Lang. Syst., 1(4):303–322, Dec. 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Game Creation Society, Carnegie Mellon. Raincat. http: //www.gamecreation.org/game/raincat, 2014.Google ScholarGoogle Scholar
  15. A. Gill. Debugging Haskell by Observing Intermediate Data Structures. Electronic Notes in Theoretical Computer Science, 41, 2000. ACM SIGPLAN Workshop on Haskell.Google ScholarGoogle Scholar
  16. D. Insa and J. Silva. An algorithmic debugger for Java. In Software Maintenance (ICSM), 2010 IEEE International Conference on, pages 1–6. IEEE, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. J. Launchbury. A natural semantics for lazy evaluation. In Proceedings of the symposium on Principles of programming languages, POPL 1993, pages 144–154, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. L. Naish. A declarative debugging scheme. Journal of Functional and Logic Programming, 3, 1997.Google ScholarGoogle Scholar
  19. L. Naish. A three-valued declarative debugging scheme. In Computer Science Conference, 2000. ACSC 2000. 23rd Australasian, pages 166–173, 2000.Google ScholarGoogle Scholar
  20. H. Nilsson. Declarative debugging for lazy functional languages. PhD thesis, Linköpings universitet, 1998.Google ScholarGoogle Scholar
  21. H. Nilsson and P. Fritzson. Algorithmic debugging for lazy functional languages. In M. Bruynooghe and M. Wirsing, editors, Programming Language Implementation and Logic Programming, PLILP ’92, pages 385–399. LNCS 631, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. H. Nilsson and J. Sparud. The evaluation dependence tree as a basis for lazy functional debugging. Automated Software Engineering, 4(2):121–150, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Olaf Chitil. FPretty. http://hackage.haskell.org/ package/FPretty, 2012.Google ScholarGoogle Scholar
  24. B. Pope. Declarative Debugging with Buddha. In Advanced Functional Programming, LNCS 3622, pages 273–308, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. B. Pope. A Declarative Debugger for Haskell. PhD thesis, The University of Melbourne, Australia, 2006.Google ScholarGoogle Scholar
  26. E. Y. Shapiro. Algorithmic program debugging. MIT press, 1983. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. J. Silva. A comparative Study of Algorithmic Debugging Strategies. In Logic-Based Program Synthesis and Transformation, LNCS 4407, pages 143–159, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. J. Sparud and C. Runciman. Tracing lazy functional computations using redex trails. In Programming Languages: Implementations, Logics, and Programs, PLILP ’97, pages 291– 308. LNCS 1292, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. P. Wadler. Why No One Uses Functional Languages. SIGPLAN Not., 33(8):23–27, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. M. Wallace, O. Chitil, T. Brehm, and C. Runciman. Multipleview tracing for Haskell: a new Hat. In Proceedings of the 2001 ACM SIGPLAN Haskell Workshop, 2001.Google ScholarGoogle Scholar
  31. A. Zeller. Why Programs Fail, 2nd Edition. Morgan Kaufmann, 2009.Google ScholarGoogle Scholar
  32. T. Zielonka and the GHC Team. http://www.haskell. org/ghc/survey2005-summary, 2005.Google ScholarGoogle Scholar

Index Terms

  1. Lightweight computation tree tracing for lazy functional languages

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 51, Issue 6
      PLDI '16
      June 2016
      726 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/2980983
      • Editor:
      • Andy Gill
      Issue’s Table of Contents
      • cover image ACM Conferences
        PLDI '16: Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation
        June 2016
        726 pages
        ISBN:9781450342612
        DOI:10.1145/2908080
        • General Chair:
        • Chandra Krintz,
        • Program Chair:
        • Emery Berger

      Copyright © 2016 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 2 June 2016

      Check for updates

      Qualifiers

      • article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader