From jan@swi.psy.uva.nl  Tue May 16 10:57:58 2000
Received: from gollem.swi.psy.uva.nl (root@gollem [145.18.152.30])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id KAA24387;
	Tue, 16 May 2000 10:57:58 +0200 (MET DST)
Received: from localhost (localhost [[UNIX: localhost]])
	by gollem.swi.psy.uva.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id KAA00463;
	Tue, 16 May 2000 10:58:16 +0200
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Organization: SWI, University of Amsterdam
To: "Marcos Rebelo" <marcos@mind.pt>, <prolog@swi.psy.uva.nl>
Subject: Re: Need help in a not unifyable
Date: Tue, 16 May 2000 10:52:34 +0200
X-Mailer: KMail [version 1.0.28]
Content-Type: text/plain
References: <GIEMIPFOLGGDMLHGKOOMIEEGCCAA.marcos@mind.pt>
In-Reply-To: <GIEMIPFOLGGDMLHGKOOMIEEGCCAA.marcos@mind.pt>
MIME-Version: 1.0
Message-Id: <00051610581602.00382@gollem>
Content-Transfer-Encoding: 8bit

On Tue, 16 May 2000, Marcos Rebelo wrote:
>This is part of a code that I´m doing, when i try check(A,B) prolog gives
>no answer, the problem must be in the \== but I have alredy tried \=@=, \=,
>=\= and none worked.
>
>For example if I try to do "c \== _ cf _" gives NO but "c == _ cf _" also
>gives no. What is the problem here?
>
>:-op(950, xfx, cf).
>:-op(900, xfx, =>).

Operator precedence:

1 ?- op(950, xfx, cf).

Yes
2 ?- c \== _ cf _.
ERROR: Undefined procedure: (cf)/2

I.e. the precedence of cf > precedence of \== and therefore the
term is read as (c\==_) cf _.

Always think twice when defining new operators: should they be
used in conjunction with built-in's?  Are they likely to break
other code?

As of 3.3, operators are local to a module (unless defined in
the user module), so my advice is to use modules if you use
local operators to avoid messing up other code.

	Regards

		--- Jan

