Re: Compile time optimization of goals

From: Warwick Harvey <wh_at_icparc.ic.ac.uk>
Date: Fri 05 Oct 2001 09:14:58 AM GMT
Message-ID: <20011005101458.B20923@tempest.icparc.ic.ac.uk>
On Fri, Oct 05, 2001 at 10:04:49AM +0100, Andrew John Sadler wrote:
> The following code produces a choice point when calling foo(_,0).
> 
> foo(A,0):-
> 	( var(A) -> true ; true ).
> foo(A,3):-
> 	true.
> 
> 
> 
> where as
> 
> 
> foo(A,0):-
>         true,
> 	( var(A) -> true ; true ).
> foo(A,3):-
> 	true.
> 
> 
> Correctly infers that the first clause is the only matching clause. (Note the supurflous 'true' in first clause)
> 
> Any ideas?

Looks like a standard compiler optimisation bug (there's a reason why "Does
adding a true fix the problem?" is a frequent question in response to a
report of strange behaviour).  Solution: keep the true and wait for the new
compiler.

Cheers,
Warwick
Received on Fri Oct 05 10:14:58 2001

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:08:10 PM GMT GMT