🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #1969

Re: uniqueness test

#1969
From: Johan Montelius
Date: Thu, 28 Mar 1991 08:12
23 lines
988 bytes
>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
Technical Details
Message-ID: <1991Mar28.081219.8693@sics.se>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!uupsi!sunic!sics.se!sics.se!jm
References: <1538@ipsi.UUCP> <1504@quintus.UUCP>

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