Help - I need sets. 
Author Message
 Help - I need sets.

My half an hour search in library was not successful.
So tell me how to best implement sets (especially
subset relation) in Prolog. Efficiency is not important
in this case.

To be more specific, I have an enumerated, very finite
base set (say { a,b,c,d,e,f }) and I'd like to get all
the subsets, which have at least members c and d. The
standard way of representing sets as ordered lists
without duplicates does not give a trivial solution.
I'd like so much to ask something like

    :- base(B),subset([d,c|X],B).   instead of

    :- base(B),subset(X,B),member(c,X),member(d,X).

(X is not the same in these two versions, but  for my
 current needs it does not make that kind of difference)

This has to be a standard problem in Prolog-world,
but I'm novice (as you have noticed).

Any help is welcome. Books, articles, code, whatever.

Tomi Silander  

Fri, 06 May 1994 00:48:36 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Need help setting up application broker on W2003 server

2. need help with set up file

3. need help with SET()

4. Need Help!! Set Data Path (Newbie Question)

5. Old timer re-setting up compiling environment needs help

6. Need help setting up an index

7. need help setting up FST 3.1 modula2 compiler

8. Have Indexed Face Set, need help with rest in San Diego

9. Need help setting up an assembler

10. Newbie: need help setting up Ada 95

11. Help Needed: IBM cob2 / cobol set for AIX / lpex question

12. How set window title in Win32 console app Need help


Powered by phpBB® Forum Software