<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>1688</bug_id>
          
          <creation_ts>2005-07-17 21:40:53 +0000</creation_ts>
          <short_desc>simplifying the definition of AtomizeAtomic</short_desc>
          <delta_ts>2005-09-06 13:05:33 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Formal Semantics 1.0</component>
          <version>Last Call drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows 2000</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>1576</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Fred Zemke">fred.zemke</reporter>
          <assigned_to name="Jerome Simeon">simeon</assigned_to>
          
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>4774</commentid>
    <comment_count>0</comment_count>
    <who name="Fred Zemke">fred.zemke</who>
    <bug_when>2005-07-17 21:40:53 +0000</bug_when>
    <thetext>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 &quot;and not (Type=empty)&quot; 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 &quot;Expr : Type and not (Type = empty)&quot;, you could
just write &quot;not (Expr : empty)&quot;, which has the advantage of
eliminating the variable Type.

e) The judgment 
SequenceType &lt;: xdt:anyAtomicType* is not defined because the 
&lt;: 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 &lt;: xdt:anyAtomicType*

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

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

If [SequenceType]sequencetype &lt;: xdt:anyAtomicType* 
then fn:data(Expr)
else Expr</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5082</commentid>
    <comment_count>1</comment_count>
    <who name="Jerome Simeon">simeon</who>
    <bug_when>2005-07-21 18:47:11 +0000</bug_when>
    <thetext>(a), (b), (c), and (d) will be better handled, by removing &quot;and Expr : Type and
not(Type=empty)&quot; 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 &lt;: xdt:anyAtomicType* 
then fn:data(Expr)
else Expr

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

- Jerome

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5141</commentid>
    <comment_count>2</comment_count>
    <who name="Jerome Simeon">simeon</who>
    <bug_when>2005-07-22 16:12:20 +0000</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of 1576 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>