summands_sum([], 0). summands_sum([I|Is], S1) :- sum(I, S2, S1), summands_sum(Is, S2). summands_n_sum(Is,N,S) :- length(Is,N), summands_sum(Is, S). :- pe summands_n_sum(Is, 6, S). --**- 99.Bsp. n599 ------------------------By adding the prefix operator
pe
we state that a goal should be evaluated partially.