A program execution monitor is a system that monitors the run-time behavior of a program. Examples include profilers, tracers, and debuggers. Monitors are an important element in any software development environment. However, despite their ubiquity, formal and general treatments of program execution monitoring are rare.
This thesis introduces monitoring semantics--a formal model of program execution monitors. Using the framework of continuation semantics, one can specify the behavior of a large family of program execution monitors. The resulting specification can then be automatically combined with the standard semantics to yield a composite semantics that is formally consistent with respect to the standard semantics.
Beyond its theoretical interest, monitoring semantics provides a basis for implementing a large family of source-level monitoring activities for any language for which a continuation semantics is available. To demonstrate the generality and effectiveness of this approach, we use our methodology to automatically synthesize debugging behaviors with standard interpreters. The enhanced interpreters are guaranteed to be consistent with the standard interpretation. This solves the consistency problem that still persists in many debugging methodologies for strict and especially non-strict programming languages. We present the synthesis of correct profilers, tracers and, most importantly, interactive source-level debuggers for strict and non-strict functional programming languages and compare their specifications.
Finally, using standard partial evaluation techniques as an optimization strategy, monitoring semantics forms a practical basis for building actual monitors. Our system can be optimized in 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.
All these ideas add up to a complete methodology for specifying, implementing and reasoning about a large family of program execution monitors for sequential deterministic programming languages.
Cited By
- Perera R, Acar U, Cheney J and Levy P Functional programs that explain their work Proceedings of the 17th ACM SIGPLAN international conference on Functional programming, (365-376)
- Perera R, Acar U, Cheney J and Levy P (2012). Functional programs that explain their work, ACM SIGPLAN Notices, 47:9, (365-376), Online publication date: 15-Oct-2012.
- Chang S, Barzilay E, Clements J and Felleisen M From stack traces to lazy rewriting sequences Proceedings of the 23rd international conference on Implementation and Application of Functional Languages, (100-115)
- Chen K, Lin J, Weng S and Khoo S Designing aspects for side-effect localization Proceedings of the 2009 ACM SIGPLAN workshop on Partial evaluation and program manipulation, (189-198)
- Kishon A, Hudak P and Consel C Monitoring semantics Proceedings of the ACM SIGPLAN 1991 conference on Programming language design and implementation, (338-352)
- Kishon A, Hudak P and Consel C (2019). Monitoring semantics, ACM SIGPLAN Notices, 26:6, (338-352), Online publication date: 1-Jun-1991.
Index Terms
- Theory and art of semantics-directed program execution monitoring
Recommendations
Sampling-based program execution monitoring
LCTES '10For its high overall cost during product development, program debugging is an important aspect of system development. Debugging is a hard and complex activity, especially in time-sensitive systems which have limited resources and demanding timing ...
Debugging natural semantics specifications
AADEBUG'05: Proceedings of the sixth international symposium on Automated analysis-driven debuggingIn this paper we present the design and usage of a debugging framework for the Relational Meta-Language (RML), which is a language for writing executable Natural Semantics specifications. The language is successfully used at our department for writing ...