Algorithmic debugging for imperative languages with side-effects

  • Nahid Shahmehri
  • Peter Fritzson
Part of the Lecture Notes in Computer Science book series (LNCS, volume 477)


Algorithmic debugging is a technique for semi-automatic localization of program errors. So far, this technique has been limited to programs without side-effects, and has only been applied to Prolog programs. In this paper, we generalize the algorithmic debugging method to programs written in imperative languages, e.g. Pascal, which may contain side-effects.

Our method combines program transformation techniques with data flow analysis techniques to achieve this goal. Programs which contain side-effects are transformed or mapped to programs without side-effects. These transformations are guided by data flow analysis results. The conventional procedure level algorithmic debugging technique is used on the transformed or mapped program, but the debugging process is presented to the user in terms of the original program. The model can be extended to statement level debugging. A prototype for a subset of Pascal has been implemented. A larger prototype including transformations is being implemented within the DICE system — a programming environment based on incremental compilation. Currently we restrict ourselves to bug localization for terminating programs. Also, side-effects related to pointers are currently not considered.


  1. [Drabent, et al-88]
    Drabent W., Nadjm-Tehrani S. and Maluszynski J., The Use of Assertions in Algorithmic Debugging. Proceeding of the FGCS Conference, Tokyo. 1988, pp.573–581.Google Scholar
  2. [Fritzson-83]
    Fritzson P., Symbolic Debugging Through Incremental Compilation in an Integrated Environment. The Journal of Systems and Software 3, 1983, pp.285–294.Google Scholar
  3. [Kamkar, et al-90]
    Kamkar M., Shahmehri N. and Fritzson P., Bug Localization by Algorithmic Debugging and Program Slicing. Proceeding of the PLILP'90, Linköping, Sweden. LNCS, Vol 456, pp.60–74.Google Scholar
  4. [Shahmehri, Fritzson-89]
    Shahmehri N., Fritzson P., Algorithmic debugging for Imperative Languages with Side-effects, Research Report LiTH-IDA-R-89-49, Linköping University, Sweden, 1989.Google Scholar
  5. [Shapiro-83]
    Shapiro E. Y., Algorithmic Program Debugging. MIT press, 1983.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1991

Authors and Affiliations

  • Nahid Shahmehri
    • 1
  • Peter Fritzson
    • 1
  1. 1.Dept. of Comp. & Info. ScienceLinköping UniversityLinköpingSweden

Personalised recommendations