This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 7863 - [XQuery 1.1] BNF of FunctionDecl allows user-defined functions to be nondeterministic
Summary: [XQuery 1.1] BNF of FunctionDecl allows user-defined functions to be nondeter...
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3.0 (show other bugs)
Version: Working drafts
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Jonathan Robie
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-09 21:28 UTC by Jim Melton
Modified: 2009-10-27 16:58 UTC (History)
0 users

See Also:


Attachments

Description Jim Melton 2009-10-09 21:28:20 UTC
In the WD of XQuery 1.1 currently being prepared for internal WG review, EBNF production [31] reads:

FunctionDecl 	   ::=    	"declare" ("deterministic" | "nondeterministic")? ("private" | "public")? "function" QName "(" ParamList? ")" ("as" SequenceType)? (FunctionBody | "external")

That syntax clearly allows: declare nondeterministic function X() external

However, the 6th paragraph of Section 4.17, Function Declaration, says: 

An XQuery processor can use static analysis to determine whether a user-defined function is deterministic (the syntax of function declarations does not allow a user-defined function to be declared deterministic or nondterministic).

(Note the typo: nondterministic.)

The parenthesized statement is clearly incorrect. It states (what my memory suggests is) the intent of the WG, but it is not on its face a correct observation. 

Assuming that is the WG's intent, then a way must be found to make the limitation normative. Two approaches come to mind: One would rewrite the EBNF to have two alternatives, one for user-defined functions and the other for external functions.  The other would have to define the limitation as a constraint, either by some sort of extra-grammatical constraint or by natural language in section 4.17.
Comment 1 Jonathan Robie 2009-10-27 16:58:04 UTC
In today's telcon, we agreed to add a rule to 4.17 - if a function is marked deterministic or nondeterministic, the function must be external; otherise,  it is a static error.