Ok. That's my problem. I need to implement a predicate that sums up all the prices of the products in the list. But, for now, I'm not getting any further with it. What am I doing wrong? Thanks in advance.
domains
state = reduced ; normal
database
producte (string, integer, state)
predicates
nondeterm calculate(integer)
clauses
% ---> producte( description , price , state )
producte("Enciam",2,normal).
producte("Llet",1,reduced).
producte("Formatge",5,normal).
calculate(Import):-
producte(_,Import,_).
calculate(Import):-
producte(_,Import,_),
calculate(Import2),
Import=Import2+Import,!.
Goal
calculate(I).