Modeling an Algebraic Stepper

Programmers rely on the correctness of the tools in their programming environments. In the past, semanticists have studied the correctness of compilers and compiler analyses, which are the most important tools. In this paper, we make the case that other tools, such as debuggers and steppers, deserve semantic models, too, and that using these models can help in developing these tools. Our concrete starting point is the algebraic stepper in DrScheme, our Scheme programming environment. The algebraic stepper explains a Scheme computation in terms of an algebraic rewriting of the program text. A program is rewritten until it is in a canonical form (if it has one). The canonical form is the final result. The stepper operates within the existing evaluator, by placing breakpoints and by reconstructing source expressions from source information placed on the stack. This approach raises two questions. First, do the run-time breakpoints correspond to the steps of the reduction semantics? Second, does the debugging mechanism insert enough information to reconstruct source expressions? To answer these questions, we develop a high-level semantic model of the extended compiler and run-time machinery. Rather than modeling the evaluation as a low-level machine, we model the relevant low-level features of the stepper's implementation in a high-level reduction semantics. We expect the approach to apply to other semantics-based tools.

[1]  Cordelia V. Hall,et al.  Debugging in a side effect free programming environment , 1985, ACM SIGPLAN Notices.

[2]  Robin Milner,et al.  Communication and concurrency , 1989, PHI Series in computer science.

[3]  Matthias Felleisen,et al.  DrScheme: a programming environment for Scheme , 2002, J. Funct. Program..

[4]  H. Earl Ferguson,et al.  Debugging systems at the source language level , 1963, CACM.

[5]  Pertti Kellomäki PSD—a portable scheme debugger , 1993, LIPO.

[6]  Matthew Flatt,et al.  PLT MzScheme: Language Manual , 2000 .

[7]  Lee Naish,et al.  Towards a portable lazy functional declarative debug-ger , 1995 .

[8]  Henk Barendregt,et al.  The Lambda Calculus: Its Syntax and Semantics , 1985 .

[9]  Andrew Tolmach,et al.  Debugging standard ML , 1992 .

[10]  P. J. Landin The Mechanical Evaluation of Expressions , 1964, Comput. J..

[11]  Matthias Felleisen,et al.  Classes and mixins , 1998, POPL '98.

[12]  Gordon D. Plotkin,et al.  Call-by-Name, Call-by-Value and the lambda-Calculus , 1975, Theor. Comput. Sci..

[13]  Robert Balzer,et al.  EXDAMS: extendable debugging and monitoring system , 1969, AFIPS '69 (Spring).

[14]  Simon L. Peyton Jones,et al.  Formally based profiling for higher-order functional languages , 1997, TOPL.

[15]  Colin Runciman,et al.  Tracing Lazy Functional Computations Using Redex Trails , 1997, PLILP.

[16]  Robert Hieb,et al.  The Revised Report on the Syntactic Theories of Sequential Control and State , 1992, Theor. Comput. Sci..

[17]  Matthias Felleisen,et al.  DrScheme: A Pedagogic Programming Environment for Scheme , 1997, PLILP.

[18]  Luc Moreau A Syntactic Theory of Dynamic Binding , 1997, TAPSOFT.

[19]  Eugene W. Stark,et al.  Operational semantics of a focusing debugger , 1995, MFPS.

[20]  Cordelia V. Hall,et al.  Debugging in a side effect free programming environment , 1985, SLIPE '85.

[21]  Luc Moreau,et al.  A Syntactic Theory of Dynamic Binding , 1997, High. Order Symb. Comput..

[22]  Yves Bertot Occurrences in debugger specifications , 1991, PLDI '91.

[23]  Dale Miller,et al.  From operational semantics to abstract machines , 1992, Mathematical Structures in Computer Science.

[24]  Paul Hudak,et al.  Monitoring semantics: a formal framework for specifying, implementing, and reasoning about execution monitors , 1991, PLDI '91.