Skip to main content

Loop detection in propositional Prolog programs

  • Conference paper
  • First Online:
CSL '88 (CSL 1988)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 385))

Included in the following conference series:

  • 157 Accesses

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

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. E. Börger: Berechenbarkeit, Komplexität, Logik, Vieweg-Verlag, Braunschweig 1985

    Google Scholar 

  2. E. Börger: Logic as machine: Complexity relations between programs and formulae. Technical Report 213 (1985), Universität Dortmund, Abteilung Informatik

    Google Scholar 

  3. W. F. Clocksin, C. S. Mellish: Programming in Prolog, Springer-Verlag, Berlin 1984

    Google Scholar 

  4. S. A. Cook: The Complexity of Theorem-proving Procedures, Proc. Third ACM Symp. on Theory of Computing (1971), pp. 151–158

    Google Scholar 

  5. H. Kleine Büning, U. Löwen, S. Schmitgen: Inconsistency of Production Systems, to appear in Data & Knowledge Engineering, North-Holland, Amsterdam

    Google Scholar 

  6. H. Kleine Büning, U. Löwen, S. Schmitgen: Equivalence of Propositional Logic Programs, to appear in Journal of Automated Reasoning

    Google Scholar 

  7. R. Kowalski: Predicate Logic as Programming Language, Information Processing 74, J. Rosenfeld (ed.), North-Holland, Amsterdam 1974, pp. 556–574

    Google Scholar 

  8. N. J. Nilsson: Principles of Artificial Intelligence, Springer-Verlag, Berlin 1982

    Google Scholar 

  9. T. J. Schaefer: The Complexity of Satisfiability Problems, Proc. 10th ACM Symp. on Thoery of Computing (1978), pp. 216–226

    Google Scholar 

  10. J. R. Shoenfield: Mathematical Logic, Addison-Wesley, London 1967

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Egon Börger Hans Kleine Büning Michael M. Richter

Rights and permissions

Reprints 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

Publish with us

Policies and ethics