Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!gatech!newsfeed.internetmci.com!tank.news.pipex.net!pipex!sunsite.doc.ic.ac.uk!lut.ac.uk!usenet
From: Alex Bland <coasb@student.lut.ac.uk>
Subject: Powerset Predicate
Sender: usenet@lut.ac.uk (Usenet-News)
Message-ID: <3131C8F5.41C67EA6@student.lut.ac.uk>
Date: Mon, 26 Feb 1996 14:51:33 GMT
X-Nntp-Posting-Host: sun-co16.lut.ac.uk
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
X-Mailer: Mozilla 2.0 (X11; I; SunOS 4.1.4 sun4m)
Organization: Loughborough University, UK.
Lines: 27

I am having trouble writing a POWERSET predicate.

It takes in a list of all values in a set (read in as a list).
and then produces a list of lists.
each sublist contains a list of all possible combinations (each element
is greater in size than the previous one) of the elements from the input
list 

e.g.

powerset(set([f,t]), set([ set([]), set(f]), set([t]), set([f,t]) ]) ).


so far my predicate gives

powerset(set([A,B,C,D]),AB).

AB = set([set([A]),set([B]),set([C]),set([D])]) 



Any help at all would be appreciated.

+=====================================================+
| Alex Bland <a.s.bland-94@student.lut.ac.uk>         |
|            <coasb@{hpb|hpl|suna}.lut.ac.uk>         |     
+=====================================================+
