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 3676 - fn:subsequence typing rules
Summary: fn:subsequence typing rules
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Formal Semantics 1.0 (show other bugs)
Version: Working drafts
Hardware: PC Windows XP
: 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: 2006-09-08 12:56 UTC by Tim Mills
Modified: 2006-10-19 20:07 UTC (History)
0 users

See Also:


Attachments

Description Tim Mills 2006-09-08 12:56:29 UTC
In the typechecking rules for fn:subsequence

http://www.w3.org/TR/xquery-semantics/#sec_fn_subsequence

we have:

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

This can also include quantifier +.

i.e.

statEnv |-  QName of func expands to (FN-URI,"subsequence")
statEnv |-  Expr : Type      quantifier(Type) in { *, + }
------------------------------------------------------
statEnv  |-  QName(Expr, NumericLiteral, 1) : prime(Type) ?

Similarly:

statEnv |-  QName of func expands to (FN-URI,"subsequence")
statEnv |-  Expr : Type      quantifier(Type) in { *, + }
------------------------------------------------------
statEnv  |-  QName(Expr, $fs:last, 1) : prime(Type) ?

and

statEnv |-  QName of func expands to (FN-URI,"subsequence")
statEnv |-  Expr : Type      quantifier(Type) in { *, + }
------------------------------------------------------
statEnv  |-  QName(Expr, $fs:position, 1) : prime(Type) ?

although in the case of +, the type of the last two could be deduced as Prime(Type)) (I think!)
Comment 1 Jerome Simeon 2006-09-26 14:52:22 UTC
Tim,

Despite those rules having been checked by many people (See Bugs #2303, #1968, #1728), I believe you are right that we could and probably should cover '+' as well as '*'. I don't believe you could do better than prime(Type)? since + only
guarantees there is at least one item.

That said, I don't believe the rules are broken (in the sense of being inconsistent) so I am not sure what the working groups will want to reconsider this, considering the late stage of the process.

- Jerome
Comment 2 Tim Mills 2006-09-26 15:28:58 UTC
Thanks.  I think we added these rules to our implementation to prevent failing some of the XQTS tests due to static type failures.
Comment 3 Jerome Simeon 2006-09-26 16:00:18 UTC
Tim,
The XSLT and XML Query working groups have considered your comment and decided to accept the suggested changes.
Best,
- Jerome
On behalf of the XSLT and XML Query WGs