[Bug 11352] %nondeterministic and independent compilations of modules

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

--- Comment #7 from Daniela Florescu <dflorescu@mac.com> 2010-12-07 15:29:41 UTC ---
There are two questions about the semantics of %(non)deterministic annotations.

1. What is the required semantics in case the user's declaration is
inconsistent
with what is automatically inferred by the compiler, and
2. What is the default annotation

My understanding of the current status quo is that:
1. Non defined
2. Deterministic

My own answers to each question is bellow:

1. About the inconsistency: there are two cases:
a. The user specifies  (explicitly or using the default behavior) that a
function
is non-deterministic, while the compiler infers that it is deterministic.
This is not a semantic problem, it is just an optimization problem. A
deterministic function 
can be used anywhere a non-deterministic function can be used (but not the
other
way around), but better optimization can be done in case of deterministic
functions.

The standard should allow  an XQuery implementation to use
the most restrictive annotation (aka deterministic) that is inferred by the
compiler,
in the same way we allow XQuery implementations to use a more precise type
inference (as opposed to the standard one) to improve optimization.

b. The user specifies  (explicitly or using the default behavior) that a
function
is deterministic, while the compiler infers that it is non-deterministic.

This is a semantic error: user had wrong expectations about the XQuery code
she/he has written.

The standard should require XQuery implementations to raise an error in this
case.

2. In order to be backwards compatible with the semantics of XQuery 1.0
functions that does
allow non-determinism (as Andrew pointed out), I do not see any other solution
then to make the
default  non-deterministic.

( I do not think that making the default different in XQuery 1.0 vs. XQuery 3.0 
is an acceptable solution.)

-- 
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, 7 December 2010 15:29:44 UTC