# On the cardinality of (scalar) types

Quote from AntC on April 15, 2021, 4:39 amRM Pre 1 requires (in effect) all scalar types have at least one value. ("With the sole exception of the system defined empty type

omega...", which I presume could never be the type of an attribute; or if there were an attribute at typeomegain some headingH, the only valid relation values with that heading would be empty.)_{Ω}By the same argument of uselessness of

H, why/how could there be a type with cardinality one? If there were an attribute at some type_{Ω}Twith cardinality 1, in some heading_{1}H, all nonempty relation values must have_{1}T's only value in that attribute, so the appearance of that value is information equivalent to 'non-empty', the meaning of which could be built into the relvar's characteristic predicate._{1}Is

Has useless as_{1}H?_{Ω}Would the

TTMmodel be hopelessly hobbled if RM Pre 1 required all scalar types have more than one value?Does the situation change when we consider also Tuple-valued and Relation-valued Attributes? Could there be a TVA or RVA with a only single valid value?

Reason for asking: I'm still pursuing the lattice-theoretic axiomatisation of relations. If all attribute types are required to have more than one value, I can say that the relation values with empty heading (

`DEE, DUM`

) are the only ones with so few as two values; for all other headings there are more than two (actually, at least four).

RM Pre 1 requires (in effect) all scalar types have at least one value. ("With the sole exception of the system defined empty type *omega* ...", which I presume could never be the type of an attribute; or if there were an attribute at type *omega* in some heading *H _{Ω}*, the only valid relation values with that heading would be empty.)

By the same argument of uselessness of *H _{Ω}*, why/how could there be a type with cardinality one? If there were an attribute at some type

*T*with cardinality 1, in some heading

_{1}*H*, all nonempty relation values must have

_{1}*T*'s only value in that attribute, so the appearance of that value is information equivalent to 'non-empty', the meaning of which could be built into the relvar's characteristic predicate.

_{1}Is *H _{1}* as useless as

*H*?

_{Ω}Would the *TTM* model be hopelessly hobbled if RM Pre 1 required all scalar types have more than one value?

Does the situation change when we consider also Tuple-valued and Relation-valued Attributes? Could there be a TVA or RVA with a only single valid value?

Reason for asking: I'm still pursuing the lattice-theoretic axiomatisation of relations. If all attribute types are required to have more than one value, I can say that the relation values with empty heading (`DEE, DUM`

) are the only ones with so few as two values; for all other headings there are more than two (actually, at least four).

Quote from tobega on April 15, 2021, 5:28 amI can't think of any interesting use for a type with only one valid value. It would seem that such a type would only have some use in speculative engineering where you intend to add more values at some later point, and that we shouldn't be doing anyway.

I can't think of any interesting use for a type with only one valid value. It would seem that such a type would only have some use in speculative engineering where you intend to add more values at some later point, and that we shouldn't be doing anyway.

Quote from Darren Duncan on April 15, 2021, 6:20 amHaving scalar types with exactly 1 value, also known as singleton types, are immensely useful.

BUT, that usefulness mainly exists in a type system supporting type unions, which base TTM does not but as I recall TTM+IM does.

So example uses of such singleton types is to represent special values such as negative or positive infinity.

These can then be unioned with a regular numeric type to allow regular numbers or infinities, where the regular numeric type itself only allows normal numbers.

Having scalar types with exactly 1 value, also known as singleton types, are immensely useful.

BUT, that usefulness mainly exists in a type system supporting type unions, which base TTM does not but as I recall TTM+IM does.

So example uses of such singleton types is to represent special values such as negative or positive infinity.

These can then be unioned with a regular numeric type to allow regular numbers or infinities, where the regular numeric type itself only allows normal numbers.

Quote from tobega on April 15, 2021, 10:12 amQuote from Darren Duncan on April 15, 2021, 6:20 amHaving scalar types with exactly 1 value, also known as singleton types, are immensely useful.

BUT, that usefulness mainly exists in a type system supporting type unions, which base TTM does not but as I recall TTM+IM does.

So example uses of such singleton types is to represent special values such as negative or positive infinity.

These can then be unioned with a regular numeric type to allow regular numbers or infinities, where the regular numeric type itself only allows normal numbers.

Seems like a question of semantic hair-splitting to me. I would argue that neither infinity is useful in isolation. There is also no need to consider it to be a type in itself, other than that you have been restricted to do so by a certain implementation, it is really just another value of the number type.

Quote from Darren Duncan on April 15, 2021, 6:20 amHaving scalar types with exactly 1 value, also known as singleton types, are immensely useful.

Seems like a question of semantic hair-splitting to me. I would argue that neither infinity is useful in isolation. There is also no need to consider it to be a type in itself, other than that you have been restricted to do so by a certain implementation, it is really just another value of the number type.

Quote from AntC on April 15, 2021, 11:38 amQuote from Darren Duncan on April 15, 2021, 6:20 amHaving scalar types with exactly 1 value, also known as singleton types, are immensely useful.

Ah yes, fair point. I'm taking it that those singleton types have the same role as the IM's

omega: they're part of the machinery for defining and manipulating inheritance of types.You wouldn't have an attribute at type singleton 'negative infinity'. You would have an attribute at type 'negative infinity'-union-'regular numeric'-union-'positive infinity'.

Quote from Darren Duncan on April 15, 2021, 6:20 amHaving scalar types with exactly 1 value, also known as singleton types, are immensely useful.

Ah yes, fair point. I'm taking it that those singleton types have the same role as the IM's *omega*: they're part of the machinery for defining and manipulating inheritance of types.

You wouldn't have an attribute at type singleton 'negative infinity'. You would have an attribute at type 'negative infinity'-union-'regular numeric'-union-'positive infinity'.