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 1625 - Static Typing Feature may find a type error that the dynamic evaluaton would miss
Summary: Static Typing Feature may find a type error that the dynamic evaluaton would ...
Status: CLOSED INVALID
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Formal Semantics 1.0 (show other bugs)
Version: Last Call drafts
Hardware: PC Windows 2000
: 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-15 01:20 UTC by Fred Zemke
Modified: 2005-07-26 15:50 UTC (History)
0 users

See Also:


Attachments

Description Fred Zemke 2005-07-15 01:20:44 UTC
3.2.1 Processing model
Regarding the dynamic evaluation phase,
It says "While implementations are free to implement different
processing models, the [XPath/XQuery] static semantics relies on
the existence of a static type analysis phase that precedes any
access to the input data. Statically typed implementations are
required to find and report type errors during static analysis,
as specified in this document. Dynamically typed implementations
are required to find and report type errors during evaluation, but
are permitted to report them during static analysis."  This
paragraph gives the impression that, for a given [expression/query]
EQ, the set of type errors that might be found for EQ using
an implementation that supports the Static Typing Feature will
be precisely the same set of type errors that would be found
during dynamic execution if the implementation does not support
the Static Typing Feature.  However, XQuery has an example in
which a note asserts that the example will fail under Static
Typing Feature with a type error, but succeed in the dynamic
phase if there is no Static Typing Feature.  Specifically, the
Static Typing Feature requires the discovery of all potential
typing errors, for example, passing a value of type item()* to an
argument of type item()+, whereas the dynamic evaluation phase
will not look for this error; it will only look for an attempt
to pass the empty sequence to an argument of type item()+.  Thus
the set of type errors considered by the two phases is actually
quite different.  One looks for potential errors, the other looks
for actual errors.  This should be clarified here.
Comment 1 Jerome Simeon 2005-07-21 00:18:09 UTC
This part of the processing model talks about dynamic errors and type errors
(when the implementation does not perform static typing), which can be still
raised statically if an implementation can detect that the error will
necessarily occur at run time. This is somewhat orthogonal from the issue of
static typing.

This is somewhat editorial here. We may want to replace the following sentence:

<<
A document type has an optional content type. If no content type is given, then
the type is treated as being the wildcard type for documents, i.e., a sequence
of text and element nodes.
>>

By the corresponding sentences taken from the XQuery book:

<<
If the Static Typing Feature is in effect, all type errors are detected during
static analysis and serve to inhibit the dynamic evaluation phase.

Even though static typing can catch many type errors before an expression is
executed, it is possible for an expression to raise an error during evaluation
that was not detected by static analysis.
>>



- Jerome and Michael
Comment 2 Fred Zemke 2005-07-25 19:26:02 UTC
Actually, I see that my comment was quoting a sentence in the 4 April 2005
draft, that has been removed in the 3 June 2005 draft, so I withdraw the
comment.
Comment 3 Paul Cotton 2005-07-25 19:30:34 UTC
Changing status to INVALID since Fred has indicated that there is no problem.

/paulc