From pnugues@greyc.ismra.fr Wed Mar 21 09:20:16 2001
Received: from greyc.ismra.fr (l2i.greyc.ismra.fr [192.93.101.84])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f2L8KFZ07919
	for <prolog@swi.psy.uva.nl>; Wed, 21 Mar 2001 09:20:15 +0100 (MET)
Received: from penelope (penelope.greyc.ismra.fr [192.93.101.198])
          by greyc.ismra.fr (8.9.3/greyc-1) with SMTP id JAA07466
          ; Wed, 21 Mar 2001 09:20:33 GMT
Message-ID: <000701c0b1df$d62d72e0$c6655dc0@greyc.ismra.fr>
Reply-To: "Pierre Nugues" <pnugues@greyc.ismra.fr>
From: "Pierre Nugues" <pnugues@greyc.ismra.fr>
To: "Michael J Lew" <mlew@cs.ucr.edu>
Cc: <prolog@swi.psy.uva.nl>
References: <Pine.LNX.4.30.0103201345290.19598-100000@hill.cs.ucr.edu>
Subject: Re: [SWIPL] Basic Newby question
Date: Wed, 21 Mar 2001 09:20:47 +0100
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400

Bonjour Michael,

Try this:
people_list(Mood, L) :-
 bagof(People, mood(People, Mood), L).

Pierre
--
Pierre Nugues, Professeur d'informatique (pnugues@greyc.ismra.fr)
ISMRA, 6, bd du Maréchal Juin, F-14050 Caen, France
Tél. (33) 231-452-705 -- Fax. (33) 231-452-760
http://www.ensicaen.ismra.fr/~nugues
----- Message d'origine -----
De : "Michael J Lew" <mlew@cs.ucr.edu>
À : <prolog@swi.psy.uva.nl>
Envoyé : mardi 20 mars 2001 22:46
Objet : [SWIPL] Basic Newby question


> I'm having trouble extracting facts to a list...
> I can't seem to figure out how to for example - extract
> all the names of the happy people to a list, because there
> is no 'non member' function so i end up with infinate
> recursion with the first matching rule inserted to the
> list an infinte number of times.
>
> mood(bob,happy).
> mood(chirs,angry).
> mood(sally,happy).
>
> find_mood(Mood,[Head|Tail])
> mood(Name,Mood),
> Head = [X|Head],
> find_mood(Mood,[Tail]).
>
> I think what I need a how to determine that something is
> not a member, i just have no idea how to accomplish this
> Thanks
>
> Michael Lew
>
>
> ----------------
> * To UNSUBSCRIBE, please use the HTML form at
>
>     http://www.swi.psy.uva.nl/projects/SWI-Prolog/index.html#mailinglist
>
> or send mail to prolog-request@swi.psy.uva.nl using the Subject:
"unsubscribe"
> (without the quotes) and *no* message body.
>
> ** An ARCHIVE of this list is maintained at
>
>     http://www.swi.psy.uva.nl/projects/SWI-Prolog/mailinglist/archive/
>

