This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 3664 - Definition of type promotion complex and inconsistent
Summary: Definition of type promotion complex and inconsistent
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Formal Semantics 1.0 (show other bugs)
Version: Candidate Recommendation
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Jerome Simeon
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-07 07:47 UTC by Jens Teubner
Modified: 2006-10-19 22:51 UTC (History)
0 users

See Also:


Attachments

Description Jens Teubner 2006-09-07 07:47:55 UTC
Section 8.5.1 of the XQuery Formal Semantics contains the judgment

   prime(t1) can be promoted to prime(t1')
   prime(t2) can be promoted to prime(t2')
 ---------------------------------------------
   (t1 | t2) can be promoted to (t1' | t2')

This rule seems unnecessarily complex.  The rule

    t1 can be promoted to t     t2 can be promoted to t
   -----------------------------------------------------
            (t1 | t2) can be promoted to t

contains the same definition (together with the remaining rules in 8.5.1).

Note that in the original inference rule, t1' could be the same type as t2', which is why I replaced it with t in "my" rule.  If promotability holds for prime types, it also holds for the original types (hence, my replacement of prime types with their original types).

The same (original) definition is also *inconsistent* with a second rule in 8.5.1:

  prime(t1) can be promoted to prime(t2)   quant(t1) <= quant(t2)
 -----------------------------------------------------------------
                       t1 can be promoted to t2

Now if I replace t1 with (t1 | t1) and t2 with (t2 | t2) (which are the same types), and use the definition at the beginning of my report, I can "circumvent" the restriction on quantifiers.
Comment 1 Jerome Simeon 2006-09-26 14:14:18 UTC
I've looked at these rules again, and I believe Jens is correct. The last two rules in 8.5.1 are inconsistent and unnecessary complex. The rule that Jens suggest is both simpler and covers the intended semantics. I would recommend to accept the bug and replace the last two inference rules in 8.5.1 by the rule Jens suggests.

- Jerome
Comment 2 Jerome Simeon 2006-09-26 15:57:28 UTC
Jens,
The XSLT and XML Query Working Groups have looked at your comment and decided to accept your suggested changes.
Best regards,
- Jerome
On behalf of the XSLT and XML Query WGs