This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 1766 - [FS] technical: 7.2.13 The fn:subsequence function: tighter typing
Summary: [FS] technical: 7.2.13 The fn:subsequence function: tighter typing
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Formal Semantics 1.0 (show other bugs)
Version: Last Call drafts
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Jerome Simeon
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-19 23:56 UTC by Michael Dyck
Modified: 2005-09-06 13:15 UTC (History)
0 users

See Also:


Attachments

Description Michael Dyck 2005-07-19 23:56:06 UTC
7.2.13 The fn:subsequence function

"If the type of the input expression has zero or more items, then
fn:subsequence, when selecting the first item, has zero-or-one of the
prime type of the input type."
    It seems to me you could conclude the same thing regardless of which
    item was being selected. That is, replace rules 3 and 4 with

        statEnv |- Expr1 : Type1         quantifier(Type1) in { * }
        statEnv |- Expr2 : xs:double
        -----------------------------------------------------------
        statEnv |- fn:subsequence(Expr1, Expr2, 1) : prime(Type1) ?

    Also, how about:

        statEnv |- Expr1 : Type1         quantifier(Type1) in { 1, + }
        statEnv |- Expr2 : xs:double     not(Expr2 = 1)
        -----------------------------------------------------------
        statEnv |- fn:subsequence(Expr1, Expr2, 1) : prime(Type1) ?
Comment 1 Michael Rys 2005-07-20 21:41:24 UTC
This is a duplicate of comment 1728. Please check the response in bug 1728.

If you agree this resolution, please close. Otherwise, please feel free to 
reopen the bug.

*** This bug has been marked as a duplicate of 1728 ***
Comment 2 Michael Dyck 2005-07-20 21:56:49 UTC
My first suggestion is indeed a duplicate of Bug 1728. But my second suggestion 
isn't.
Comment 3 Jerome Simeon 2005-07-20 22:50:48 UTC
Sorry, it seems we missed that. However it also seems that the rationale is the
same for the second suggestion. The only reason for the specific typing rules is
to provide better static typing for Expr[Numeric] and Expr[last()]. For the
general case, people believe we are better off for now with a general rule,
which cover all cases. Hence the reason for not trying to generalize more than
necessary the specific rules.
- Jerome
Comment 4 Jerome Simeon 2005-08-31 15:13:50 UTC
The XML Query and XSLT working group have decided to close bug 1766 with no
change to spec, with the same rationale as 1728.
- Jerome