Re: MV Keys

From: Jon Heggland <heggland_at_idi.ntnu.no>
Date: Thu, 2 Mar 2006 15:14:12 +0100
Message-ID: <MPG.1e711bf6bd47605b989775_at_news.ntnu.no>


In article <PuCNf.675$ZL1.646_at_trndny09>, dcressey_at_verizon.net says...
> If you have set types and tuple types, do you need to define relations
> separately as a type? Can't you merely define a relation as a set of
> tuples?

Possibly; I think that is mainly a matter of perspective. A relation is constrained to contain tuples of just one tuple type. If we have a set type generator (think the generic Set of Java 5) that can enforce this, it might fit the bill. However, there are at least two issues:

  • An empty relation of one type should not be equal to an empty relation of another type. In Java, all empty sets are equal: new HashSet<String>().equals(new HashSet<Exception>()) evaluates to true.
  • Sets only have set operators. We need relational operators as well; besides, the cartesian product is defined differently (though analogously) for sets and relations. -- Jon
Received on Thu Mar 02 2006 - 15:14:12 CET

Original text of this message