relation¶
All functions and predicates in this module apply to any binary relation. univ is the set of all atoms in the model.
Functions¶
-
fun
dom[r: univ->univ]¶ Return type: set univReturns the domain of
r. Equivalent touniv.~r.
-
fun
ran[r: univ->univ]¶ Return type: set univReturns the range of
r. Equivalent touniv.r.
Predicates¶
-
pred
total[r: univ->univ, s: set]¶ True iff every element of
sappears indom[r].
-
pred
functional[r: univ->univ, s: set univ]¶ True iff every element of
sappears at most once in the left-relations ofr.
-
pred
function[r: univ->univ, s: set univ]¶ True iff every element of
sappears exactly once in the left-relations ofr.
-
pred
surjective[r: univ->univ, s: set univ]¶ True iff
s in ran[r].
-
pred
injective[r: univ->univ, s: set univ]¶ True iff no two elements of
dom[r]map to the same element ins.
-
pred
bijective[r: univ->univ, s: set univ]¶ True iff every element of
sis mapped to by exactly one relation inr. This is equivalent to being both injective and surjective. There may be relations that map to elements outside ofs.
-
pred
bijection[r: univ->univ, d, c: set univ]¶ True iff exactly
rbijectsdtoc.
-
pred
reflexive[r: univ -> univ, s: set univ]¶ rmaps every element ofsto itself.
-
pred
irreflexive[r: univ -> univ]¶ rdoes not map any element to itself.
-
pred
symmetric[r: univ -> univ]¶ A -> B in r implies B -> A in r
-
pred
antisymmetric[r: univ -> univ]¶ A -> B in r implies B -> A notin r. This is stronger thannot symmetric: no subset ofrcan be symmetric either.
-
pred
transitive[r: univ -> univ]¶ A -> B in r and B - > C in r implies A -> C in r
-
pred
acyclic[r: univ->univ, s: set univ]¶ rhas no cycles that have elements ofs.
-
pred
complete[r: univ->univ, s: univ]¶ all x,y:s | (x!=y => x->y in (r + ~r))
-
pred
preorder[r: univ -> univ, s: set univ]¶ reflexive[r, s] and transitive[r]
-
pred
equivalence[r: univ->univ, s: set univ]¶ ris reflexive, transitive, and symmetric over s.
-
pred
partialOrder[r: univ -> univ, s: set univ]¶ ris a partial order over the sets.
-
pred
totalOrder[r: univ -> univ, s: set univ]¶ ris a total order over the sets.