Stylus Studio XML Editor

Table of contents

Appendices

4.2 Fundamental Facets

Fundamental Facets

equal[top]

equal

Every value space supports the notion of equality, with the following rules:

  • for any a and b in the value space, either a is equal to b, denoted a = b, or a is not equal to b, denoted a != b

  • there is no pair a and b from the value space such that both a = b and a != b

  • for all a in the value space, a = a

  • for any a and b in the value space, a = b if and only if b = a

  • for any a, b and c in the value space, if a = b and b = c, then a = c

  • for any a and b in the value space if a = b, then a and b cannot be distinguished (i.e., equality is identity)

Note that a consequence of the above is that, given value space  A and value space  B where A and B are not related by restriction or union, for every pair of values a from A and b from B, a != b.

On every datatype, the operation Equal is defined in terms of the equality property of the value space: for any values a, b drawn from the value space, Equal(a,b) is true if a = b, and false otherwise.

NOTE: 

There is no schema component corresponding to the equal fundamental facet.

ordered[top]

ordered

An order relation on a value space is a mathematical relation that imposes a total order or a partial order on the members of the value space.

A value space, and hence a datatype, is said to be ordered if there exists an order-relation defined for that value space.

A partial order is an order-relation that is irreflexive, asymmetric and transitive.

A partial order has the following properties:

  • for no a in the value space, a < a (irreflexivity)

  • for all a and b in the value space, a < b implies not(b < a) (asymmetry)

  • for all a, b and c in the value space, a < b and b < c implies a < c (transitivity)

The notation a <> b is used to indicate the case when a != b and neither a < b nor b < a

A total order is an partial order such that for no a and b is it the case that a <> b.

A total order has all of the properties specified above for partial order, plus the following property:

  • for all a and b in the value space, either a < b or b < a or a = b

NOTE: 

The fact that this specification does not define an order-relation for some datatype does not mean that some other application cannot treat that datatype as being ordered by imposing its own order relation.

ordered provides for:

The ordered Schema Component[top]

The ordered Schema Component [ ]

[ordered-value] depends on [defn-variety], [defn-facets] and [defn-memberTypes] in the [The Simple Type Definition Schema Component] component in which a ordered component appears as a member of [defn-fund-facets].

When [defn-variety] is atomic, [ordered-value] is inherited from [ordered-value] of [defn-basetype]. For all primitive types [numeric-value] is as specified in the table in [Fundamental Facets].

When [defn-variety] is list, [ordered-value] is false.

When [defn-variety] is union, if [ordered-value] is true for every member of [defn-memberTypes] and all members of [defn-memberTypes] share a common ancestor, then [ordered-value] is true; else [ordered-value] is false.

bounded[top]

bounded

A value u in an ordered  value space U is said to be an inclusive upper bound of a value space V (where V is a subset of U) if for all v in V, u >= v.

A value u in an ordered  value space U is said to be an exclusive upper bound of a value space V (where V is a subset of U) if for all v in V, u > v.

A value l in an ordered  value space L is said to be an inclusive lower bound of a value space V (where V is a subset of L) if for all v in V, l <= v.

A value l in an ordered  value space L is said to be an exclusive lower bound of a value space V (where V is a subset of L) if for all v in V, l < v.

A datatype is bounded if its value space has either an inclusive upper bound or an exclusive upper bound and either an inclusive lower bound and an exclusive lower bound.

bounded provides for:

The bounded Schema Component[top]

The bounded Schema Component [ ]

[bounded-value] depends on [defn-variety], [defn-facets] and [defn-memberTypes] in the [The Simple Type Definition Schema Component] component in which a bounded component appears as a member of [defn-fund-facets].

When [defn-variety] is atomic, if one of minInclusive or minExclusive and one of maxInclusive or maxExclusive are among [defn-facets] , then [bounded-value] is true; else [bounded-value] is false.

When [defn-variety] is list, if length or both of minLength and maxLength are among [defn-facets], then [bounded-value] is true; else [bounded-value] is false.

When [defn-variety] is union, if [bounded-value] is true for every member of [defn-memberTypes] and all members of [defn-memberTypes] share a common ancestor, then [bounded-value] is true; else [bounded-value] is false.

cardinality[top]

cardinality

Every value space has associated with it the concept of cardinality. Some value spaces are finite, some are countably infinite while still others could conceivably be uncountably infinite (although no value space defined by this specification is uncountable infinite). A datatype is said to have the cardinality of its value space.

It is sometimes useful to categorize value spaces (and hence, datatypes) as to their cardinality. There are two significant cases:

cardinality provides for:

The cardinality Schema Component[top]

The cardinality Schema Component [ ]

[cardinality-value] depends on [defn-variety], [defn-facets] and [defn-memberTypes] in the [The Simple Type Definition Schema Component] component in which a cardinality component appears as a member of [defn-fund-facets].

When [defn-variety] is atomic and [cardinality-value] of [defn-basetype] is finite, then [cardinality-value] is finite.

When [defn-variety] is atomic and [cardinality-value] of [defn-basetype] is countably infinite and either of the following conditions are true, then [cardinality-value] is finite; else [cardinality-value] is countably infinite:

  1. one of length, maxLength, totalDigits is among [defn-facets],

  2. all of the following are true:

    1. one of minInclusive or minExclusive is among [defn-facets]

    2. one of maxInclusive or maxExclusive is among [defn-facets]

    3. either of the following are true:

      1. fractionDigits is among [defn-facets]

      2. [defn-basetype] is one of [date], [gYearMonth], [gYear], [gMonthDay], [gDay] or [gMonth] or any type derived from them

When [defn-variety] is list, if length or both of minLength and maxLength are among [defn-facets], then [cardinality-value] is finite; else [cardinality-value] is countably infinite.

When [defn-variety] is union, if [cardinality-value] is finite for every member of [defn-memberTypes], then [cardinality-value] is finite; else [cardinality-value] is countably infinite.

numeric[top]

numeric

A datatype is said to be numeric if its values are conceptually quantities (in some mathematical number system).

A datatype whose values are not numeric is said to be non-numeric.

numeric provides for:

The numeric Schema Component[top]

The numeric Schema Component [ ]

[numeric-value] depends on [defn-variety], [defn-facets], [defn-basetype] and [defn-memberTypes] in the [The Simple Type Definition Schema Component] component in which a cardinality component appears as a member of [defn-fund-facets].

When [defn-variety] is atomic, [numeric-value] is inherited from [numeric-value] of [defn-basetype]. For all primitive types [numeric-value] is as specified in the table in [Fundamental Facets].

When [defn-variety] is list, [numeric-value] is false.

When [defn-variety] is union, if [numeric-value] is true for every member of [defn-memberTypes], then [numeric-value] is true; else [numeric-value] is false.