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. Orientation

Notation

Mathematical notation is elegant, but only because context and conventions allow us to hide references to dependencies. When writing Alloy, we do not have such a luxury. These pages are concerned with presenting definitions of mathematical objects in a manner which is easy to translate into Alloy syntax. So, don't expect traditional mathematical notation to be the first thing you see when you navigate these pages. Instead, you'll see familiar names followed by parameter lists that are perhaps longer than you are used to. For example, within the pages describing Extremal Elements, you'll see expandable content like this:

Meetā€…ā€ŠAā€…ā€ŠRā€…ā€ŠSā€…ā€Šx\textbf{Meet} \; A \; R \; S \; xMeetARSx

Belowā€…ā€ŠAā€…ā€ŠRā€…ā€ŠSā€…ā€Šx\textbf{Below} \;A \; R \; S \; xBelowARSx

āˆ€(y:Belowā€…ā€ŠAā€…ā€ŠRā€…ā€ŠSā€…ā€Šy:R.y.x)\forall(y : \textbf{Below} \;A \; R \; S \; y : R.y.x)āˆ€(y:BelowARSy:R.y.x)


Notation.

  1. Meetā€…ā€ŠSā€…ā€Šx\textbf{Meet} \; S \; xMeetSx abbreviates Meetā€…ā€ŠAā€…ā€ŠRā€…ā€ŠSā€…ā€Šx\textbf{Meet} \; A \; R \; S \; xMeetARSx when AAA and RRR​ are clear from the context.

  2. Meetā€…ā€ŠSā€…ā€Šx\textbf{Meet} \; S \; xMeetSx is abbreviated by x=āŠ“ā€…ā€ŠSx = \sqcap \; Sx=āŠ“S


pred Meet(A: set univ, R: univ->univ, S: set univ, x: univ) {
  Below[A,R,S,x]
  all y: univ | Below[A,R,S,y] implies y->x in R
}

The first section in that container tells us the names of a predicate and its parameters. This one is called Meet\textbf{Meet}Meet, which has four parameters AAA, RRR, SSS and xxx. The next section tells us the conditions the parameters must satisfy for the predicate to be evaluated as true. There is a traditional math notation for this predicate:

x=āŠ“ā€…ā€ŠSx = \sqcap \; Sx=āŠ“S

which is read: xxx is the meet of the set SSS with respect to the preorder RRR on the set AAA. That being such a mouthful is the motivation for not mentioning AAA and RRR in the notation. This definition has a Notation section where I explain how the translation works. Finally, I show how to translate the predicate into Alloy syntax

This way of presenting definitions was inspired by Ralph Back's Structured Derivations. I highly recommend you check out his books: "Teaching Mathematics in the Digital Age" and "Refinement Calculus: A Systematic Introduction".

This is somewhat unusual compared to the Alloy specifications in the wild. Typically, the context I declare as predicate parameters is declared using signatures instead. Supplying context via predicate parameters means those parameter lists can grow long. For example, the predicate I wrote defining a Galois Connection has six parameters! If that makes you uncomfortable, please know that those lengthy lists have a definite advantage: they are honest. They are also reminiscent of how mathematics is formalised in type theories like those presented in Nederpelt and Geuver's book "Type Theory and Formal Proof" or Bill Farmer's "Alonzo". It's not just a quirk.

There is one big problem with that Alloy above, though. Where have I defined the predicate called Below? It's on another page, which will be defined according to the same structure as above: predicate and parameter names, conditions and Alloy.

GitBook's search feature will help you discover exactly where a definition lives.

Also, where are the types of parameters constrained? Dig deep enough into the definitions, and you'll find out!

You'll likely hate how I've separated the predicates from their dependencies. But please give it a chance! I wouldn't say I liked it too, at first. All the toing and froing I've done copying and pasting predicates into my models has had the wonderful side-effect of burning these definitions into my memory.

PreviousWelcomeNextAn Example

Last updated 1 year ago

🌐
āœ’ļø