<?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>5791</bug_id>
          
          <creation_ts>2008-06-24 11:50:16 +0000</creation_ts>
          <short_desc>Static Typing: CVS: K-SeqExprInstanceOf-56, 57, 58</short_desc>
          <delta_ts>2008-06-26 12:05:50 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XML Query Test Suite</product>
          <component>XML Query Test Suite</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <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="Tim Mills">tim</reporter>
          <assigned_to name="Frans Englich">frans.englich</assigned_to>
          <cc>frans.englich</cc>
    
    <cc>jmdyck</cc>
          
          <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>20771</commentid>
    <comment_count>0</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2008-06-24 11:50:16 +0000</bug_when>
    <thetext>In addition to expecting an error, this query may also return true because it
can be answered purely through static type analysis.  Similarly for K-SeqExprInstanceOf-57.  K-SeqExprInstanceOf-58 should expect false.

(:*******************************************************:)
(: Test: K-SeqExprInstanceOf-56                          :)
(: Written by: Frans Englich                             :)
(: Date: 2007-11-22T11:31:21+01:00                       :)
(: Purpose: The fn:error() function in combination with &apos;instance of&apos;. :)
(:*******************************************************:)
error() instance of xs:integer</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20783</commentid>
    <comment_count>1</comment_count>
    <who name="Frans Englich">frans.englich</who>
    <bug_when>2008-06-24 12:54:59 +0000</bug_when>
    <thetext>A fix was attempted in CVS.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20792</commentid>
    <comment_count>2</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2008-06-24 13:46:27 +0000</bug_when>
    <thetext>I think you may have got the expected results wrong for the first two here.

It should be:

K-SeqExprInstanceOf-56 -&gt; true
K-SeqExprInstanceOf-57 -&gt; true

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20796</commentid>
    <comment_count>3</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2008-06-24 14:34:48 +0000</bug_when>
    <thetext>...and (my mistake):

K-SeqExprInstanceOf-58 -&gt; false
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20807</commentid>
    <comment_count>4</comment_count>
    <who name="Frans Englich">frans.englich</who>
    <bug_when>2008-06-24 15:20:40 +0000</bug_when>
    <thetext>I&apos;m not sure I&apos;m following, so K-SeqExprInstanceOf-56:

error() instance of xs:integer


should return true? none is an instance of xs:integer?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20811</commentid>
    <comment_count>5</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2008-06-24 16:30:51 +0000</bug_when>
    <thetext>Though strange, I think that none _is_ an instance of xs:integer.  Can someone please confirm this?

&apos;none&apos; is definitely a subtype of xs:integer.  &apos;none&apos; is a subtype of all other types.

So this query can be boiled down to the question &quot;is something shich is a subtype of xs:integer always an instance of xs:itneger&quot;.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20819</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2008-06-24 20:58:26 +0000</bug_when>
    <thetext>Is none a subtype of xs:integer? Yes.

Is none an instance of xs:integer? It&apos;s a bad question, because none denotes a type, not a value.

Instead, the proper question is something like: given an expression
    Expr instance of SequenceType
if the static type of Expr is a subtype of (the type denoted by) SequenceType, is an implementation allowed to rewrite the expression as fn:true()?

I believe you could prove that, in such a case, the only non-error outcome is the value true, and so (according to the XQuery rewriting rules) the rewrite is allowed.

The particular test case is an example of the general case, so I believe returning true is conformant. (However, I&apos;m not familiar with the extent to which the test suite caters to rewrites.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20840</commentid>
    <comment_count>7</comment_count>
    <who name="Frans Englich">frans.englich</who>
    <bug_when>2008-06-25 11:22:39 +0000</bug_when>
    <thetext>Ok, I changed the baselines as per instructed in comments #2 and #3.

A lot can be said about XQuery Formal Semantics.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20851</commentid>
    <comment_count>8</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2008-06-25 12:37:02 +0000</bug_when>
    <thetext>&gt; A lot can be said about XQuery Formal Semantics.

Only nice things I hope :)

I&apos;ll close this once I&apos;ve checked the results.  CurrentlyI can&apos;t connect to CVS - it just hangs.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20895</commentid>
    <comment_count>9</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2008-06-26 11:09:09 +0000</bug_when>
    <thetext>K-SeqExprInstanceOf-56 and K-SeqExprInstanceOf-57 are now correct.

I&apos;ve given you the wrong expected result for:

K-SeqExprInstanceOf-58

error() instance of empty-sequence()

should be true.

The reason is that &apos;empty&apos; is the same as &apos;none?&apos;.  So this is like

(something of type T) instance of T?

which is true.


</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20898</commentid>
    <comment_count>10</comment_count>
    <who name="Frans Englich">frans.englich</who>
    <bug_when>2008-06-26 11:14:28 +0000</bug_when>
    <thetext>Should be fixed in CVS.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20904</commentid>
    <comment_count>11</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2008-06-26 12:05:50 +0000</bug_when>
    <thetext>Thanks.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>