Boolean operators in algebra
The boolean operators of Ampersand behave as one would expect in any boolean algebra. Union () and intersection () are both idempotent, commutative, and associative operators. In Ampersand we use a binary difference operator over with the usual semantics: . The (more customary) complement operator is a partial function, because Ampersand supports heterogeneous relation algebra.
Union
The operator (union) satisfies the following axioms:
(commutativity of )
(associativity of )
(idempotence of )
Difference
The difference is the smallest relation that satisfies . Smallest means: If there is a for which , this implies that .
Intersection
The intersection is defined as:
Complement
The complement operator is defined as . The type comes from the term(s) in which is embedded. If that type does not exist or if it is ambiguous, Ampersand will refuse to compile with an appropriate error message.
How to type boolean operators in your script
This page shows how you can write these things in your Ampersand script.
Other explanation
Last updated