Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uupsi!sunic!sics.se!sics.se!jm From: jm@sics.se (Johan Montelius) Newsgroups: comp.lang.prolog Subject: Re: uniqueness test Message-ID: <1991Mar28.081219.8693@sics.se> Date: 28 Mar 91 08:12:19 GMT References: <1538@ipsi.UUCP> <1504@quintus.UUCP> Sender: news@sics.se Organization: Swedish Institute of Computer Science, Kista Lines: 23 In-Reply-To: tom@quintus.UUCP's message of 27 Mar 91 04: 23:33 GMT >wouldn't this do it? >unique(X,G):-findall(X,G,L),sort(L,[X]). Does it work in Quintus? Try findall(X,member(X,[1,2,3|_]),L) and try to sort L. It does not work in SICStus. It does however work in AKL. unique(L,Goal):- bagof(L1,Goal), filter(L1,L). | ?- unique([A],X\member(X,[1,2,3|_])). no | ?- **** AKL**** Soon at a theatre near you. -- Johan Montelius SICS, PO Box 1263, S-164 28 Kista, Sweden. Phone: +46 8 752 15 68 Telefax: +46 8 751 72 30 Internet: jm@sics.se