🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #3656

bagof/setof

#3656
From: Bart Demoen
Date: Mon, 12 Sep 1988 12:45
51 lines
1331 bytes
In article <MATSC.88Sep7095859@skarabe.sics.se> 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 ?
Technical Details
Message-ID: <1436@kulcs.kulcs.uucp>
Path: arc1-ca.pugleaf.net!utzoo!yunexus!geac!syntron!jtsv16!uunet!mcvax!prlb2!kulcs!bimbart

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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