Subject: [SWIPL] possible combinations of the sum.

From: "cjcheng" <[email-masked]>
Date: Thu, 14 Jun 2001 00:27:34 +1200

I am a novice of Prolog programming. I hope to write a predicate,which for a given integer N, can generate a list of lists,with each list can be summed up to N.
e.g. sum(5,X)=>X=[[5],[1,4],[2,3],[1,1,3],[1,2,2],[1,1,1,2],[1,1,1,1,1]].
I already wrote one ,but if N>9, it will be really slow.