<?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>27668</bug_id>
          
          <creation_ts>2014-12-18 23:09:03 +0000</creation_ts>
          <short_desc>[xslt 3.0] (@a, @b) is not streamable</short_desc>
          <delta_ts>2015-10-29 09:50:40 +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>XSLT 3.0</component>
          <version>Last Call drafts</version>
          <rep_platform>PC</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="Michael Kay">mike</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          <cc>abel.braaksma</cc>
          
          <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>116530</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2014-12-18 23:09:03 +0000</bug_when>
    <thetext>It seems that the expression (@a, @b) is not guaranteed streamable.

The general streamability rules apply. Both operands have U=transmission, P=striding, S=motionless. The adjusted usage and adjusted sweep are the same as U and S. Under 1.c.ii both operands are potentially consuming. Therefore 2.c.ii applies, and the expression as a whole is roaming and free-ranging.

There seems to be a need for another subrule of 2.c to say that if all the &quot;potentially consuming&quot; operands are motionless and if all have the same posture P, then the expression is motionless with posture P.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116677</commentid>
    <comment_count>1</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2014-12-25 16:00:46 +0000</bug_when>
    <thetext>There&apos;s a potential subtlety that we may need to carefully examine if we are making this change (which in principal seems a sound one), consider:

(self::p, @lang)
- both striding and motionless
- potentially consuming
- with new rule, this remains motionless and striding

string((self::p, @lang))
- inner expr is motionless and striding
- under 1.b.iii.A we say: if type U is not element/document, then U&apos; is inspection

After this proposed change, the above expression hits an ambiguity, as there is no more &quot;a type&quot;, but there is now a &quot;collection of types&quot; (attribute and element nodes), of which one would yield U&apos; inspection, and the other would yield U&apos; absorption.

Obviously, the result of string((self::p, @lang)) must be consuming (and streamable).

I *think* that this is covered under 19.2 Determining the Static Type of a Construct, but in the GSR we speak of &quot;The static type T&quot;, while in fact this is a union of several types.

Perhaps that under 1.a.i. we could remove this ambiguity by not talking of a static type T, but of determining the union U{t1, t2...} of the construct.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116983</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-01-10 00:07:27 +0000</bug_when>
    <thetext>&gt;After this proposed change, the above expression hits an ambiguity, as there is no more &quot;a type&quot;, but there is now a &quot;collection of types&quot; (attribute and element nodes), of which one would yield U&apos; inspection, and the other would yield U&apos; absorption.

In fact, the static type of an operand is by definition a U-Type, and the U-Type of (self::p, @lang) is U{element(), attribute()}. The intersection of this with U{element(), document-node()} is NOT U{}, therefore U&apos; is U. I think there is no ambiguity.

&gt;in the GSR we speak of &quot;The static type T&quot;, while in fact this is a union of several types

The definition of the &quot;static type&quot; of an expression says that it is a U-Type. Would it be clearer if we called it the &quot;static U-Type&quot; of an expression?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116993</commentid>
    <comment_count>3</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2015-01-10 17:19:11 +0000</bug_when>
    <thetext>(In reply to Michael Kay from comment #2)
&gt; 
&gt; In fact, the static type of an operand is by definition a U-Type, and the
&gt; U-Type of (self::p, @lang) is U{element(), attribute()}. The intersection of
&gt; this with U{element(), document-node()} is NOT U{}, therefore U&apos; is U. I
&gt; think there is no ambiguity.

On a fresh new read of spec and proposed changes, I think you are right. My issue was with &quot;the static type of X&quot; which is not &quot;a type&quot; but defined as a union of types.

The ambiguity was in my head, not in the (literal) reading of the spec.

&gt; 
&gt; &gt;in the GSR we speak of &quot;The static type T&quot;, while in fact this is 
&gt; &gt;a union of several types
&gt; 
&gt; The definition of the &quot;static type&quot; of an expression says that it is a
&gt; U-Type. Would it be clearer if we called it the &quot;static U-Type&quot; of an
&gt; expression?

Yes, I think this makes sense. It would make for a clearer read of U-type related parts of the spec. Or perhaps instead of calling it a static type, we should just always call it the U-type, as the words &quot;static type&quot; can easily be confused with the declared type of a declaration or expression.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>117250</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-01-15 22:28:11 +0000</bug_when>
    <thetext>The proposal was accepted. Changes to clarify that static type is a U-type were left at the editor&apos;s discretion.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>