Why the occur-check is not a problem

  • Krzysztof R. Apt
  • Alessandro Pellegrini
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 631)


In most Prolog implementations for the efficiency reasons so-called occur-check is omitted from the unification algorithm. We provide here natural syntactic conditions which allow the occur-check to be safely omitted. The established results apply to most well-known Prolog programs and seem to explain why this omission does not lead in practice to any complications.


Logic Program Logic Programming Unification Algorithm Relation Symbol Output Position 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [Apt90]
    K. R. Apt. Logic programming. In J. van Leeuwen, editor, Handbook of Theoretical Computer Science, pages 493–574. Elsevier, 1990. Vol. B.Google Scholar
  2. [CP91]
    R. Chadha and D.A. Plaisted. Correctness of unification without occur check in Prolog. Technical report, Department of Computer Science, University of North Carolina, Chapel Hill, N.C., 1991.Google Scholar
  3. [DFT91]
    P. Deransart, G. Ferrand, and M. Téguia. NSTO programs (not subject to occur-check). In V. Saraswat and K. Ueda, editors, Proceedings of the International Logic Symposium, pages 533–547. The MIT Press, 1991.Google Scholar
  4. [DM85a]
    P. Dembinski and J. Maluszynski. AND-parallelism with intelligent backtracking for annotated logic programs. In Proceedings of the International Symposium on Logic Programming, pages 29–38, Boston, 1985.Google Scholar
  5. [DM85b]
    P. Deransart and J. Maluszynski. Relating Logic Programs and Attribute Grammars. Journal of Logic Programming, 2:119–156, 1985.Google Scholar
  6. [Dra87]
    W. Drabent. Do Logic Programs Resemble Programs in Conventional Languages? In International Symposium on Logic Programming, pages 389–396. San Francisco, IEEE Computer Society, August 1987.Google Scholar
  7. [Llo87]
    J. W. Lloyd. Foundations of Logic Programming. Springer-Verlag, Berlin, second edition, 1987.Google Scholar
  8. [LMM88]
    J.-L. Lassez, M. J. Maher, and K. Marriott. Unification Revisited. In J. Minker, editor, Foundations of Deductive Databases and Logic Programming, pages 587–625. Morgan Kaufmann, Los Altos, Ca., 1988.Google Scholar
  9. [MM82]
    A. Martelli and U. Montanari. An efficient unification algorithm. ACM Transactions on Programming Languages and Systems, 4:258–282, 1982.Google Scholar
  10. [Pel92]
    A. Pellegrini. Sul problema dell' ”occur check” in Prolog. Technical report, Department of Computer Science, University of Padova, Padova, Italy, 1992. Tesi di Laurea, in Italian, to appear.Google Scholar
  11. [Pla84]
    D.A. Plaisted. The occur-check problem in Prolog. In Proc. International Conference on Logic Programming, pages 272–280. IEEE Computer Science Press, 1984.Google Scholar
  12. [Ros91]
    D.A. Rosenblueth. Using program transformation to obtain methods for eliminating backtracking in fixed-mode logic programs. Technical Report 7, Universidad Nacional Autonoma de Mexico, Institute de Investigaciones en Matematicas Aplicadas y en Sistemas, 1991.Google Scholar
  13. [SS86]
    L. Sterling and E. Shapiro. The Art of Prolog. MIT Press, 1986.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1992

Authors and Affiliations

  • Krzysztof R. Apt
    • 1
    • 2
  • Alessandro Pellegrini
    • 3
  1. 1.Centre for Mathematics and Computer ScienceAmsterdamThe Netherlands
  2. 2.Faculty of Mathematics and Computer ScienceUniversity of AmsterdamAmsterdamThe Netherlands
  3. 3.Dipartimento di Matematica Pura ed Applicata Università di PadovaPadovaItaly

Personalised recommendations