Abstract
We are interested in loop detection in knowledge based systems because loops are one of the problems when formalizing knowledge. Since rule-based systems are widely used and backward chaining in rule-based systems and the Prolog inference-strategy for logic programs can be compared, we consider loop detection in propositional Prolog-programs.
First we present an algorithm which decides for a given Prolog-program π and a query γ, whether the answer is yes, no or loop. We prove that this algorithm needs linear time in the length of π∧γ. This is possible by setting a flag for each atom occuring in π, which reflects the actual state of this atom during the refutation. We show that the algortihm can be extended to Prolog-programs πc with cut.
Further we show that the problem to decide, whether there exists a query for a given Prolog-program (including cut) which leads to a looping derivation, is NP-complete.
Allowing assert and retract in a propositional Prolog-program we show that the loop-problem is undecidable. In this case it is even undecidable whether we obtain a looping refutation for a given question γ and a Prolog-program πar.
The work of this author was supported by the Studienstiftung des deutschen Volkes
Preview
Unable to display preview. Download preview PDF.
References
E. Börger: Berechenbarkeit, Komplexität, Logik, Vieweg-Verlag, Braunschweig 1985
E. Börger: Logic as machine: Complexity relations between programs and formulae. Technical Report 213 (1985), Universität Dortmund, Abteilung Informatik
W. F. Clocksin, C. S. Mellish: Programming in Prolog, Springer-Verlag, Berlin 1984
S. A. Cook: The Complexity of Theorem-proving Procedures, Proc. Third ACM Symp. on Theory of Computing (1971), pp. 151–158
H. Kleine Büning, U. Löwen, S. Schmitgen: Inconsistency of Production Systems, to appear in Data & Knowledge Engineering, North-Holland, Amsterdam
H. Kleine Büning, U. Löwen, S. Schmitgen: Equivalence of Propositional Logic Programs, to appear in Journal of Automated Reasoning
R. Kowalski: Predicate Logic as Programming Language, Information Processing 74, J. Rosenfeld (ed.), North-Holland, Amsterdam 1974, pp. 556–574
N. J. Nilsson: Principles of Artificial Intelligence, Springer-Verlag, Berlin 1982
T. J. Schaefer: The Complexity of Satisfiability Problems, Proc. 10th ACM Symp. on Thoery of Computing (1978), pp. 216–226
J. R. Shoenfield: Mathematical Logic, Addison-Wesley, London 1967
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1989 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Büning, H.K., Löwen, U., Schmitgen, S. (1989). Loop detection in propositional Prolog programs. In: Börger, E., Büning, H.K., Richter, M.M. (eds) CSL '88. CSL 1988. Lecture Notes in Computer Science, vol 385. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0026300
Download citation
DOI: https://doi.org/10.1007/BFb0026300
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-51659-0
Online ISBN: 978-3-540-46736-6
eBook Packages: Springer Book Archive