FS 7.2.4 gives static typing rules for fn:boolean. Surely these typing rules should be applied to fn:not too?
The definition for fn:boolean (in F&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 "If $arg is a sequence of one or more nodes, fn:boolean returns true"?
>Should the definition of fn:boolean be changed to read "If $arg is a sequence of one or more nodes, fn:boolean returns true"? 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.
(In reply to comment #0) > FS 7.2.4 gives static typing rules for fn:boolean. Surely these typing rules > 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.
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'm marking this issue resolved-FIXED. If you agree with this resolution, please mark it CLOSED.
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'm marking this issue CLOSED.