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 1580 - [FS] technical: 4.1.5 Function Calls: complicated by pseudo-functions
Summary: [FS] technical: 4.1.5 Function Calls: complicated by pseudo-functions
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Formal Semantics 1.0 (show other bugs)
Version: Last Call drafts
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Jerome Simeon
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-14 04:12 UTC by Michael Dyck
Modified: 2006-10-20 00:00 UTC (History)
0 users

See Also:


Attachments

Description Michael Dyck 2005-07-14 04:12:36 UTC
4.1.5 Function Calls

"Otherwise, the function signatures matching the function name and arity
are retrieved from the static environment."
    The XQuery and XPath specs both state:
        "Each function is uniquely identified by its expanded QName
        and its arity (number of parameters)."
    So am I correct in thinking that there would be *multiple* signatures
    only in the cases of the "arithmetic operator pseudo-functions" and
    the "comparison pseudo-functions"?

    Is it also true that the "union of atomic types" exceptions in the STA
    are only relevant to the pseudo-functions? (I.e., for any other call,
    you'd get the same result if those exceptions weren't there.)

    If so, then details that are only pertinent to pseudo-functions are
    being allowed to complicate the normal case. Why? It seems to me that
    this section would be much improved by banishing those details to B.2.
Comment 1 Michael Dyck 2005-07-21 04:25:09 UTC
More explicitly:

    statEnv.funcType:
        This should map an (expanded-QName,arity) pair to a single
        function signature. Change the rules in 4.1.5 appropriately.
        For the "pseudo-functions", supply a suitably general signature
        (although it doesn't really matter since they have special STA
        rules anyhow).

    4.1.5 / STA / rule 2:
        Indicate that 'expanded-QName' is that of a pseudo-function.
        Move the resulting rule to B.2.

    4.1.5 / STA / rule 3:
        Remove the 'not' premises.

    B.2
        Add these rules:

            [expanded-Qname is that of a binary pseudo-function]
            Type1 is not a union of atomic types
            Type2 is not a union of atomic types
            statEnv |- Type1 can be promoted to Type1'
            statEnv |- Type2 can be promoted to Type2'
            operator type for Type1' and Type2' is Type3'
            --------------
            statEnv |- expanded-QName(Type1, Type2) : Type3'

            [expanded-Qname is that of a unary pseudo-function]
            Type1 is not a union of atomic types
            statEnv |- Type1 can be promoted to Type1'
            operator type for Type1' is Type3'
            --------------
            statEnv |- expanded-QName(Type1) : Type3'

        Rewrite the existing B.2 / STA as instances of
            statEnv |- expanded-QName(Type1, ...) : Type
        instead of
            statEnv |- QName(Expr1, ...) : Type
        (See Bug 1755.)

        Clarify the interaction/relationship between the rules handling
        promotion and the rules handling optionality.
Comment 2 Jerome Simeon 2005-07-27 15:14:52 UTC
We think this is a good suggestion and we should accept the comment
and fix typing rules as suggested. 
Comment 3 Michael Dyck 2005-07-28 02:22:03 UTC
(In reply to comment #1)
> 
>     statEnv.funcType:
>         This should map an (expanded-QName,arity) pair to a single
>         function signature.

Similarly, the domain of dynEnv.funcDefn should be changed to
(expanded-QName,arity).
Comment 4 Jerome Simeon 2005-08-31 15:23:52 UTC
The XML Query and XLST WGs have accepted the comment and the suggested fix.
- Jerome
Comment 5 Michael Dyck 2006-05-09 05:55:50 UTC
In the CR, B.2 / STA / rule (2|3|4|5|6|7) went from
    QName(Expr1,...)
to
    expanded-QName(Expr1,...)
but not to
    expanded-QName(Type1,...)
Comment 6 Jerome Simeon 2006-05-09 15:07:04 UTC
The comment was not implemented properly in B.2. Fixed the corresponding rules to use the expanded-QName(Type1,...) form.
- Jerome