Semantics-Directed Program Execution Monitoring


Amir Kishon and Paul Hudak


Monitoring semantics is a formal model of program execution which captures ``monitoring activity'' as found in profilers, tracers, debuggers, etc.  Beyond its theoretical interest, this formalism provides a new methodology for implementing a large family of source-level monitoring activities for sequential deterministic programming languages.  In this article we explore the use of monitoring semantics in the specification and implementation of a
variety of monitors: profilers, tracers, collecting interpreters, and, most importantly, interactive source-level debuggers.  Although we consider such monitors only for (both strict and non-strict) functional languages, the methodology extends easily to imperative languages, since it begins with a continuation semantics specification.

In addition, using standard partial evaluation techniques as an optimization strategy, we show that the methodology forms a practical basis for building real monitors.  Our system can be optimized at two levels of specialization: specializing the interpreter with respect to a monitor specification automatically yields an instrumented interpreter; further specializing this instrumented interpreter with respect to a source program yields an instrumented program, i.e., one in which the extra code to perform monitoring has been automatically embedded into the program.


    ,author =      "Kishon, A. and Hudak, P."
    ,title =       "Semantics-Directed Program Execution Monitoring"
    ,journal=      "Journal of Functional Programming"