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 3971 - More XQTS static type errors
Summary: More XQTS static type errors
Status: RESOLVED FIXED
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: 1.0.1
Hardware: PC Windows NT
: 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:
: 4088 4164 4182 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-11-14 20:16 UTC by Bill Patton
Modified: 2007-09-14 12:38 UTC (History)
1 user (show)

See Also:


Attachments
XQTS static type errors (35.72 KB, text/plain)
2006-11-14 20:17 UTC, Bill Patton
Details

Description Bill Patton 2006-11-14 20:16:11 UTC
The attached file contains 64 possible static type errors in XQTS 1.0.1 that were automatically generated while running XQuantum 1.02 against the test suite with static type checking turned on.

I have not investigated the errors in detail.  They offer a good starting
point for someone who wishes to investigate them further.  The test suite
should be updated to include any actual errors so that implementations
with static typing can pass the tests.

It would be helpful if XQTS "expected results" were structured to allow
testing with and without static typing.  Perhaps both an answer and an error should be allowed.

I have listed fixes for the last few uses cases at the end of the
attached file.

Bill Patton
(678) 533-4405
Comment 1 Bill Patton 2006-11-14 20:17:52 UTC
Created attachment 443 [details]
XQTS static type errors
Comment 2 Frans Englich 2006-12-15 17:44:01 UTC
*** Bug 4088 has been marked as a duplicate of this bug. ***
Comment 3 Tim Mills 2007-01-09 12:35:39 UTC
*** Bug 4164 has been marked as a duplicate of this bug. ***
Comment 4 Tim Mills 2007-01-11 16:46:32 UTC
With reference to K-NumericAdd-38, from my reading of the XQuery spec, it is unclear as to whether a static typing implementation should raise XPTY0004 during type checking when one of the arguments to the operator is the empty sequence and the other is of a type inappropriate to that operator.

From XQuery section 3.4:

"Each operand is evaluated by applying the following steps, in order:

1. Atomization is applied to the operand. The result of this operation is called the atomized operand.
2. If the atomized operand is an empty sequence, the result of the arithmetic expression is an empty sequence, and the implementation need not evaluate the other operand or apply the operator. However, an implementation may choose to evaluate the other operand in order to determine whether it raises an error.
3. If the atomized operand is a sequence of length greater than one, a type error is raised [err:XPTY0004]."

i.e. By stage (2) we may already have determined that the operator need not be applied; we know the result must be the empty sequence and there is no need to ensure that the operands are valid for the operator.

That said, the formal semantics spec doesn't seem to specify that in the static typing rules (section C.2), although in the dynamic evaluation description it does specify this behaviour.

The tests K-NumericAdd-40 nodecomparisonerr-1, K-NodeSame-2, nodecomparisonerr-2, K-NodeBefore-1, K-NodeBefore-2, nodecomparisonerr-3, K-NodeAfter-1, K-NodeAfter-2 raise similar issues.

Could someone please clarify this issue?

(:*******************************************************:)
(: Test: K-NumericAdd-38                                 :)
(: Written by: Frans Englich                             :)
(: Date: 2006-10-05T18:29:36+02:00                       :)
(: Purpose: Arithmethics involving operands of integer type but with wrong cardi
nality. :)
(:*******************************************************:)
empty((1, 2) + ())
Comment 5 Tim Mills 2007-01-11 16:54:53 UTC
*** Bug 4182 has been marked as a duplicate of this bug. ***
Comment 6 Tim Mills 2007-01-11 17:06:51 UTC
Regarding K-SeqExprTreat-11, 12 and 15, you might find some of the discussion
in bug report 3818 to be relevant.
Comment 7 Tim Mills 2007-01-11 17:14:34 UTC
I believe nametest-9 to be correct.  Quoting from the formal semantics spec,

"A computed element constructor creates a new element with either the type annotation xs:untyped (in strip construction mode), or with the type annotation xs:anyType (in preserve construction mode)"

and therefore that the type assigned to $var does not permit you to deduce the error "path does not contain empty-node-list".

: Name: nametest-9 :)
(: Description: Name test that attempts to select non-existent nodes from a newly constructed.:)
(: Use fn:count to avoid empty file.  :)

(: insert-start :)
declare variable $input-context1 as document-node() := document { <doc/> };
(: insert-end :)

let $var := <a attr1 = "abc1"><b attr2 = "abc2">context2</b></a>
return
  fn:count(($var/empty-node-list)[1])
Comment 8 Tim Mills 2007-01-12 11:21:56 UTC
I believe:

Constr-elem-empty-3
Constr-elem-empty-4
Constr-cont-adjtext-3
Constr-cont-adjtext-4

