Compile time optimization of goals

From: Andrew John Sadler <ajs2_at_icparc.ic.ac.uk>
Date: Fri 05 Oct 2001 09:04:49 AM GMT
Message-Id: <E15pQuX-0000Ho-00@ilford.icparc.ic.ac.uk>
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?

Andrew
Received on Fri Oct 05 10:04:50 2001

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