W3C home > Mailing lists > Public > public-qt-comments@w3.org > January 2013

[Bug 20643] New: [XP3.0] Formal and informal definitions of derives-from() do not match

From: <bugzilla@jessica.w3.org>
Date: Fri, 11 Jan 2013 09:51:45 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-20643-523@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=20643

            Bug ID: 20643
           Summary: [XP3.0] Formal and informal definitions of
                    derives-from() do not match
    Classification: Unclassified
           Product: XPath / XQuery / XSLT
           Version: Last Call drafts
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XPath 3.0
          Assignee: jonathan.robie@gmail.com
          Reporter: mike@saxonica.com
        QA Contact: public-qt-comments@w3.org

This is transferred from the comment made by email here:

https://lists.w3.org/Archives/Member/w3c-xsl-query/2013Jan/0003.html

We say in 2.5.5

derives-from( AT, ET ) returns true if AT is derived from ET by 
restriction or extension, or if ET is a union type of which AT is a 
member type.

If this were the case, then when a function expects union(xs:string, 
xs:decimal), it would be a type error to supply an xs:integer. 
Furthermore, "union type" should be "pure union type".

This sentence is immediately followed by a paraphrase that says 
"formally, ...", and the paraphrase gives the a more complete definition. But 
there is no indication that the sentence quoted is to be regarded as 
incomplete or informal.

A better definition might be:

derives-from( AT, ET ) returns true if any of the following conditions 
applies:

* AT is ET
* ET is the base type of AT
* ET is a pure union type of which AT is a member type
* There is a type MT such that derives-from(AT, MT) and derives-from(MT, ET)

The problem is exemplified by test instanceof138. The expected result 
for this test assumes that restrictedDate is substitutable for a union 
type that includes the base type of restrictedDate as one of its members.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Friday, 11 January 2013 09:51:50 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 11 January 2013 09:51:51 GMT