Subject: [SWIPL] sumlist to arithmetic function

From: Hans-Ulrich Zimmermann <[email-masked]>
Date: Tue, 21 Aug 2001 11:25:33 +0200

Hi,
converting the old sumlist predicate to an arithmetic function
will not work:

:-arithmetic_function(sumlist/1).

sumlist([],0).
sumlist([Kopf|Rumpf], Summe) :- sumlist(Rumpf,Teilsumme), 
                                Summe is Kopf + Teilsumme.

Is there any solution?

H.-Ulrich
------------------------------------
mailto:[email-masked] 
http://www.h-u-zimmermann.de