From jan@swi.psy.uva.nl Mon Jul 16 21:01:17 2001
Received: from gollem.swi.psy.uva.nl (root@gollem [145.18.152.30])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f6GJ1HX21485;
	Mon, 16 Jul 2001 21:01:17 +0200 (MET DST)
Received: (from jan@localhost)
	by gollem.swi.psy.uva.nl (8.11.2/8.11.2/SuSE Linux 8.11.1-0.5) id f6GJ1HH08980;
	Mon, 16 Jul 2001 21:01:17 +0200
Date: Mon, 16 Jul 2001 21:01:17 +0200
Message-Id: <200107161901.f6GJ1HH08980@gollem.swi.psy.uva.nl>
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Subject: Re: [SWIPL] arithmetic_function
To: Emerson =?iso-8859-1?Q?Lu=EDs?= dos Santos <emerson@ppgia.pucpr.br>,
   prolog@swi.psy.uva.nl
In-Reply-To: Emerson =?iso-8859-1?Q?Lu=EDs?= dos Santos's message of Mon, 16 Jul 2001 14:53:53 -030Phone: +31 - 20 - 525 6121

> I got a similar error when using arithmetic functions:
> 
> ? - X is some_function(2).
> X = 8
> 
> ? - 5 < some_function(2).
> ERROR: Arithmetic: `some_function/1' is not a function
> 
> Could somebody tell me why?

Yip.  It is a bug.  Just patched it in the CVS version (get
pl/src/pl-ext.c for the patch).  Basically, >, <, etc. are
not meta-predicates as is/2, making them search for the
registered arithmetic function in the system module.

As a work around you can use:

:- arithmetic_function(system:some_function/1).

system:some_function(X, Y) :-
	Y is 4*X.

	Thanks --- Jan

