Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
article

Structure and Properties of Traces for Functional Programs

Published: 01 May 2007 Publication History

Abstract

The tracer Hat records in a detailed trace the computation of a program written in the lazy functional language Haskell. The trace can then be viewed in various ways to support program comprehension and debugging. The trace was named the augmented redex trail. Its structure was inspired by standard graph rewriting implementations of functional languages. Here we describe a model of the trace that captures its essential properties and allows formal reasoning. The trace is a graph constructed by graph rewriting but goes beyond simple term graphs. Although the trace is a graph whose structure is independent of any rewriting strategy, we define the trace inductively, thus giving us a powerful method for proving its properties.

References

[1]
Bakewell, Adam, Using term-graph rewriting models to analyse relative space efficiency. Electronic Notes in Theoretical Computer Science. v72.
[2]
K. Bernstein and E.W. Stark. On formally defining debuggers: A comparison of three approaches. In 2nd International Workshop on Automated and Algorithmic Debugging, St. Malo, France, May 1995
[3]
Bernstein, Karen L. and Stark, Eugene W., Operational semantics of a focusing debugger. ENTCS. v1.
[4]
Braßel, Bernd, Hanus, Michael, Huch, Frank and Vidal, German, A semantics for tracing declarative multi-paradigm programs. In: Proceedings of the 6th ACM-SIGPLAN International Conference on Principles and Practice of Declarative Programming, ACM Press. pp. 179-190.
[5]
Caballero, Rafael, López-Fraguas, Francisco J. and Rodríguez-Artalejo, Mario, Theoretical foundations for the declarative debugging of lazy functional logic programs. In: LNCS, 2024. Springer.
[6]
Olaf Chitil. A semantics for tracing. In Thomas Arts and Markus Mohnen, editors, Draft Proceedings of the 13th International Workshop on Implementation of Functional Languages, IFL 2001, pages 249--254, Älvsjö, Sweden, September 2001. Ericsson Computer Science Laboratory
[7]
Chitil, Olaf, Runciman, Colin and Wallace, Malcolm, Freja, Hat and Hood --- A comparative evaluation of three systems for tracing and debugging lazy functional programs. In: Mohnen, Markus, Koopman, Pieter (Eds.), LNCS, 2011. Springer. pp. 176-193.
[8]
Chitil, Olaf, Runciman, Colin and Wallace, Malcolm, Transforming Haskell for tracing. In: LNCS, 2670. pp. 165-181.
[9]
Clements, John, Flatt, Matthew and Felleisen, Matthias, Modeling an algebraic stepper. In: Sands, David (Ed.), LNCS, 2028. Springer. pp. 320-334.
[10]
Ennals, Robert and Peyton Jones, Simon, Optimistic evaluation: an adaptive evaluation strategy for non-strict programs. In: ICFP '03: Proceedings of the eighth ACM SIGPLAN international conference on Functional programming, ACM Press. pp. 287-298.
[11]
Faxén, Karl-Filip, Cheap eagerness: speculative evaluation in a lazy functional language. In: ICFP '00: Proceedings of the fifth ACM SIGPLAN International Conference on Functional programming, ACM Press. pp. 150-161.
[12]
Gill, Andy, Debugging Haskell by observing intermediate data structures. Electronic Notes in Theoretical Computer Science. v41 i1.
[13]
Johnsson, Thomas, Efficient compilation of lazy evaluation. In: Proceedings of the SIGPLAN '84 Symposium on Compiler Construction, ACM Press. pp. 58-69.
[14]
Klop, J.W., Term rewriting systems. In: Abramsky, S., Gabbay, M., Maibaum, T.S.E. (Eds.), Handbook of Logic in Computer Science, volume 2, Oxford University Press. pp. 1-116.
[15]
Launchbury, John, A natural semantics for lazy evaluation. In: Conference Record of the Twentieth Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, ACM Press. pp. 144-154.
[16]
Yong Luo and Olaf Chitil. Proving the correctness of algorithmic debugging for functional programs. In Draft Proceedings of the Seventh Symposium on Trends in Functional Programming, TFP 2006, Nottingham, UK, April 2006
[17]
Yong Luo and Olaf Chitil. Replacing unevaluated parts in the traces of functional programs. In Draft Proceedings of the 18th International Symposium on Implementation and Application of Functional Languages, IFL 2006, pages 304--325, Budapest, Hungary, 2006. Eötvös Loránd University. Technical Report No: 2006-S01
[18]
Maessen, Jan-Willem, Eager Haskell: resource-bounded execution yields efficient iteration. In: Haskell '02: Proceedings of the 2002 ACM SIGPLAN workshop on Haskell, ACM Press. pp. 38-50.
[19]
Henrik Nilsson. Declarative Debugging for Lazy Functional Languages. PhD thesis, Linköping, Sweden, May 1998
[20]
Peyton Jones, Simon L., Implementing lazy functional languages on stock hardware: The spineless tagless G-machine. Journal of Functional Programming. v2 i2. 127-202.
[21]
Plump, Detlef, Term graph rewriting. In: Ehrig, H., Engels, G., Kreowski, H.-J., Rozenberg, G. (Eds.), Applications, Languages and Tools, Volume 2. World Scientific. pp. 3-61.
[22]
B. Pope and Lee Naish. Practical aspects of declarative debugging in Haskell-98. In Fifth ACM SIGPLAN Conference on Principles and Practice of Declarative Programming, pages 230--240, 2003
[23]
Shapiro, E.Y., Algorithmic Program Debugging. 1983. MIT Press.
[24]
Silva, Josep and Chitil, Olaf, Combining algorithmic debugging and program slicing. In: PPDP '06: Proceedings of the 8th ACM SIGPLAN symposium on Principles and practice of declarative programming, ACM Press. pp. 157-166.
[25]
Sparud, Jan and Runciman, Colin, Complete and partial redex trails of functional computations. In: Clack, C., Hammond, K., Davie, T. (Eds.), Springer LNCS, Vol. 1467. pp. 160-177.
[26]
Sparud, Jan and Runciman, Colin, Tracing lazy functional computations using redex trails. In: Glaser, H., Hartel, P., Kuchen, H. (Eds.), Springer LNCS, Vol. 1292. pp. 291-308.
[27]
Malcolm Wallace, Olaf Chitil, Thorsten Brehm, and Colin Runciman. Multiple-view tracing for Haskell: a new Hat. In Preliminary Proceedings of the 2001 ACM SIGPLAN Haskell Workshop, UU-CS-2001-23. Universiteit Utrecht, 2001. Final proceedings to appear in ENTCS 59(2)

