<?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>3676</bug_id>
          
          <creation_ts>2006-09-08 12:56:29 +0000</creation_ts>
          <short_desc>fn:subsequence typing rules</short_desc>
          <delta_ts>2006-10-19 20:07:42 +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>Working drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</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="Tim Mills">tim</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>11513</commentid>
    <comment_count>0</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2006-09-08 12:56:29 +0000</bug_when>
    <thetext>In the typechecking rules for fn:subsequence

http://www.w3.org/TR/xquery-semantics/#sec_fn_subsequence

we have:

statEnv |-  QName of func expands to (FN-URI,&quot;subsequence&quot;)
statEnv |-  Expr : Type      quantifier(Type) in { * }
------------------------------------------------------
statEnv  |-  QName(Expr, NumericLiteral, 1) : prime(Type) ?

This can also include quantifier +.

i.e.

statEnv |-  QName of func expands to (FN-URI,&quot;subsequence&quot;)
statEnv |-  Expr : Type      quantifier(Type) in { *, + }
------------------------------------------------------
statEnv  |-  QName(Expr, NumericLiteral, 1) : prime(Type) ?

Similarly:

statEnv |-  QName of func expands to (FN-URI,&quot;subsequence&quot;)
statEnv |-  Expr : Type      quantifier(Type) in { *, + }
------------------------------------------------------
statEnv  |-  QName(Expr, $fs:last, 1) : prime(Type) ?

and

statEnv |-  QName of func expands to (FN-URI,&quot;subsequence&quot;)
statEnv |-  Expr : Type      quantifier(Type) in { *, + }
------------------------------------------------------
statEnv  |-  QName(Expr, $fs:position, 1) : prime(Type) ?

although in the case of +, the type of the last two could be deduced as Prime(Type)) (I think!)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12041</commentid>
    <comment_count>1</comment_count>
    <who name="Jerome Simeon">simeon</who>
    <bug_when>2006-09-26 14:52:22 +0000</bug_when>
    <thetext>Tim,

Despite those rules having been checked by many people (See Bugs #2303, #1968, #1728), I believe you are right that we could and probably should cover &apos;+&apos; as well as &apos;*&apos;. I don&apos;t believe you could do better than prime(Type)? since + only
guarantees there is at least one item.

That said, I don&apos;t believe the rules are broken (in the sense of being inconsistent) so I am not sure what the working groups will want to reconsider this, considering the late stage of the process.

- Jerome</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12050</commentid>
    <comment_count>2</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2006-09-26 15:28:58 +0000</bug_when>
    <thetext>Thanks.  I think we added these rules to our implementation to prevent failing some of the XQTS tests due to static type failures.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12055</commentid>
    <comment_count>3</comment_count>
    <who name="Jerome Simeon">simeon</who>
    <bug_when>2006-09-26 16:00:18 +0000</bug_when>
    <thetext>Tim,
The XSLT and XML Query working groups have considered your comment and decided to accept the suggested changes.
Best,
- Jerome
On behalf of the XSLT and XML Query WGs</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>