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 8221 - deterministic / stable
Summary: deterministic / stable
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 3.0 (show other bugs)
Version: Working drafts
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-06 19:00 UTC by Jonathan Robie
Modified: 2010-09-03 21:46 UTC (History)
1 user (show)

See Also:


Attachments

Description Jonathan Robie 2009-11-06 19:00:53 UTC
Are deterministic and stable the same or different? Do we really need both concepts?

Should F&O define the term 'deterministic', which is widely used in XQuery?

See
http://lists.w3.org/Archives/Member/w3c-xsl-query/2009Oct/0115.html

Note: 'deterministic' and 'stable' each occur in our grammar. We should make sure that the concepts we use in our documents and keywords correspond.
Comment 1 Michael Kay 2010-01-13 13:28:16 UTC
Allow me to add a side-issue to this bug: in defining what it means for a function to be stable, the F+O spec defines a notion of two values being "identical". (Section 1.6.3). This definition should be amended so that NaN is identical to NaN.
Comment 2 Jonathan Robie 2010-09-03 21:46:50 UTC
Here is the resolution from the Oxford face-to-face:

DECISION - execution scope is the status quo (e.g. in F&O) and is adopted
e.g. for top-level evaluation of a query or transformation.

[long discussion of terms]

DECISION - deterministic and nondeterministic [[
    A fn is deterministic if all calls within an execution scope
    and with identical arguments return an identical result.
    That result may be implementation defined/depedent
    (e.g. in the order of items in a sequence)

    If the function is dependent on the dynamic context, we
    regard it as deterministic treating that part of the context
    as an implicit argument, so if the context and arguments are
    the same the result must be the same.

    All other functions is non-deterministic.

    Side-effecting and determinism are orthogonal
]]


focus-dependent/independent or
      problem - focus has a defined meaning that's more specific

context-dependent/independent not also needed

DECISION [[
      A function is focus-dependent if it needs access to the
      current focus, otherwise it's focus-independent

      A function is context-dependent if it needs access to
      the dynamic context - e.g. doc(), current-dateTime().
      This is a superset of focus-dependent functions.
      Otherwise it's context-independent.

      All focus-dependent functions are also context-dependent.
]]


ACTION A-444-03: editors to use these terms (execution scope,
deterministic/non-deterministic, focus-dependent/focus-independent,
context-dependent, context-independent) to classify the existing
functions and to express stable/deterministic in terms of them.

Note - updating functions are not inherently non-deterministic,
but have an implicit extra return value.