Tracing lazy functional computations using redex trails

  • Jan Sparud
  • Colin Runciman
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1292)


We describe the design and implementation of a system for tracing computations in a lazy functional language. The basis of our tracing method is a program transformation carried out by the compiler: transformed programs compute the same values as the original, but embedded in functional data structures that also include redex trails showing how the values were obtained. A special-purpose display program enables detailed but selective exploration of the redex trails, with cross-links to the source program.


debugging graph reduction Haskell program transformation 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [HM93]
    Jonathan E. Hazan and Richard G. Morgan. The location of errors in functional programs. In Peter Pritzson, editor, Automated and Algorithmic Debugging, volume 749 of Lecture Notes in Computer Science, pages 135–152, Linköping, Sweden, May 1993.Google Scholar
  2. [Jon92]
    Richard Jones. Tail recursion without space leaks. Journal of Functional Programming, 2(1):73–79, January 1992.Google Scholar
  3. [KHC91]
    A. Kishon, P. Hudak, and C. Consel. Monitoring semantics: a formal frame-work for specifying, implementing and reasoning about execution monitors. In ACM Conference on Programming Language Design and Implementation (PLDI'91), pages 338–52, June 1991.Google Scholar
  4. [NB95]
    Lee Naish and Tim Barbour. Towards a portable lazy functional declarative debugger. Technical Report 95/27, Department of Computer Science, University of Melbourne, Australia, 1995.Google Scholar
  5. [NF94]
    H. Nilsson and P. Fritzson. Algorithmic debugging for lazy functional languages. Journal of Functional Programming, 4(3), 1994.Google Scholar
  6. [NS97]
    Henrik Nilsson and Jan Sparud. The evaluation dependence tree as a basis for lazy functional debugging. Journal of Automated Software Engineering, 4(2):152–205, April 1997.Google Scholar
  7. [Par93]
    W. Partain. The nofib benchmark suite of Haskell programs. In J. Launchbury and P. Sansom, editors, Proc. 1992 Glasgow Workshop on Functional Programming, pages 195–202. Springer Verlag, Workshops in Computing, 1993.Google Scholar
  8. [Röj95]
    N. Röjemo. Highlights from nhc-a space efficient haskell compiler. In Proc. 7th Intl. Conf. on Functional Programming Languages and Computer Architecture (FPCA'95), pages 282–292, La Jolla, June 1995. ACM Press.Google Scholar
  9. [Sha82]
    Ehud Y. Shapiro. Algorithmic Program Debugging. MIT Press, May 1982.Google Scholar
  10. [Spa96]
    Jan Sparud. A transformational approach to debugging lazy functional programs. Licentiate Thesis, Department of Computing Science, Chalmers University of Technology, S-412 96, Göteborg, Sweden, February 1996.Google Scholar
  11. [TA90]
    A. P. Tolmach and A. W. Appel. Debugging Standard ML without reverse engineering. In Proc. ACM cord. on Lisp and functional programming. ACM Press, 1990.Google Scholar
  12. [WR97]
    M. Wallace and C. Runciman. Heap compression and binary I/O in Haskell. In Proc. 2nd ACM SIGPLAN Workshop on Haskell, Amsterdam, June 1997.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1997

Authors and Affiliations

  • Jan Sparud
    • 1
  • Colin Runciman
    • 1
  1. 1.Department of Computer ScienceUniversity of YorkHeslingtonUK

Personalised recommendations