Compendium of Predicates
  • 🌐Orientation
    • ⭐Welcome
    • ✒️Notation
    • 😅An Example
  • 🧰Definitions
    • Relation Taxonomy
    • Order Taxonomy
    • Algebra
      • Magma
      • Semigroup
      • Monoid
      • Group
      • Ringoid
      • Semiring
      • Ring
      • Unit Ring
      • Boolean Ring
      • Boolean Group
    • Bandler and Kohout Products of Relations
    • Closed
    • Complement
    • De Baets and Kerre Products of Relations
    • Extremal Elements
    • Galois Connection
    • Images of a set under a relation
    • Indexed Union and Intersection
    • Monoidal Preorder
    • Monotone Map
    • Natural Projection
    • Non-Preservation of Extrema
    • Over and Under
    • Power Set
    • Preorder
    • Preservation of Extrema
    • Product
    • Relation Inclusion
    • Row Constant Relations
    • Semilattice
    • Set Inclusion
    • Symmetric Monoidal Preorder
    • Upper Set
  • 🔬Checks
    • 🎙️A few words about the checks
    • Indirect Equality and Inclusion
    • Below
    • Extremal Elements
    • Relation Division
    • Algebra
      • Ring
      • Boolean Ring
      • Boolean Group
Powered by GitBook
On this page
  1. Definitions

Relation Taxonomy

Be careful with these

PreviousAn ExampleNextOrder Taxonomy

Last updated 1 year ago

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 \; RAbstractionABR

Simple  A  B  R\textbf{Simple} \; A \; B \; RSimpleABR

Surjective  A  B  R\textbf{Surjective} \; A \; B \; RSurjectiveABR


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 \; RBijectionABR

Injection  A  B  R\textbf{Injection} \; A \; B \; RInjectionABR

Surjection  A  B  R\textbf{Surjection} \; A \; B \; RSurjectionABR


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 \; REndoFunctionAR

Function  A  A  R\textbf{Function} \; A \; A \; RFunctionAAR


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

Relation  A  A  R\textbf{Relation} \; A \; A \; RRelationAAR


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

Relation  A  B  R\textbf{Relation} \; A \; B \; RRelationABR

∀(a∈A::∃(b∈B::R.a.b))\forall(a \in A : : \exists( b \in B : : R.a.b ))∀(a∈A::∃(b∈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 \; RFunctionABR


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 \; RInjectionABR


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 \; RInjectiveABR


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 \; RRelationABR


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


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 \; RSimpleABR


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 \; RSurjectionABR


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 \; RSurjectiveABR


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
}

Entire  A  B  R\textbf{Entire} \; A \; B \; REntireABR

Simple  A  B  R\textbf{Simple} \; A \; B \; RSimpleABR

Injective  A  B  R\textbf{Injective} \; A \; B \; RInjectiveABR

Function  A  B  R\textbf{Function} \; A \; B \; RFunctionABR

Relation  A  B  R\textbf{Relation} \; A \; B \; RRelationABR

∀(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 ) )∀(x∈B::∀(y,z∈A:R.y.x∧R.z.x:y=z))

R⊆A×BR \subseteq A \times BR⊆A×B

Injective  A  B  R\textbf{Injective} \; A \; B \; RInjectiveABR

Entire  A  B  R\textbf{Entire} \; A \; B \; REntireABR

Relation  A  B  R\textbf{Relation} \; A \; B \; RRelationABR

∀(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 ) )∀(x∈A::∀(y,z∈B:R.x.y∧R.x.z:y=z))

Function  A  B  R\textbf{Function} \; A \; B \; RFunctionABR

Surjective  A  B  R\textbf{Surjective} \; A \; B \; RSurjectiveABR

Relation  A  B  R\textbf{Relation} \; A \; B \; RRelationABR

∀(b∈B::∃(a∈A::R.a.b))\forall(b \in B : : \exists( a \in A : : R.a.b ))∀(b∈B::∃(a∈A::R.a.b))

🧰