Experiment Using Partial Evaluation for Transformational Debugging
To identify the source of runtime errors, techniques such as “debug-by-execution” are widely used, e.g., steppers. Although this technique can be useful for non-runtime errors, it has been less extensively explored because of the inherent difficulties in stepping through programs with such errors. In this new ideas and emerging results paper, we focus on debugging type errors in statically typed languages. We explore “transformational debugging,” a method that transforms erroneous code to provide users with an alternative perspective on the source code, thereby facilitating the debugging process. The proposed approach comprises three phases: In the first phase, we use the error messages from the compiler's type inferencer to “freeze” parts of the program. In the second phase, the type inferencer is used to reduce the number of “frozen” parts. In the third phase, a partial evaluator evaluates the partially “frozen” program. During partial evaluation, the frozen parts are treated as dynamic and therefore remain as code without being evaluated, whereas the other parts are treated as static and are evaluated. This study proposes the generic algorithms for our debugging method and two heuristic strategies for the algorithms. We obtain promising results using a prototype for a subset of OCaml. We explore a novel avenue for debugging: Transformational debugging and partial evaluation as helpful debugging tools.
Authors
- Kanae Tsushima (ORCID: https://orcid.org/0000-0002-3383-3389)
- Robert Glück (ORCID: https://orcid.org/0000-0001-6990-3935)
Institutions
- University of Copenhagen (DK)
- Research Organization of Information and Systems (JP)
Publication Details
- Published
- 2024-10-07
- DOI
- https://doi.org/10.1109/scam63643.2024.00033
- Primary Topic
- Logic, programming, and type systems
- Type
- article
- Field-Weighted Citation Impact
- 0.00