[eclipse-clp-users] findall - procedure clauses are not consecutive

From: Joris Van den Broeck <joris6_at_...6...>
Date: Sat, 16 Jul 2011 19:38:36 +0200
Hi,

I have a few generated class/3 predicates and I want to findall values that
these predicates return (eg. with findall(Value, class([Value], _, white),
Values).)

So with this findall-query and the code I would expect a List = [100.0,
 85.7142,  64.7058,  25.0, 100, .. ]



*class*([*100.0*],S,white)                    :-
ggp_true(cellholds(4,3,A),S),ggp_true(cellholds(5,7,B),S),ggp_true(cellholds(5,1,A),S),ggp_true(cellholds(C,4,D),S),!.
*class*([*85.7142857142857*],S,white) :-
ggp_true(cellholds(4,3,A),S),ggp_true(cellholds(5,7,B),S),ggp_true(cellholds(5,1,A),S),!.
*class*([*64.7058823529412*],S,white) :-
ggp_true(cellholds(4,3,A),S),ggp_true(cellholds(5,7,B),S),!.
*class*([*25.0*],S,white)                      :-
ggp_true(cellholds(4,3,A),S),!.
*class*([*100.0*],S,white).


*class*([*63.3333333333333*],S,white)  :- ggp_true(cellholds(4,6,A),S),!.
*class*([*38.0952380952381*],S,white) :- ggp_true(cellholds(7,6,A),S),!.
*class*([*0.0*],S,white)                        :-
ggp_true(cellempty(A,1),S),!.
*class*([*13.6363636363636*],S,white).

...



But I just get the result;

?- findall(_76, class([_76], _93, white), _97).
          Value = _76
          Values = [100.0]
          Yes (0.48s cpu)

And when I compile the code I receive a few *"procedure clauses are not
consecutive: class / 3"*

Does anyone know if there is a way to achieve the behavior I want and return
a list of all the values?

Best Regards,
Joris
Received on Sat Jul 16 2011 - 17:39:22 CEST

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