Skip to main content

Tracing the evaluation of lazy functional languages: A model and its implementation

  • Session 8
  • Conference paper
  • First Online:
Advances in Computing Science — ASIAN'97 (ASIAN 1997)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1345))

Included in the following conference series:

  • 144 Accesses

Abstract

We address the problem of producing a trace of the evaluation of a program written in a lazy functional language. To avoid ambiguities and possible misunderstandings it is essential that the trace structure is defined with respect to a formally described model of program evaluation.

We provide such a formal semantics for lazy evaluation of a simple lazy language, based closely on the work of Launchbury. The trace corresponds to the sequence of expression reductions defined by the evaluation model.

We also present a scheme to generate a concrete trace of the evaluation of programs written in the target language, based on its semantic rules. We employ a two-step transformational approach: first transform the program so that, on execution, it generates a call-by-name trace as result, then further transform this trace to a call-by-need trace.

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

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  • Z. Ariola, M. Felleisen, J. Mariast, M. Odersky, and P. Wadler. A call-by-need lambda calculus. In Proceedings of the 22nd ACM Symposium on Principles of Programming Languages, pages 233–246, 1995.

    Google Scholar 

  • M. Augustson and J. Reinfelds. A visual Miranda machine. In Proceedings, Software Education Conference SRIG-ET'94, Ed. M. Purvis, IEEE Computer Society Press, Los Alamitos California, pages 198–203, 1995.

    Google Scholar 

  • R. Bird and P. Wadler. Introduction to Functional Programming. Prentice Hall, 1988.

    Google Scholar 

  • J. Gibbons and K. Wansbrough. Tracing lazy functional languages. In Proceedings of Computing: The Australasian Theory Symposium”, 1996.

    Google Scholar 

  • D. Goldson. A symbolic calculator for non-strict functional languages. The Computer Journal, 37(3):177–187, 1994.

    Article  Google Scholar 

  • C. Hall, K. Hammond, and J. O'Donnell. An algorithmic and semantic approach to debugging. In Proceedings of the 1990 Glasgow Workshop on Functional Programming, pages 44–53, 1990.

    Google Scholar 

  • A. Kishon. Theory and Art of Semantics-Directed Program Execution Monitoring. PhD thesis, Department of Computer Science, Yale University, 1992.

    Google Scholar 

  • J. Launchbury. A natural semantics for lazy evaluation. In Proceedings of the 20th ACM Symposium on Principles of Programming Languages, pages 144–154, 1993.

    Google Scholar 

  • L. Naish and T. Barbour. Towards a portable lazy functional declarative debugger. In Proceedings of the 19th Australian Computer Science Conference, 1996. Also available as Technical Report 95/27, Department of Computer Science, University of Melbourne.

    Google Scholar 

  • H. Nilsson and P. Fritzson. Algorithmic debugging for lazy functional languages. Journal of Functional Programming, 4(3):337–369, 1994.

    Google Scholar 

  • J. T. O'Donnell and C. V. Hall. Debugging in applicative languages. Lisp and Symbolic Computation, 1(2):113–145, 1988.

    Article  Google Scholar 

  • S. L. Peyton Jones. The Implementation of Functional Programming Languages. Prentice-Hall, 1987.

    Google Scholar 

  • C. Runciman and D. Wakeling. Heap profiling for lazy functional programs. Journal of Functional Programming, 3(2):217–245, 1993.

    Google Scholar 

  • P. M. Sansom and S. L. Peyton Jones. Time and space profiling for non-strict higher-order functional languages. In Proceedings of the 22nd ACM Symposium on Principles of Programming Languages, pages 355–366, 1995.

    Google Scholar 

  • P. Sestoft. Deriving a lazy abstract machine. Journal of Functional Programming, 7 (3), 1997. To appear.

    Google Scholar 

  • E. Shapiro. Algorithmic Program Debugging. MIT Press, 1982.

    Google Scholar 

  • R. M. Snyder. Lazy debugging of lazy functional programs. New Generation Computing, 8:139–161, 1990.

    Google Scholar 

  • J. Sparud. A Transformational Approach to Debugging Lazy Functional Programs. Licentate thesis, Department of Computer Science, Chalmers University of Technology, 1996.

    Google Scholar 

  • J. Sparud and C. Runciman. Tracing Lazy Functional Computations Using Redex Trails. In Proceedings of the Ninth International Symposium on Programming Languages, Implementations, Logics, and Programs (PLILP97), 1997.

    Google Scholar 

  • R. Watson. Tracing Lazy Evaluation by Program Transformation. PhD thesis, School of Multimedia and Information Technology, Southern Cross University, 1997.

    Google Scholar 

  • R. Watson and E. Salzman. A trace browser for a lazy functional language. In Proceedings of the Twentieth Australian Computer Science Conference, pages 356–363, 1997.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

R. K. Shyamasundar K. Ueda

Rights and permissions

Reprints and permissions

Copyright information

© 1997 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Watson, R., Salzman, E. (1997). Tracing the evaluation of lazy functional languages: A model and its implementation. In: Shyamasundar, R.K., Ueda, K. (eds) Advances in Computing Science — ASIAN'97. ASIAN 1997. Lecture Notes in Computer Science, vol 1345. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-63875-X_63

Download citation

  • DOI: https://doi.org/10.1007/3-540-63875-X_63

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-63875-9

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

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics