Abstract
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.
UUCP...{mcvax,inria}!inesc!un!mc Bix: mcalejo Applelink:IT0083
This is a preview of subscription content, log in via an institution.
Preview
Unable to display preview. Download preview PDF.
References
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.
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.
W. Drabent, S. Nadjm-Tehrani and J. Maluszynski, Algorithmic Debugging with Assertions, in META88 Proceedings, MIT Press 1988.
Marc Eisenstadt and Mike Brayshaw, The Transparent Prolog Machine: an execution model and graphical debugger for logic programming, in Journal of Logic Programming, 1988.
Yossi Lichtenstein and Ehud Shapiro, Abstract Program Debugging, Procs. 5th Int. Conf. on Logic Programming, MIT Press 1988.
Prolog and Natural-Language Analysis, Lecture Notes, Number 10, Center for the Study of Language and Information, 1987.
Fernando Pereira et al, C-Prolog User's Manual, EdCAAD, Dept. of Architecture, University of Edinburgh, UK, 1983.
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.
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.
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.
Luís Moniz Pereira and Miguel Calejo, A framework for Prolog debugging, Procs. 5th Int. Conf. on Logic Programming, MIT Press 1988.
Luís Moniz Pereira and Miguel Calejo, How to access Prolog execution trees and its use in debugging, UNL/DI report, 1989.
Luís Moniz Pereira and Miguel Calejo, The HyperTracer Manual, UNL/DI report (forthcoming).
Ehud Y. Shapiro, Algorithmic Program Debugging, MIT Press 1982.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1989 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Pereira, L.M., Calejo, M. (1989). Algorithmic debugging of prolog side-effects. In: Martins, J.P., Morgado, E.M. (eds) EPIA 89. EPIA 1989. Lecture Notes in Computer Science, vol 390. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-51665-4_82
Download citation
DOI: https://doi.org/10.1007/3-540-51665-4_82
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-51665-1
Online ISBN: 978-3-540-46743-4
eBook Packages: Springer Book Archive