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).
@@	summands_n_sum(A, 6, B) :-
@@		summands_n_sum1(A, B).
@@
@@	% summands_n_sum1(A,B):-summands_n_sum(A,6,B)
@@	summands_n_sum1([B,C,D,E,F,G], A) :-
@@		sum(B, H, A),
@@		sum(C, I, H),
@@		sum(D, J, I),
@@		sum(E, K, J),
@@		sum(F, L, K),
@@		sum(G, M, L),
@@		M=0.
-----         n599 ------------------------
Similar to how answer substitutions are inserted, the spezialzed program is inserted. To use this (hopefully) more efficient version the @@-lines must be removed.

Receiving an answer immediately is the major point of the integration of Mixtus into GUPU.
**NEXT:An example of overspecialization.
**NEXT:Skip to the next part I/O.


[logprog|GUPU|UWN]