[Bug 14652] New: [XPath 3.0] Definition of 'subtype' is incorrect/inconsistent

http://www.w3.org/Bugs/Public/show_bug.cgi?id=14652

           Summary: [XPath 3.0] Definition of 'subtype' is
                    incorrect/inconsistent
           Product: XPath / XQuery / XSLT
           Version: Working drafts
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XPath 3.0
        AssignedTo: jonathan.robie@gmail.com
        ReportedBy: mike@saxonica.com
         QAContact: public-qt-comments@w3.org


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.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Tuesday, 1 November 2011 11:12:44 UTC