Relation Taxonomy

Be careful with these

I present two Alloy translations for each of the definitions on this page. The first translations are hugely instructive and are taken from J. N. Oliveira's work on relational methods in software engineering. They present to you in black and white how the various relation classes form a taxonomy. However, using them in your specifications will likely inflate the state space the analyser must explore. That's where the second translation comes in. I took these from Alcino Cunha's writings on Alloy. He calls it the "Relation Bestiary". They'll not explode your state space, but they make it harder to see how the taxonomy is formed. You should be fluent in both translations.

Abstractionā€…ā€ŠAā€…ā€ŠBā€…ā€ŠR\textbf{Abstraction} \; A \; B \; R

Simpleā€…ā€ŠAā€…ā€ŠBā€…ā€ŠR\textbf{Simple} \; A \; B \; R

Surjectiveā€…ā€ŠAā€…ā€ŠBā€…ā€ŠR\textbf{Surjective} \; A \; B \; R


pred Abstraction(A,B: set univ, R: univ->univ) {
  Simple[A,B,R]
  Surjective[A,B,R]
}
pred Abstraction(A,B: set univ, R: univ->univ) {
  R in A some -> lone B
}
Bijectionā€…ā€ŠAā€…ā€ŠBā€…ā€ŠR\textbf{Bijection} \;A \; B \; R

Injectionā€…ā€ŠAā€…ā€ŠBā€…ā€ŠR\textbf{Injection} \; A \; B \; R

Surjectionā€…ā€ŠAā€…ā€ŠBā€…ā€ŠR\textbf{Surjection} \; A \; B \; R


pred Bijection(A,B: set univ, R: univ->univ) {
  Injection[A,B,R]
  Surjection[A,B,R]
}
pred Bijection(A,B: set univ, R: univ->univ) {
  R in A one -> one B
}
EndoFunctionā€…ā€ŠAā€…ā€ŠR\textbf{EndoFunction} \; A \; R

Functionā€…ā€ŠAā€…ā€ŠAā€…ā€ŠR\textbf{Function} \; A \; A \; R


pred EndoFunction(A: set univ, R: univ->univ) {
  Function[A,A,R]
}
EndoRelationā€…ā€ŠAā€…ā€ŠR\textbf{EndoRelation} \; A \; R

Relationā€…ā€ŠAā€…ā€ŠAā€…ā€ŠR\textbf{Relation} \; A \; A \; R


pred EndoRelation(A: set univ, R: univ->univ) {
  Relation[A,A,R]
}
Entireā€…ā€ŠAā€…ā€ŠBā€…ā€ŠR\textbf{Entire} \; A \; B \; R

Relationā€…ā€ŠAā€…ā€ŠBā€…ā€ŠR\textbf{Relation} \; A \; B \; R

āˆ€(a∈A::∃(b∈B::R.a.b))\forall(a \in A : : \exists( b \in B : : R.a.b ))


pred Entire(A,B: set univ, R: univ->univ) {
  Relation[A,B,R]
  all a: A | some b: B | a->b in R
}
pred Entire(A,B: set univ, R: univ->univ) {
  R in A -> some B
}
Functionā€…ā€ŠAā€…ā€ŠBā€…ā€ŠR\textbf{Function} \; A \; B \; R

Entireā€…ā€ŠAā€…ā€ŠBā€…ā€ŠR\textbf{Entire} \; A \; B \; R

Simpleā€…ā€ŠAā€…ā€ŠBā€…ā€ŠR\textbf{Simple} \; A \; B \; R


pred Function(A,B: set univ, R: univ->univ) {
  Entire[A,B,R]
  Simple[A,B,R]
}
pred Function(A,B: set univ, R: univ->univ) {
  R in A -> one B
}
Injectionā€…ā€ŠAā€…ā€ŠBā€…ā€ŠR\textbf{Injection} \; A \; B \; R

Injectiveā€…ā€ŠAā€…ā€ŠBā€…ā€ŠR\textbf{Injective} \; A \; B \; R

