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 1688 - simplifying the definition of AtomizeAtomic
Summary: simplifying the definition of AtomizeAtomic
Status: CLOSED DUPLICATE of bug 1576
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-17 21:40 UTC by Fred Zemke
Modified: 2005-09-06 13:05 UTC (History)
0 users

See Also:


Attachments

Description Fred Zemke 2005-07-17 21:40:53 UTC
4.1.5 Function calls
Comments on the definition of [Expr]AtomizeAtomic(SequenceType):

a) In the first case, where the result if fn:data(Expr),
you have the judgment Expr:Type.  I think you mean
statEnv |- Expr:Type, since type inferencing always occurs in
the context of the static environment group.

b) The exclusion "and not (Type=empty)" is unnecessary since there
is no harm in invoking fn:data(()).  The parameter type of
fn:data() is item()* so it is already defined on the empty
sequence.

c) The variable Type is a free variable with no quantification.
You cannot mean universal quantification, since 
(for all Type)(statEnv |- Expr:Type) can never be true.
You must mean (there exists Type)[Expr:Type and not (Type=empty)].

d) Instead of "Expr : Type and not (Type = empty)", you could
just write "not (Expr : empty)", which has the advantage of
eliminating the variable Type.

e) The judgment 
SequenceType <: xdt:anyAtomicType* is not defined because the 
<: relationship holds between two Types.  You need to first
transform the SequenceType into its equivalent Type and then
you can test this relationship.  Thus the condition is
[SequenceType]sequencetype <: xdt:anyAtomicType*

f) The definition will read better if you place the "if" clause
around the rule rather than nested within it.

The summary of this analysis is that the rule is better
expressed:

If [SequenceType]sequencetype <: xdt:anyAtomicType* 
then fn:data(Expr)
else Expr
Comment 1 Jerome Simeon 2005-07-21 18:47:11 UTC
(a), (b), (c), and (d) will be better handled, by removing "and Expr : Type and
not(Type=empty)" in the first case of the definition of
[Expr]AtomizeAtomic(SequenceType). See also bug 1576.

(e) is correct and should be fixed as suggested.

(f) is editorial. I think we should avoid using:

If [SequenceType]sequencetype <: xdt:anyAtomicType* 
then fn:data(Expr)
else Expr

which looks like XQuery, but isn't XQuery. We cannot actually
write this as a proper normalization rule since
[SequenceType]sequencetype <: xdt:anyAtomicType*
is not an acceptable expression.

- Jerome

Comment 2 Jerome Simeon 2005-07-22 16:12:20 UTC

*** This bug has been marked as a duplicate of 1576 ***