<?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>5651</bug_id>
          
          <creation_ts>2008-04-22 12:29:17 +0000</creation_ts>
          <short_desc>[FS] Static typing rules for fn:boolean.</short_desc>
          <delta_ts>2008-08-18 07:20:01 +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>PC</rep_platform>
          <op_sys>Windows NT</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="Oliver Hallam">oliver</reporter>
          <assigned_to name="Michael Dyck">jmdyck</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>19899</commentid>
    <comment_count>0</comment_count>
    <who name="Oliver Hallam">oliver</who>
    <bug_when>2008-04-22 12:29:17 +0000</bug_when>
    <thetext>FS 7.2.4 gives static typing rules for fn:boolean.  Surely these typing rules should be applied to fn:not too?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19901</commentid>
    <comment_count>1</comment_count>
    <who name="Oliver Hallam">oliver</who>
    <bug_when>2008-04-22 13:13:30 +0000</bug_when>
    <thetext>The definition for fn:boolean (in F&amp;O 15.1.1) says:
If $arg is a sequence whose first item is a node, fn:boolean returns true.

However the static typing rules reject any sequence of more than one items that is not a sequence of nodes.

And so fn:boolean applied to the sequence type (xs:node(), xs:integer) fails to type check despite the fact that every value of this type gives the result true().

Should the definition of fn:boolean be changed to read &quot;If $arg is a sequence of one or more nodes, fn:boolean returns true&quot;?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19902</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2008-04-22 13:25:00 +0000</bug_when>
    <thetext>&gt;Should the definition of fn:boolean be changed to read &quot;If $arg is a sequence
of one or more nodes, fn:boolean returns true&quot;?

No, absolutely not. This would mean that a dynamic implementatation would have to read the whole sequence, perhaps containing a million nodes, before it can establish that there are no atomic values in the sequence and it can therefore return true.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19938</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2008-04-24 20:43:19 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; FS 7.2.4 gives static typing rules for fn:boolean.  Surely these typing rules
&gt; should be applied to fn:not too?

Yes, I think they should, since fn:not makes an implicit call to fn:boolean, which can raise a type error. I propose that we tweak the rule in FS 7.2.4 to handle fn:not as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>19988</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2008-04-29 18:46:19 +0000</bug_when>
    <thetext>At its meeting today, the WGs approved the proposal of comment #3 (addressing the original comment #0), so this will be reflected in an FS erratum at some point.

If you wish to pursue the matter you brought up in comment #1, please raise it as a separate bug, against F+O.

Consequently, I&apos;m marking this issue resolved-FIXED. If you agree with this resolution, please mark it CLOSED.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21586</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2008-08-18 07:20:01 +0000</bug_when>
    <thetext>This issue has been entered as FS erratum E027, and its fix has been
committed to the source files for the next edition of the FS document.
Consequently, I&apos;m marking this issue CLOSED.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>