The image of a value of the relation's domain is a set of the values in the range that are related to that domain value.
Does the domain of this relation contain the value t
?
The domain of this relation.
An accessor for the graph field for those rare cases where a client needs to get to it.
Return a relation that is the inverse of this one.
Return a relation that is the inverse of this one. In other
words, if (t,u)
is in the relation, then (u,t)
is in the
inverted relation.
Is this relation empty (i.e., contains no pairs)?
An auxiliary extractor for this relation that returns the matched
value t
and its image as a sequence.
Return pairs that describe the mappings in this relation.
Return pairs that describe the mappings in this relation. I.e., the
pair (t,u)
will be included if t
is related to u
.
Add the pair (t,u)
to the relation and the pair (u,t)
to
its inverse.
For each u
taken from us
add the pair (t,u)
to the relation
and the pair (u,t)
to its inverse.
The range of this relation.
The size of this relation.
A relation can be used as an extractor that matches the image of the
matched value t
.
A relation can be used as an extractor that matches the image of the
matched value t
. E.g., the pattern relation(a,b)
succeeds if and
only if the image of the matched value contains exactly two elements,
which are then bound to a
and b
, respectively. Normal sequence
matching works, such as case relation(a, _*)
to match if there is
at least one element in the image and bind the first element to a
.
A binary relation between values of type
T
and values of typeU
. Constructed from memoised caches that mapT
values to their image and vice versa.