to be correct for similar reasons to those outlined above for nametest-9.
Comment 9 Tim Mills 2007-01-12 13:36:22 UTC
The errors found in:

K-FilterExpr-82
K-FilterExpr-83
K-FilterExpr-84
K-FilterExpr-85

stem from the differences between the descriptions of fn:boolean in F+O and FS.  This is discuessed in bug 4024.

If we implement the xs:boolean static typing rule in Formal Semantics we found about 120 further errors over those that we have already reported, including ST-WhereExpr001, ST-WhereExpr002 and statictyping-7.
Comment 10 Frans Englich 2007-01-12 18:52:35 UTC
An attempted fix has been committed to CVS, and should be part of XQTS_current.zip. Feel free to verify that the fix is acceptable, and if so, change status to CLOSED. If the attempted fix is not acceptable, reopen this report.

If no opinion about this resolution is expressed within two weeks, it will be closed.

Along with the fix for this report, was committed fixes for other reports as well. Also, a significant amount of new tests were added to cover missing areas and changes in the specifications.
Comment 11 Tim Mills 2007-01-17 11:15:52 UTC
Not fixed:

fn-intersect-node-args-003
K-WhereExpr-2

Fixed or no change required:

nametest-9
K-RangeExpr-31
K-RangeExpr-32
K-FilterExpr-82
K-FilterExpr-83
K-FilterExpr-84
K-FilterExpr-85
K-FilterExpr-82
K-NumericAdd-40
K-NumericAdd-51
K-NumericAdd-52
K-NumericAdd-53
K-NumericAdd-54
K-NumericAdd-55
K-NumericAdd-56
K-NumericAdd-57
K-NumericAdd-58
K-NumericAdd-61
K-NumericAdd-62
K-GenCompEq-34
K-GenCompEq-35
nodecomparisonerr-1
K-NodeSame-1
K-NodeSame-2
nodecomparisonerr-2
K-NodeBefore-1
K-NodeBefore-2
nodecomparisonerr-3
K-NodeAfter-1
K-NodeAfter-2
Constr-elem-empty-3
Constr-elem-empty-4
Constr-cont-adjtext-3
Constr-cont-adjtext-4
ForExprType002
ForExprType015
K-WhereExpr-1
K-QuantExprWith-18
K-SeqExprCast-144
K-SeqExprTreat-11
K-SeqExprTreat-12
K-SeqExprTreat-15
K-FunctionProlog-18
K-FunctionProlog-19
K-FunctionProlog-25
K-FunctionProlog-30
K-FunctionProlog-39
K-FunctionProlog-58
fn-name-16
K-SeqIndexOfFunc-12
K-SeqIndexOfFunc-14
K-SeqDistinctValuesFunc-7
K-SeqDistinctValuesFunc-8
K-SeqRemoveFunc-14
K-SeqRemoveFunc-15
K-SeqOneOrMoreFunc-3

Whether any of these require further attention depends on the clarifications of the points made in earlier comments.
Comment 12 Frans Englich 2007-01-21 12:45:55 UTC
A fix has been attempted in CVS, and XQTS_current.zip has been updated to contain the new change. If it can be verified that the change is correct, it would be appreciated.

If this resolution is satisfiable, feel free to change status to closed. Otherwise, reopen this report. If no opinion on the resolution is expressed within two weeks, I will change status to closed.

This change to this report was part of a batch-change of several reports.
Comment 13 Tim Mills 2007-01-22 08:43:48 UTC
K-WhereExpr-2 is now fixed.  Thanks.
Comment 14 Tim Mills 2007-01-22 08:45:29 UTC
This bug is still outstanding.

The argument to fn:root needs to be a zero-or-one sequence, but is statically typed as a zero-or-more sequence.

(:*******************************************************:)
(: Test: fn-intersect-node-args-003.xq                   :)
(: Written By: Ravindranath Chennoju                     :)
(: Date: Tue Jun 14 03:34:54 2005                        :)
(: Purpose: arg: node                                    :)
(:*******************************************************:)

(: insert-start :)
declare variable $input-context external;
(: insert-end :)

$input-context/bib/book[3]/title intersect root($input-context/bib/book[3]/title
)
Comment 15 Frans Englich 2007-01-22 08:58:28 UTC
Yes, closing this report was wrong. I forgot that there was a test other than those I have responsibility for. Reassigning to Ravindranath.
Comment 16 Frans Englich 2007-09-14 09:34:51 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 17 Tim Mills 2007-09-14 12:38:24 UTC
That fixes it for Anglo.  Thanks.