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.
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.References
Clocksin, W. and Mellish, C.: Programming in PROLOG (Springer-Verlag, Berlin) (1981).
Colmerauer, A.: “PROLOG and infinite trees,” in Logic Programming, Clark and Tärnlund (eds.) (Academic Press) (1982).
Reingold, E., Nievergelt, J. and Deo, N.: Combinatorial Algorithms: Theory and Practice, (Prentice-Hall, New Jersey) (1977).
Robinson, J.: “A machine oriented logic based on the resolution principle,” J. ACM,12 (1965) 23–41.
Author information
Authors and Affiliations
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
Received:
Issue Date:
DOI: https://doi.org/10.1007/BF03037324