next up previous contents
Next: Topological Sorting Up: Signature Compilation Previous: Subsumption Matrices and Transitive   Contents


Monoids, Rings, Quasi-Rings, and Semirings

To understand the underlying mathematics of signature compilation, we need to understand the algebraic structures of monoids, rings, quasi-rings, and semi-rings.

Definition 2   A monoid is a structure $\langle P,\cdot,e\rangle$ such that:

Definition 3   A quasi-ring is a structure $\langle P, \oplus, \otimes,
\bar{0}, \bar{1}, \rangle$ such that:

Definition 4   A ring is a quasi-ring with an additive inverse, i.e., for all $a\in P$, there exists $b\in P$ such that $a\oplus b=b\oplus a =
\bar{0}$.

If $P$ is a quasi-ring, then multiplication of matrices is well-defined and has certain nice properties such as associativity and the existence of an identity.

Definition 5   Given a quasi-ring, $Q=\langle P,\oplus,\otimes,\bar{0},\bar{1}
\rangle$, an $m\times n$ matrix, $A$, over $Q$, and an $n\times p$ matrix, $B$, over $Q$, then $A\cdot B$ (matrix multiplication) is the $m\times p$ matrix, $C$ over $Q$ such that:

\begin{displaymath}
c_{i,j}=\bigoplus_{k=1}^{n}a_{i,k}\otimes b_{k,j}.
\end{displaymath}

$B_{\mathrm XOR}$ and $B_{\mathrm OR}$ are both Boolean quasi-rings. $B_{\mathrm XOR}$ is also a Boolean ring; $B_{\mathrm OR}$ is not. $B_{\mathrm OR}$ is a closed Boolean semi-ring:

Definition 6   A closed semiring is a quasi-ring, $\langle P,\oplus,
\otimes,\bar{0},\bar{1}\rangle$, such that:

In a Boolean semiring, $\oplus$ corresponds to OR and $\otimes$ corresponds to AND. OR is idempotent, i.e., $1\oplus 1=1$. This is vital for ensuring that matrix multiplication can compute a transitive closure, since transitively closed subsumption should not be `turned off' by immediate subsumption chains on more than one subtyping branch. So we need idempotence in the underlying Boolean quasi-ring. XOR is not idempotent; so the Boolean ring is not the correct structure to use.


next up previous contents
Next: Topological Sorting Up: Signature Compilation Previous: Subsumption Matrices and Transitive   Contents
TRALE Reference Manual