From ok@atlas.otago.ac.nz Fri Mar 23 01:38:52 2001
Received: from atlas.otago.ac.nz (atlas.otago.ac.nz [139.80.32.250])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f2N0cp303682
	for <prolog@swi.psy.uva.nl>; Fri, 23 Mar 2001 01:38:51 +0100 (MET)
Received: (from ok@localhost)
	by atlas.otago.ac.nz (8.9.3/8.9.3) id MAA10805;
	Fri, 23 Mar 2001 12:38:37 +1200 (NZST)
Date: Fri, 23 Mar 2001 12:38:37 +1200 (NZST)
From: "Richard A. O'Keefe" <ok@atlas.otago.ac.nz>
Message-Id: <200103230038.MAA10805@atlas.otago.ac.nz>
To: mlew@cs.ucr.edu, prolog@swi.psy.uva.nl
Subject: Re:  [SWIPL] Basic Newby question

Michael J Lew <mlew@cs.ucr.edu> wrote:
	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

There aren't any functions in Prolog, only predicates.

You don't *need* a non-member "function" because you have member/2
and \+ /1.  Y is not a member of Xs if \+member(Y, Xs).

FACTS	
	mood(bob,happy).
	mood(chirs,angry).
	mood(sally,happy).
	
QUERY
	find_mood(Mood,[Head|Tail])
	mood(Name,Mood),
	Head = [X|Head],
	find_mood(Mood,[Tail]).
	
I cannot make sense of this.

If you want to find the happy people, just do
	?- setof(Person, mood(Person,happy), HappyPeople).

