From lains@caramail.com  Thu May 11 13:11:08 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 NAA16108
	for <prolog@swi.psy.uva.nl>; Thu, 11 May 2000 13:11:08 +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 NAA03957
	for prolog@swi.psy.uva.nl; Thu, 11 May 2000 13:15:20 +0100 (WET DST)
Posted-Date: Thu, 11 May 2000 13:15:20 +0100 (WET DST)
From: Lionel Ains <lains@caramail.com>
To: prolog@swi.psy.uva.nl
Message-ID: <958041524007091@caramail.com>
X-Mailer: Caramail - www.caramail.com
X-Originating-IP: [194.202.131.4]
Mime-Version: 1.0
Subject: Re: QUESTION ON PRECEDENCE
Date: Thu, 11 May 2000 12:59:47 GMT+1
Content-Type: multipart/mixed; boundary="=_NextPart_Caramail_007091958041524_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_007091958041524_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 00:13:48
> 
> Can someone please help me with this. Say I want to allow 
 "+" to be done
> first before " * " in the equation :
> 
> X is  A + B*C.
> 
The best way to do it would be

?- op(550, yfx, *).

Then you will have the following result:

?- X is 10+5*2.

X =3d 30

Yes

You have a description of the operator default 
precedences in the SWI-Prolog manual (Appendix B.3).
Be careful because this will change the way Prolog 
interprets all you calculations!

Lionel



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


--=_NextPart_Caramail_007091958041524_ID--

