Algorithmic debugging of prolog side-effects
Prolog side-effects are typical necessary evil. Convenient logic program properties no longer hold, and upsetting practical problems sprout, namely the debugging of programs with side-effects is harder. This paper attempts to reduce the magnitude of such problems, by formulating a framework for the algorithmic debugging of logic programs with side-effects, encompassing both input/output (I/O) and internal database (DB) ones. Our debugging framework [Pereira Calejo 88] is reviewed and extended for that purpose. The new methods extend the scope and differ, significantly, from those developed in the context of [Pereira 84 86].
In what refers DB side-effects, we extend our suspect sets to include additional suspects: those contained in the partial derivations leading to ‘assert’ and ‘retract’ calls. For I/O we define an additional type of bug related to the I/O side-effect notion of segment (or trace) of a goal, and introduce a corresponding additional type of suspect set. This approach allows us to apply the same diagnosis algorithms already developed for programs without side-effects. We make some reasonable assumptions in either case, so as to render the implementation amenable and to avoid extorting excessive information from the user.
These extensions are being implemented in our HyperTracer debugger [Pereira Calejo 89a, 89b], incurring in tolerable overhead, mostly confined to actual use of the extensions.
Unable to display preview. Download preview PDF.
- [Alegria et al 89]José Alegria, Artur Dias and Luís Caires, Towards Distributed Tools for Heterogeneous Logic Programming Environments, Proceedings of the 6th International Conference on Logic Programming, MIT Press 1989.Google Scholar
- [Bruffaerts Henin 88]Bruffaerts, A. and Henin, E., Proof Trees for Negation as Failure: Yet Another Prolog Meta-Interpreter, in Procs. 5th Int. Conf. on Logic Programming, MIT Press 1988.Google Scholar
- [Drabent et al 88]W. Drabent, S. Nadjm-Tehrani and J. Maluszynski, Algorithmic Debugging with Assertions, in META88 Proceedings, MIT Press 1988.Google Scholar
- [Eisenstadt Brayshaw 88]Marc Eisenstadt and Mike Brayshaw, The Transparent Prolog Machine: an execution model and graphical debugger for logic programming, in Journal of Logic Programming, 1988.Google Scholar
- [Lichtenstein Shapiro 88]Yossi Lichtenstein and Ehud Shapiro, Abstract Program Debugging, Procs. 5th Int. Conf. on Logic Programming, MIT Press 1988.Google Scholar
- [F.Pereira Shieber 87]Prolog and Natural-Language Analysis, Lecture Notes, Number 10, Center for the Study of Language and Information, 1987.Google Scholar
- [F. Pereira et al 83]Fernando Pereira et al, C-Prolog User's Manual, EdCAAD, Dept. of Architecture, University of Edinburgh, UK, 1983.Google Scholar
- [Pereira 84]Luís Moniz Pereira, Rational debugging of logic programs, in Proceedings of the 1st Portuguese AI Meeting, Associação Portuguesa Para a Inteligência Artificial 1985.Google Scholar
- [Pereira 86]Luís Moniz Pereira, Rational debugging in logic programming, in Procs. of the 3rd International Logic Programming Conference, E.Shapiro (ed.), Lecture Notes in Computer Science 225, Springer Verlag 1986.Google Scholar
- [Pereira Calejo 87]Luís Moniz Pereira and Miguel Calejo, “Debugging Errors in Logic Programs”, proceedings of the 3rd Portuguese AI meeting, Associação Portuguesa Para a Inteligência Artificial 1987.Google Scholar
- [Pereira Calejo 88]Luís Moniz Pereira and Miguel Calejo, A framework for Prolog debugging, Procs. 5th Int. Conf. on Logic Programming, MIT Press 1988.Google Scholar
- [Pereira Calejo 89a]Luís Moniz Pereira and Miguel Calejo, How to access Prolog execution trees and its use in debugging, UNL/DI report, 1989.Google Scholar
- [Pereira Calejo 89b]Luís Moniz Pereira and Miguel Calejo, The HyperTracer Manual, UNL/DI report (forthcoming).Google Scholar
- [Shapiro 82]Ehud Y. Shapiro, Algorithmic Program Debugging, MIT Press 1982.Google Scholar