[Bug 5459] [FS] Static type analysis for the fn:abs, fn:ceiling, fn:floor, fn:round, and fn:round-half-to-even functions

http://www.w3.org/Bugs/Public/show_bug.cgi?id=5459

           Summary: [FS] Static type analysis for the fn:abs, fn:ceiling,
                    fn:floor, fn:round, and fn:round-half-to-even functions
           Product: XPath / XQuery / XSLT
           Version: Recommendation
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Formal Semantics
        AssignedTo: jmdyck@ibiblio.org
        ReportedBy: oliver@cbcl.co.uk
         QAContact: public-qt-comments@w3.org


The static type analysis rules for fn:abs, fn:ceiling, fn:floor, fn:round, and
fn:round-half-to-even are defined in section 7.2.3:

The second sentence reads:
Note that the fact that the type should be the least is cannot expressed by the
inference rule notation used here.

Firstly, the phrase "least is cannot expressed by" makes no sense - I assume we
are looking for the least type satisfying the inference rule.

Consider an argument of type numeric(), then the only type satisfying the rule
is xs:double.  If the argument has (for example) an xs:integer value, the
return type is xs:integer which disagrees with this inferred type.

It seems that typing rules similar to those in section C.2 need to be applied
in this case.

Received on Thursday, 7 February 2008 13:57:21 UTC