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 4274 - Static typing of Comp-notation-*
Summary: Static typing of Comp-notation-*
Status: CLOSED FIXED
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: unspecified
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Frans Englich
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
: 5056 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-01-23 13:44 UTC by Nick Jones
Modified: 2007-10-02 10:13 UTC (History)
1 user (show)

See Also:


Attachments

Description Nick Jones 2007-01-23 13:44:59 UTC
Comp-notation-*, while it should be possible to infer the types correctly, unfortunately fail to static type check when following the rules in the formal semantics due to a quantifier mismatch

(: Name: Comp-notation-1 :)
(: Written by: Andreas Behm :)
(: Description: notation comparison :)

(: insert-start :)
import schema namespace myns="http://www.example.com/notation";
declare variable $input-context as document-node(schema-element(myns:allTypes)) external;
(: insert-end :)

fn:not($input-context//*:NOTATION1 eq $input-context//*:NOTATION3)


// normalizes to descendant-of-self() [FS 4.2]

This always has quantifier '*' [FS 8.2.2.1.8]

The step expression becomes a FLWOR expression [FS 4.2]

This returns a type with the quantifier of the descendant-or-self() [FS 4.8.2]

statEnv |-  Expr1 : Type1
...
-------------------------
statEnv |-  for $VarName1 in Expr1 return Expr2 : Type2 ยท quantifier(Type1)

Therefore the static typing of the path expression will always have the '*' quantifier which causes a static typing exception with the operators, like eq, which expect a quantifier of one.

If should theoretically be possible to infer a type without the '*' quantifier for the descendant-or-self() step in these tests due to the schema information, so I can report this as a bug in the Formal Semantics instead if people think that is more appropriate.

Otherwise, could // be replaced by the full path?
Comment 1 Frans Englich 2007-09-14 09:34:53 UTC
A fix has been attempted in CVS, XQTS_current.zip is updated.

If the resolution is satisfactory, feel free to change status to CLOSED. Otherwise, reopen this report. If no feedback is returned within two weeks, status will be changed to CLOSED. Thanks for reporting!
Comment 2 Nick Jones 2007-09-14 11:04:13 UTC
Thanks. All of them looked fixed except Comp-notation-11 which doesn't parse (missing right parenthesis); I think also the first exactly-one is in the wrong place (should be inside the boolean?)
Comment 3 Michael Kay 2007-09-29 18:27:16 UTC
comp-notation-11 seems to parse OK, but it is now comparing a boolean to a notation because the parens are in the wrong place.

(When I see queries that have been made as unreadable as this, I really wonder what attraction anyone sees in implementing the static typing rules.)
Comment 4 Frans Englich 2007-10-01 12:15:15 UTC
*** Bug 5056 has been marked as a duplicate of this bug. ***
Comment 5 Frans Englich 2007-10-02 09:51:03 UTC
A fix has been attempted in CVS, XQTS_current.zip is updated.

If the resolution is satisfactory, feel free to change status to closed. Otherwise reopen this report. If no feedback is given within two weeks, status will be set to closed.
Comment 6 Nick Jones 2007-10-02 10:13:55 UTC
Thanks. It now works.