[eclipse-clp-users] Delayed Goals

From: Ulisses Dias <udias_at_...148...>
Date: Tue, 14 Oct 2008 16:38:27 -0200
Hi,
   I will explain my doubt using an example. I have the following rule to
split a list. The first splitted list has the size N.

split(L,0,[],L).
split([X|Xs],N,[X|Ys],Zs) :- N $> 0, N1 $= N - 1, split(Xs,N1,Ys,Zs).

In Eclipse I can use it:

?- split([1, 2, 3, 4], 2, X1, X2).
X1 = [1, 2]
X2 = [3, 4, 5, 6]
Yes (0.00s cpu, solution 1, maybe more)

That is ok, but when I dont instantiate the size N, the Eclipse answers:

N = 0
X1 = []
X2 = [1, 2, 3, 4, 5, 6]
Yes (0.00s cpu, solution 1, maybe more)
N = 1
X1 = [1]
X2 = [2, 3, 4, 5, 6]
Yes (0.02s cpu, solution 2, maybe more)

... and goes on.

But I dont want this answer, I want eclipse to create delayed goals and wait
for new constraints. There is something I'm doing wrong?

Thank you in advance
Received on Tue Oct 14 2008 - 18:38:47 CEST

This archive was generated by hypermail 2.3.0 : Wed Sep 25 2024 - 15:13:20 CEST