//Title:        DSet (interface)
//Version:      0.1
//Copyright:    Copyright (c) 1998
//Author:       Elwood Wray Johnson
//Organization: Object Data Management Group (ODMG)
//Description:  Object Manipulation Language (OML)

package org.odmg.oml;

import org.odmg.odl.metaobjects.*;
/*
  A set is an unordered collection of things. e.g., {Tom, Bob} or {Bob, Tom}.

  Two sets are equal if and only if they have the same members -- this is
  called the axiom of extensionality. The extension of a thing is, roughly,
  its meaning. The identity of a set depends only on the things in the set --
  not on the order of the things in the set.

  Every set is a subset of itself. A proper subset is just like a subset,
  except that it excludes the case where the subsets are identical.

  The empty set is a subset of every set.

  Set theory was originally developed by a German mathematician named Georg
  Cantor. In the late 19th century, he developed the theory and the notation
  that we still used. He wanted a uniform way to understand the notion of
  infinity -- for religious reasons. Set theory does allow us to prove some
  remarkable things about infinity.

  Cantor developed the idea of cardinality (abbreviated card), which is the
  size of a set. Card A = Card B iff there is a one-to-one correspondence
  between the elements of A and the elements of B. Thus {1,2,3,4} and
  {7,8,9,10} are cardinally equal. For each unique element in A, there is a
  unique element in B, and vice-versa. Thus:

  Card {0,1,2,3,...} = Card {1000,1001,1002,1003,...} In this sense, the part
  does not have to be smaller than the whole. But:

  Card {real numbers} > Card {natural numbers}. What Cantor wants to say is
  that there are different sizes of infinity. In fact 2natural numbers =
  real numbers.

  The philosophers Frege and Russell thought that they could use set theory
  to prove the basic axioms of arithmetic. Russell proved, for instance,
  that 1+1=2. Frege thought that all of mathematics could be reduced to set
  theory. Russell challenged Frege with what has come to be known as
  Russell's paradox:

  Some sets are members of thmselves, as with the set of all sets. Most sets,
  however, are not members of themselves. Consider the set of all sets that
  are not members of themselves. Is this set a member of itself? If yes,
  then no; if no, then yes: a paradox.

  This problem has been solved. In Cantor's original set theory, there was
  the axiom of comprehension, which says that for any property, there is a
  set of all things that have that property. Russell's paradox is a refutation
  of this axiom. So the solution was to get rid of the axiom of comprehension.
  So we no longer really use Cantor's set theory, but rather ZF (Zermelo
  Grankel) set theory, which doesn't allow for the set of all sets that are
  not members of themselves
*/

public interface DSet extends DCollection, java.util.Set
{
  static CollectionKind collectionKind = CollectionKind.ckSet;

  public DSet union(DSet otherSet);

  public DSet intersection(DSet otherSet);

  public DSet difference(DSet otherSet);

  public boolean subsetOf(DSet otherSet);

  public boolean properSubsetOf(DSet otherSet);

  public boolean supersetOf(DSet otherSet);

  public boolean properSupersetOf(DSet otherSet);
}
