Path: utzoo!yunexus!geac!syntron!jtsv16!uunet!mcvax!prlb2!kulcs!bimbart From: bimbart@kulcs.uucp (Bart Demoen) Newsgroups: comp.lang.prolog Subject: bagof/setof Message-ID: <1436@kulcs.kulcs.uucp> Date: 12 Sep 88 12:45:32 GMT Article-I.D.: kulcs.1436 Reply-To: bimbart@kulcs.UUCP (Bart Demoen) Organization: Katholieke Universiteit Leuven, Dept. Computer Science Lines: 51 In article Mats Carlson argues for another behavior of bagof/setof I am very glad with it: BIMprolog has always implemented bagof/setof with the behavior Mats proposes (*) and I think it is very reasonable - although slowing down some benchmarks I still have a question: database: p(1,a) . p(_,b) . p(2,c) . query: ?- setof(Y,p(X,Y),L) . answers: SICSTUSprolog: X = 1 , L = [a,b] X = 2 , L = [b,c] BIMprolog: X = 1 , L = [a] X = _0 , L = [b] X = 2 , L = [c] CProlog: X = 1 , L = [a,b] X = 2 , L = [c] my question is: which is more reasonable and/or useful and/or satisfying ? (*) BIMprolog gives the answers in the order X = _49, L = [a,b] ; X = f(_141), L = [a,b] ; X = f(_165,_141), L = [a,b] ; X = f(_141,_141), L = [a,b] ; (i.e. the last 2 solutions in a different order) Mats, was that a misprint in your mail ?