![]() |
| ||||||||||||||||||||
Navigation |
Synopsis An unordered set of tuples.
Description In mathematics, given sets
D1 , D2 , ... Dn , a
n -ary relation R is characterized by R ⊆ D1 × D2 × ... × Dn .
In other words, R consists of a set of tuples <V1, ..., Vn> where each Vi is an element of
the set Di . When n = 2, we call the relation a binary relation![]() In database theory ![]()
In Rascal, a relation is a set of tuples and is characterized by the type: rel[D1 Name1, D2 Name2, ..., Dn Namen]
See Rascal:Values/Relation and for a description of relations and their operators
(since relations are sets all set operators also apply to them, see Rascal:Values/Set)
and Rascal:Prelude/Relation for functions on relations
(and here again, since relations are sets all set operators also apply to them, see Rascal:Prelude/Set).
Examples
Relations in daily life
![]() ![]() ![]() ![]() Relations in computer science
Relations in Rascal
![]() |