From lains@caramail.com  Thu May 11 14:35:55 2000
Received: from mail.caramail.com (mail.caramail.com [195.68.99.70])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id OAA20422
	for <prolog@swi.psy.uva.nl>; Thu, 11 May 2000 14:35:55 +0200 (MET DST)
Received: from caramail.com (filesrv2.caramail.com [195.68.99.57])
	by mail.caramail.com (8.8.8/8.8.8) with SMTP id OAA19928
	for prolog@swi.psy.uva.nl; Thu, 11 May 2000 14:40:07 +0100 (WET DST)
Posted-Date: Thu, 11 May 2000 14:40:07 +0100 (WET DST)
From: Lionel Ains <lains@caramail.com>
To: prolog@swi.psy.uva.nl
Message-ID: <958044921023797@caramail.com>
X-Mailer: Caramail - www.caramail.com
X-Originating-IP: [194.202.131.4]
Mime-Version: 1.0
Subject: Re: operators
Date: Thu, 11 May 2000 14:25:03 GMT+1
Content-Type: multipart/mixed; boundary="=_NextPart_Caramail_023797958044921_ID"

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

--=_NextPart_Caramail_023797958044921_ID
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

> -------Message d'origine-------
> De : "Politini, Cohen" <CPolitini@colonial.com.au>
> Date : 11/05/100 04:58:20
> 
> I want to declare an operator 'c', so I wrote
> 
> :-op(1000,yfx,c).
> 
> Then now I want to say that the 'c' in NcR represents 
something like
> 
> operator c =3d ((N+N) - R)*R.
> 
> Cansomeone help me ??

Then you should add to your program:

:- arithmetic_function(c/2).
c(N, R, Result):-
  Result is (((N + N) - R) * R).

(see chapter 3.28 of the SWI-Prolog manual for details).

And the ?- X is (10 c 45).
Should be interpreted correctly.
Note: ?- X is (10c45) won't work because Prolog will then 
read 10c45 as one atom.

Lionel

______________________________________________________
Bo=eete aux lettres - Caramail - http://www.caramail.com


--=_NextPart_Caramail_023797958044921_ID--