Cited By

View all
  • (2021)A stepper for a functional JavaScript sublanguageProceedings of the 2021 ACM SIGPLAN International Symposium on SPLASH-E10.1145/3484272.3484968(71-81)Online publication date: 20-Oct-2021
  • (2016)A Lightweight HatProceedings of the 28th Symposium on the Implementation and Application of Functional Programming Languages10.1145/3064899.3064904(1-14)Online publication date: 31-Aug-2016
  • (2016)Lightweight computation tree tracing for lazy functional languagesACM SIGPLAN Notices10.1145/2980983.290810451:6(114-128)Online publication date: 2-Jun-2016
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Electronic Notes in Theoretical Computer Science (ENTCS)
Electronic Notes in Theoretical Computer Science (ENTCS)  Volume 176, Issue 1
May, 2007
157 pages

Publisher

Elsevier Science Publishers B. V.

Netherlands

Publication History

Published: 01 May 2007

Author Tags

  1. Haskell
  2. Tracing
  3. augmented redex trail
  4. debugging

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)0
  • Downloads (Last 6 weeks)0
Reflects downloads up to 18 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2021)A stepper for a functional JavaScript sublanguageProceedings of the 2021 ACM SIGPLAN International Symposium on SPLASH-E10.1145/3484272.3484968(71-81)Online publication date: 20-Oct-2021
  • (2016)A Lightweight HatProceedings of the 28th Symposium on the Implementation and Application of Functional Programming Languages10.1145/3064899.3064904(1-14)Online publication date: 31-Aug-2016
  • (2016)Lightweight computation tree tracing for lazy functional languagesACM SIGPLAN Notices10.1145/2980983.290810451:6(114-128)Online publication date: 2-Jun-2016
  • (2016)Lightweight computation tree tracing for lazy functional languagesProceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/2908080.2908104(114-128)Online publication date: 2-Jun-2016
  • (2011)From stack traces to lazy rewriting sequencesProceedings of the 23rd international conference on Implementation and Application of Functional Languages10.1007/978-3-642-34407-7_7(100-115)Online publication date: 3-Oct-2011
  • (2010)A tracking semantics for CSPProceedings of the 10th international conference on Mathematics of program construction10.5555/1886619.1886636(248-270)Online publication date: 21-Jun-2010
  • (2008)Comprehending finite maps for algorithmic debugging of higher-order functional programsProceedings of the 10th international ACM SIGPLAN conference on Principles and practice of declarative programming10.1145/1389449.1389475(205-216)Online publication date: 15-Jul-2008

View Options

View options

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media