<?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>2303</bug_id>
          
          <creation_ts>2005-09-26 12:23:00 +0000</creation_ts>
          <short_desc>typing for fn:subsequence() redundant</short_desc>
          <delta_ts>2005-09-29 11:01:50 +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>Last Call drafts</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>1728</dup_id>
          
          <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>6452</commentid>
    <comment_count>0</comment_count>
    <who name="Jens Teubner">jens.teubner</who>
    <bug_when>2005-09-26 12:23:01 +0000</bug_when>
    <thetext>The static typing rules for fn:subsequence() (http://www.w3.org/TR/2005/WD-
xquery-semantics-20050915/#sec_fn_subsequence) consider a number of special 
cases:

  fn:subsequence (Expr, 1, 1)
  fn:subsequence (Expr, $fs:last, 1)
  fn:subsequence (Expr, $fs:position, 1)

All of them result in the same static type, prime(Expr)?. This is not 
surprising, as the second function argument is actually completely irrelevant 
for the function&apos;s output type. The call

  fs:subsequence (Expr, 42, 1)

would as well have the same static type, prime(Expr)?. (You may add that to the 
typing rules as well :-))

Note that, as I stated in http://www.w3.org/Bugs/Public/show_bug.cgi?id=1968, it 
is hardly sensible to use $fs:last and/or $fs:position here anyway. Both 
variables are not necessarily related to Expr, but should be treated like any 
other variable here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6513</commentid>
    <comment_count>1</comment_count>
    <who name="Jerome Simeon">simeon</who>
    <bug_when>2005-09-28 10:18:13 +0000</bug_when>
    <thetext>Jens,

This issue has already been discussed in the previous last call period. The
reason for having specific typing rules only for those cases is that they cover
exactly
the cases that correspond to the normalized expressions for Expr[1] and
Expr[last()].

This was already discussed as part of Bug #1728
(http://www.w3.org/Bugs/Public/show_bug.cgi?id=1728)
Notably see Michael Rys&apos;s comment #2 in that Bug.

Best regards,
- Jerome
On behalf of the XSLT and XML Query WGs

*** This bug has been marked as a duplicate of 1728 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6576</commentid>
    <comment_count>2</comment_count>
    <who name="Jerome Simeon">simeon</who>
    <bug_when>2005-09-29 09:16:43 +0000</bug_when>
    <thetext>While processing this comment, the working group realized that the first of the
three rules related to this comment had a bug. The intent is to have
Expr[Numeric] be given a more specific type, not only Expr[1]. The rule should
be revised to
the following:

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

Thanks again for your comment on our specifications,
- Jerome
One behalf of the XML Query and XSLT WGs

</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>