Functionā€…ā€ŠAā€…ā€ŠBā€…ā€ŠR\textbf{Function} \; A \; B \; R


pred Injection(A,B: set univ, R: univ->univ) {
  Injective[A,B,R]
  Function[A,B,R]
}
pred Injection(A,B: set univ, R: univ->univ) {
  R in A lone -> one B
}
Injectiveā€…ā€ŠAā€…ā€ŠBā€…ā€ŠR\textbf{Injective} \; A \; B \; R

Relationā€…ā€ŠAā€…ā€ŠBā€…ā€ŠR\textbf{Relation} \; A \; B \; R

āˆ€(x∈B::āˆ€(y,z∈A:R.y.x∧R.z.x:y=z))\forall( x \in B : : \forall( y,z \in A : R.y.x \wedge R.z.x : y = z ) )


pred Injective(A,B: set univ, R: univ->univ) {
  Relation[A,B,R]
  all x: B | all y,z: A | y->x in R and z->x in R implies y = z
}
pred Injective(A,B: set univ, R: univ->univ) {
  R in A lone -> B
}
Relationā€…ā€ŠAā€…ā€ŠBā€…ā€ŠR\textbf{Relation} \; A \; B \; R

RāŠ†AƗBR \subseteq A \times B


pred Relation(A,B: set univ, R: univ->univ) {
  R in A->B
}
Representationā€…ā€ŠAā€…ā€ŠBā€…ā€ŠR\textbf{Representation} \; A \; B \; R

Injectiveā€…ā€ŠAā€…ā€ŠBā€…ā€ŠR\textbf{Injective} \; A \; B \; R

Entireā€…ā€ŠAā€…ā€ŠBā€…ā€ŠR\textbf{Entire} \; A \; B \; R


pred Representation(A,B: set univ, R: univ->univ) {
  Injective[A,B,R]
  Entire[A,B,R]
}
pred Representation(A,B: set univ, R: univ->univ) {
  R in A lone -> some B
}
Simpleā€…ā€ŠAā€…ā€ŠBā€…ā€ŠR\textbf{Simple} \; A \; B \; R

Relationā€…ā€ŠAā€…ā€ŠBā€…ā€ŠR\textbf{Relation} \; A \; B \; R

āˆ€(x∈A::āˆ€(y,z∈B:R.x.y∧R.x.z:y=z))\forall( x \in A : : \forall( y,z \in B : R.x.y \wedge R.x.z : y = z ) )


pred Simple(A,B: set univ, R: univ->univ) {
  Relation[A,B,R]
  all x: A | all y,z: B | x->y in R and x->z in R implies y = z
}
pred Simple(A,B: set univ, R: univ->univ) {
  R in A -> lone B
}
Surjectionā€…ā€ŠAā€…ā€ŠBā€…ā€ŠR\textbf{Surjection} \; A \; B \; R

Functionā€…ā€ŠAā€…ā€ŠBā€…ā€ŠR\textbf{Function} \; A \; B \; R

Surjectiveā€…ā€ŠAā€…ā€ŠBā€…ā€ŠR\textbf{Surjective} \; A \; B \; R


pred Surjection(A,B: set univ, R: univ->univ) {
  Function[A,B,R]
  Surjective[A,B,R]
}
pred Surjection(A,B: set univ, R: univ->univ) {
  R in A some -> one B
}
Surjectiveā€…ā€ŠAā€…ā€ŠBā€…ā€ŠR\textbf{Surjective} \; A \; B \; R

Relationā€…ā€ŠAā€…ā€ŠBā€…ā€ŠR\textbf{Relation} \; A \; B \; R

āˆ€(b∈B::∃(a∈A::R.a.b))\forall(b \in B : : \exists( a \in A : : R.a.b ))


pred Surjective(A,B: set univ, R: univ->univ) {
  Relation[A,B,R]
  all b: B | some a: A | a->b in R
}
pred Surjective(A,B: set univ, R: univ->univ) {
  R in A some -> B
}

Last updated