0

In Alloy Tutorial they denote some reflexive transitive closure with Kleene star saying that they admit zero or more elements at that position.

  // File system is connected
  fact {
    FSObject in Root.*contents
  }

In Alloy, in can be read as "subset of" (among other things). The operator "*" denotes reflexive transitive closure. Thus, this fact says that the set of all file system objects is a subset of everything reachable from the Root by following the contents relation zero or more times.

Reflexive Transitive Closure *

In Alloy, "*bar" denoted the reflexive transitive closure of bar. It is equavalent to (iden + ^bar) where ^ is the (non-reflexive) transitive closure operator.

Can you explain the closure and star operators such thut it becomes obvious that they are identical?

Little Alien
  • 195
  • 6

1 Answers1

1

(Note: I'm not 100% sure about the Alloy syntax since I never used it -- what follows is accurate on the general principles but the syntax could be slightly different)

Basically, S.*bar means starting from S and using .bar any number $n\geq 0$ of times.

Instead, S.^bar means starting from S and using .bar any positive number $n > 0$ of times.

It is immediate to see that S.^bar is equivalent to S.bar.*bar since the latter denotes zero or more steps after a first step, hence one or more steps.

If the language allows S.iden to mean "zero steps from S", and + to denote union, then we can also write S.^bar as S.(iden + ^bar) which can be read as "zero steps or (one step or more)" which is the same thing as "zero or more steps".


In the underlying theory, one can define the reflexive and transitive closure of a relation $R \in \mathcal{P}(A\times A)$ as the smallest relation $R^* \in \mathcal{P}(A\times A)$ satisfying

$$ R^* = I_A \cup R \circ R^* $$

where $I_A$ stands for the identity relation. The existence of the smallest $R^*$ is guaranteed by the Tarski fixed point theorem (on the complete lattice of the relations). According to the Kleene fixed point theorem (and a few minor simplifications) one can also write it as $$ R^* = \bigcup_{n\geq 0} R^n $$ where $R^n$ denoted the self-composition of $R$ for $n$ times.

chi
  • 14,704
  • 1
  • 31
  • 40