Path: utzoo!attcan!uunet!munnari!munnari.oz!lee From: lee@munnari.oz (Lee Naish) Newsgroups: comp.lang.prolog Subject: Re: bagof/setof Message-ID: <2362@munnari.oz> Date: 14 Sep 88 00:41:17 GMT References: <1436@kulcs.kulcs.uucp> Sender: news@munnari.oz Reply-To: lee@munmurra.UUCP (Lee Naish) Organization: University of Melbourne, Comp Sci Dept Lines: 27 In article <1436@kulcs.kulcs.uucp> bimbart@kulcs.UUCP (Bart Demoen) writes: > p(1,a) . > p(_,b) . > p(2,c) . > ?- setof(Y,p(X,Y),L) . > > SICSTUSprolog: > X = 1 , L = [a,b] > X = 2 , L = [b,c] "Logically", there are three answers (the last one containing two constraints on X): X = 1 , L = [a,b]; X = 2 , L = [b,c]; X ~= 1, X ~= 2, L = [b]. Therefore, I think Sicstus gives the most "logical" set of solutions. In other, less complex cases, setof generally returns what a logical all solutions predicate returns except for answers which must contain constraints. It seems that Sicstus is more consistent than other systems. Does anyone know if it is completely consistent? Perhaps there is another "logical" way of explaining the behaviour of other systrems. (NU-Prolog setof behaves the same as C-Prolog, and we hope most Edinburgh systems, for compatability). lee lee