W3C home > Mailing lists > Public > public-qt-comments@w3.org > December 2010

Re: [Bug 10848] [XQuery11] Statically detecting errors in try/catch and conditional expressions

From: Michael Kay <mike@saxonica.com>
Date: Wed, 08 Dec 2010 14:52:30 +0000
Message-ID: <4CFF9BAE.10105@saxonica.com>
To: bugzilla@jessica.w3.org
CC: public-qt-comments@w3.org
On 07/12/2010 22:22, bugzilla@jessica.w3.org wrote:
> http://www.w3.org/Bugs/Public/show_bug.cgi?id=10848
>
> --- Comment #4 from Jonathan Robie<jonathan.robie@redhat.com>  2010-12-07 22:22:22 UTC ---
> The f2f minutes from Lyon indicate this bug was closed:
>
> http://lists.w3.org/Archives/Member/w3c-xsl-query/2010Nov/0006.html
>
> However, it is not closed, and I am not certain how it was resolved. Can
> someone please record their interpretation of the minutes here, so it's clear
> what the intended resolution was?
>
Rightly or wrongly, the bug was closed with the decisions recorded in 
the minutes, quoted below:

DECISION: change "an expression" to "Query Body" in XQuery 2.3.1:
      "Independently of whether the Static Typing Feature is in effect, 
if an
      implementation can determine during the static analysis phase that the
      evaluation of the QueryBody would necessarily raise a type error or a
      dynamic error, the implementation may (but is not required to)
report that
      error during the static analysis phase. However, the fn:error()
function
      must not be evaluated during the static analysis phase."
      Close http://www.w3.org/Bugs/Public/show_bug.cgi?id=10848
      This does not close
      http://www.w3.org/Bugs/Public/show_bug.cgi?id=11171

This text was further refined by the following decision:

DECISION: Change text in 2.3.1:
    Independently of whether the Static Typing Feature is in effect, if
an implementation can determine during the static analysis phase that an
expression, if evaluated, would necessarily raise a type error or a
dynamic error, the implementation may (but is not required to) report
that error during the static analysis phase.
    - to -
    Independently of whether the Static Typing Feature is in effect, if
an implementation can determine during the static analysis phase that a
query body, if evaluated, would necessarily raise a dynamic error or an
expression, if evaluated, would necessarily raise a type error, the
implementation may (but is not required to) report that error during the
static analysis phase.

DECISION: Remove the sentence "However, the fn:error() function must not
be evaluated during the static analysis phase." from 2.1.3, and add a
note to illustrate the differences introduced by the first sentence.

The change from "Query Body" to "expression" was considered sufficient 
to ensure that dynamic errors could only be reported early if they would 
necessarily occur while evaluating the query body (that is, the 
query-as-a-whole), as distinct from doing early evaluation of some 
subexpression within a function that might never be evaluated in real life.

I'm sure someone pointed out that this textual change needed adaptation 
for XPath, where "Query Body" needs replacing by "top-level expression" 
or somesuch, but that ramification was apparently missed by the 
minute-taker.

Personally, I remain of the view that we should avoid temporal words 
like "during" that suggest the static analysis and dynamic evaluation 
phases cannot overlap in time. I would prefer a model where the static 
analysis task only does static analysis, and the dynamic evaluation task 
only does dynamic evaluation, but where dynamic evaluation is allowed to 
start before static analysis finishes - that is, there is a functional 
dependency between them, but no temporal dependency. I think that 
approach would greatly simplify the exposition, as well as better 
reflecting the architecture of implementations that do just-in-time 
compilation.

Michael Kay
Saxonica
Received on Wednesday, 8 December 2010 14:52:59 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:33 UTC