[Bug 11352] %nondeterministic and independent compilations of modules

http://www.w3.org/Bugs/Public/show_bug.cgi?id=11352

--- Comment #4 from Jonathan Robie <jonathan.robie@redhat.com> 2010-11-30 18:43:36 UTC ---
In the current internal working draft, we allow user-defined functions to be
declared %deterministic or %nondeterministic, we also allow implementations to
use static analysis to determine whether a function is deterministic, and we do
not say what to do if there is a conflict between the two:

<quote>
A function declaration may use function annotations to specify that a function
is %deterministic (which is the default) or %nondeterministic. [Definition: A
deterministic function is a function that always evaluates to the same result
if it is invoked multiple times with the same arguments during the evaluation
of a query.] [Definition: A nondeterministic function is a function that is not
guaranteed to always return the same result when it is invoked multiple times
with the same arguments during the evaluation of a query.] It is a static error
[err:XQST0106] if a function's annotations contain more than one annotation
named %deterministic or %nondeterministic. An XQuery processor can use static
analysis to determine whether a user-defined function is deterministic.
</quote>

F&O has a more precise definition of nondeterministic. At Oxford, we agreed to
use this definition in both specifications, changing it from 'stable' to
'nondeterministic' (see http://www.w3.org/Bugs/Public/show_bug.cgi?id=8221#c2).

See:

http://www.w3.org/XML/Group/qtspecs/specifications/xpath-functions-30/html/Overview.html#stable
http://www.w3.org/XML/Group/qtspecs/specifications/xpath-functions-30/html/Overview.html#dt-identical

So you can declare whether a function is deterministic, and we have a precise
definition of determinism. At present, we allow users to declare a
nondeterministic function %deterministic, and we give implementations no
guidance whether to raise an error in this case, or what error to raise if they
so choose. 

I think we should do one of the following:

1. Require an implementation to raise an error if the functions determinism (as
determined by static analysis) does not match its declaration. This is my
preferred option.
2. If we can't get consensus for that, allow an implementation to raise an
error in this case, and specify the error. Make it implementation-defined
whether the error is actually raised.

I'm not convinced that the default should be 'deterministic'. Given the
definition of deterministic in F&O, it's easy enough to determine, statically,
whether a function is deterministic or not. Perhaps we should simply require
implementations to do so?

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Tuesday, 30 November 2010 18:43:39 UTC