From marcos@mind.pt  Tue May 16 11:27:57 2000
Received: from internet02.ip.pt ([195.23.2.8])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id LAA27521;
	Tue, 16 May 2000 11:27:54 +0200 (MET DST)
Received: from oleber (ugly.inesc.pt [146.193.32.39]) by internet02.ip.pt with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2448.0)
	id 2LHZJWMW; Tue, 16 May 2000 10:50:44 +0100
From: "Marcos Rebelo" <marcos@mind.pt>
To: "SWI-PROLOG" <prolog@swi.psy.uva.nl>,
        "Jan Wielemaker" <jan@swi.psy.uva.nl>
Subject: RE: Need help in a not unifyable
Date: Tue, 16 May 2000 10:33:18 +0100
Message-ID: <GIEMIPFOLGGDMLHGKOOMGEEICCAA.marcos@mind.pt>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
In-Reply-To: <00051610581602.00382@gollem>

So what precedence to use in this case.

I forget that matter so thacks Jan Wielemaker

MArcos

-----Original Message-----
From: Jan Wielemaker [mailto:jan@swi.psy.uva.nl]
Sent: Tuesday, May 16, 2000 9:53 AM
To: Marcos Rebelo; prolog@swi.psy.uva.nl
Subject: Re: Need help in a not unifyable


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

