<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>3664</bug_id>
          
          <creation_ts>2006-09-07 07:47:55 +0000</creation_ts>
          <short_desc>Definition of type promotion complex and inconsistent</short_desc>
          <delta_ts>2006-10-19 22:51:49 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Formal Semantics 1.0</component>
          <version>Candidate Recommendation</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jens Teubner">jens.teubner</reporter>
          <assigned_to name="Jerome Simeon">simeon</assigned_to>
          
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>11482</commentid>
    <comment_count>0</comment_count>
    <who name="Jens Teubner">jens.teubner</who>
    <bug_when>2006-09-07 07:47:55 +0000</bug_when>
    <thetext>Section 8.5.1 of the XQuery Formal Semantics contains the judgment

   prime(t1) can be promoted to prime(t1&apos;)
   prime(t2) can be promoted to prime(t2&apos;)
 ---------------------------------------------
   (t1 | t2) can be promoted to (t1&apos; | t2&apos;)

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&apos; could be the same type as t2&apos;, which is why I replaced it with t in &quot;my&quot; 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) &lt;= 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 &quot;circumvent&quot; the restriction on quantifiers.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12038</commentid>
    <comment_count>1</comment_count>
    <who name="Jerome Simeon">simeon</who>
    <bug_when>2006-09-26 14:14:18 +0000</bug_when>
    <thetext>I&apos;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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12052</commentid>
    <comment_count>2</comment_count>
    <who name="Jerome Simeon">simeon</who>
    <bug_when>2006-09-26 15:57:28 +0000</bug_when>
    <thetext>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</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>