Skip to main content
Log in

The occur-check problem in Prolog

  • Special Issue
  • Published:
New Generation Computing Aims and scope Submit manuscript

Abstract

We present a method for preprocessing Prolog programs so that their operational semantics will be given by the first-order predicate calculus. Most Prolog implementations do not use a full unification algorithm, for efficiency reasons. The result is that it is possible to create terms having loops in them, whose semantics is not adequately described by first-order logic. Our method finds places where such loops may be created, and adds tests to detect them. This should not appreciably slow down the execution of most Prolog programs.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Clocksin, W. and Mellish, C.: Programming in PROLOG (Springer-Verlag, Berlin) (1981).

    MATH  Google Scholar 

  2. Colmerauer, A.: “PROLOG and infinite trees,” in Logic Programming, Clark and Tärnlund (eds.) (Academic Press) (1982).

  3. Reingold, E., Nievergelt, J. and Deo, N.: Combinatorial Algorithms: Theory and Practice, (Prentice-Hall, New Jersey) (1977).

    Google Scholar 

  4. Robinson, J.: “A machine oriented logic based on the resolution principle,” J. ACM,12 (1965) 23–41.

    Article  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Additional information

Copyright © 1984 IEEE. Reprinted, with permission, from 1984 International Symposium On Logic Programming, February 6–9, 1984, Atlantic City, NJ, pp. 272–280.

This work was partially supported by the National Science Foundation under grants MCS 81-09831 and MCS 83-07755.

About this article

Cite this article

Plaisted, D.A. The occur-check problem in Prolog. New Gener Comput 2, 309–322 (1984). https://doi.org/10.1007/BF03037324

Download citation

  • Received:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF03037324

Keywords

Navigation