Next: Domain, Previous: Bool, Up: Types reference
Card is a specialized set of integers used for cardinality sets. Usually, such types do not show up explicitly but are introduced via the type synonym Valency.
A cardinality set can be specified in various ways:
<constant>#{<integer_1> ... <integer_n>}
specifies a set of integers
<constant>#[<integer_1> <integer_2>]
specifies
the closed interval between the integers <integer_1>
and
<integer_2>
<constant>
is equivalent to <constant>#{1}
<constant>!
is equivalent to <constant>#{1}
<constant>?
is equivalent to <constant>#{0 1}
<constant>*
is equivalent to <constant>#[0 infty]}
(where infty
corresponds to “infinity”)
<constant>+
is equivalent to <constant>#[1 infty]}
The set {0}
.
See domain type (Domain).
The greatest lower bound of two cardinality sets S_1 and S_2 is defined as follows:
Here is an example card type definition:
deftype "card" card