How to program set(X) + set(a) = set(X) 
Author Message
 How to program set(X) + set(a) = set(X)

Quote:

>I'm going to code in prolog the 'set union' which takes into
>consideration set(X) which the set X is undetermined.
>The set union is like this:
>    set(X) + set(a) =set(X).
>If it works, it might be used for any set operation such as subtract,
>implication, etc..
>Do you have on idea of the implementation?

I really don't.  But I'm dissapointed not to see any responses to this
question, since it reflects on the logical nature of prolog vs.
real-world implementation.

Since every predicate implicitly defines a set, you can use
member/2.

Then maybe
in_union(Elem,Set1,Set2) :- member(Elem,Set1).
in_union(Elem,Set1,Set2) :- member(Elem,Set2).

This won't lead to set differences, since it is hard to ask
what is *not* a member (without red cuts and all that).

So, I guess I'll just ask the net again to answer this guy's
question:  can you compute sets, should you, and how do you do it?

Damon
--
---------

Tulane University Computer Science Dept.



Wed, 11 Jun 1997 01:21:23 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. How to program set(X) + set(a) = set(X)

2. Set( _print_file) gives GPF after Set Default on Non-Novell systems

3. HELP ME: SET DEFAULT WITH SET PRINT TO LPT1

4. SET EXCACT AND SET SOFTSEEK

5. Set device to printer/set print on creates a new print job on NT.

6. DOS SET command or set environment variable from Rexx

7. who set "set tz=....." command orignally

8. synchronous reset/set or asynchronous reset/set

9. Wanted instruction set for intel 80386/80486/8087/80487/pentium assembly set

10. synchronous reset/set or asynchronous reset/set

11. default setting of unicode set

12. Python Sets (no not those sets)

 

 
Powered by phpBB® Forum Software