Set Operations
Alloy supports the standard set operations:
- union (+): t is in
p+q if and only if t is in
p or t is in
q.
- intersection (&): t is in
p&q if and only if t is in
p and t is in
q.
- set subtraction (-): t is in
p-q if and only if t is in
p but t is not in
q.
- set membership/subset (in): Set membership and
subsets are both denoted in. The same symbol is
used, since Alloy does not distinguish between atoms and
singleton sets. To understand why atoms and singleton sets are
treated this way, you should read more about how everything is a relation in Alloy.