This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Is the union type Union(P, Q) a subtype of Union(P, Q, R)? According to the XSD rules, no. According to the detailed list of rules in 2.5.6.2, no. But according to the definition of 'subtype', yes. The definition of 'subtype' is: A sequence type A is a subtype of a sequence type B if and only if, for every value V, if V matches A according to the rules of SequenceType matching, then V also matches B. Since every value that matches Union(P, Q) matches either P or Q and therefore matches Union(P, Q, R), this definition would imply that Union(P, Q) is a subtype of Union(P, Q, R). Note also that the union type V = Union(P, Q) is unambiguously a subtype of Union(V, R). But if two union types V and W are both defined as Union(P, Q), then V is a subtype of Union(V, R) but W is not, although the definition of 'subtype' would suggest that it is.
Perhaps we should change the definition to this: [Definition: A sequence type A is a subtype of a sequence type B if subtype(A, B) is true.] That is the effective definition in the document, and it's hard to come up with a succinct intensional definition.
>[Definition: A sequence type A is a subtype of a sequence type B if subtype(A, B) is true.] Seems OK to me. One could add the rider: When subtype(A, B) is true, it is always the case that for any value V, (V instance of A) implies (V instance of B). Note: the converse is not necessarily true: for example every instance of union(P, Q) is also an instance of union(P, Q, R), but there is no subtype relationship between these two types.
We agreed to resolve this using the following definition: [Definition: A sequence type A is a subtype of a sequence type B if the judgement subtype(A, B) is true.]