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.

chevron-rightAbstractionβ€…β€ŠAβ€…β€ŠBβ€…β€ŠR\textbf{Abstraction} \; A \; B \; Rhashtag

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
}
chevron-rightBijectionβ€…β€ŠAβ€…β€ŠBβ€…β€ŠR\textbf{Bijection} \;A \; B \; Rhashtag

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
}
chevron-rightEndoFunctionβ€…β€ŠAβ€…β€ŠR\textbf{EndoFunction} \; A \; Rhashtag

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


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

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


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

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
}
chevron-rightFunctionβ€…β€ŠAβ€…β€ŠBβ€…β€ŠR\textbf{Function} \; A \; B \; Rhashtag

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

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


chevron-rightInjectionβ€…β€ŠAβ€…β€ŠBβ€…β€ŠR\textbf{Injection} \; A \; B \; Rhashtag

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

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


chevron-rightInjectiveβ€…β€ŠAβ€…β€ŠBβ€…β€ŠR\textbf{Injective} \; A \; B \; Rhashtag

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 ) )


chevron-rightRelationβ€…β€ŠAβ€…β€ŠBβ€…β€ŠR\textbf{Relation} \; A \; B \; Rhashtag

RβŠ†AΓ—BR \subseteq A \times B


chevron-rightRepresentationβ€…β€ŠAβ€…β€ŠBβ€…β€ŠR\textbf{Representation} \; A \; B \; Rhashtag

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

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


chevron-rightSimpleβ€…β€ŠAβ€…β€ŠBβ€…β€ŠR\textbf{Simple} \; A \; B \; Rhashtag

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 ) )


chevron-rightSurjectionβ€…β€ŠAβ€…β€ŠBβ€…β€ŠR\textbf{Surjection} \; A \; B \; Rhashtag

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

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


chevron-rightSurjectiveβ€…β€ŠAβ€…β€ŠBβ€…β€ŠR\textbf{Surjective} \; A \; B \; Rhashtag

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 ))


Last updated