🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #817

Re: Does It Unify?

#817
From: Bradley L. Richards
Date: Tue, 08 May 1990 19:32
17 lines
1140 bytes
In article <1990May7.132305.15989@agate.berkeley.edu> c60c-2ca@WEB.berkeley.edu (Andrew Choi) writes:
>Assume I have the following predicate defined:
>equal(X, X).
>Does the following unify?
>?-  equal(foo(Y), Y).
>
>On my Prolog interpreter, it unifies but gives very strange
>instantiation for Y.  What should the "correct" answer be?

According to the proper definition for unification, these terms should
not unify.  However, for "efficiency" reasons, most Prolog implementations
omit the "occurs" check (i.e. here Y appears in foo(Y)), and blindly
unify these terms.  This is, in fact, an error--and one worth fussing
at the manufacturer of your Prolog about.  Implementing the occurs
check isn't really that costly....

Bradley
Technical Details
Message-ID: <189@qt.cs.utexas.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!bradley
References: <1990May7.132305.15989@agate.berkeley.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!bradley
From: bradley@cs.utexas.edu (Bradley L. Richards)
Newsgroups: comp.lang.prolog
Subject: Re: Does It Unify?
Message-ID: <189@qt.cs.utexas.edu>
Date: 8 May 90 19:32:03 GMT
References: <1990May7.132305.15989@agate.berkeley.edu>
Distribution: usa
Organization: U. Texas CS Dept., Austin, Texas
Lines: 17