Re: What is a pragma?

>> We take the position that conformant interpretation of pragmas should
>> not alter the semantics of an ixml grammar.
>
> What does "the semantics of an ixml grammar" mean?
>
> What does it mean to alter the semantics?

I thnk what I had in mind was something like the following: if a grammar
without pragmas recognizes a certain set of sentences, adding pragmas to
the grammar shouldn’t change the set of sentences it recognizes.

>> (You can’t have a conformant pragma that changes the rules!)
>
> How would that be enforced?
>
> Is the enforcement mechanism that if someone defines a pragma that
> changes the rules (whatever that might be taken to mean), other people
> have the right to point at that pragma and say "that one is a
> non-conforming pragma"?

Yes. Except that I’d probably phrase that as “use of this pragma makes
the processor behave in a non-conformant way on this grammar.”

My XProc 1.0 implementation has several features that make its behavior
non-conformant. I don’t consider this a bug, but I do require that the
user provide an explicit -i-know-this-is-requesting-non-conformant-behavior
switch to enable it.

> Can preservation of the semantics be tested for?  Or will it require
> human judgement?

On infinitely ambiguous grammars, it might be impossible to test for,
but I think the rule I proposed above is theoretically, if not always
practically, testable when the grammar isn’t infinitely ambigous.

>> We think Tom and Michael
>> might disagree and look forward to their spirited input :-)
>
> Do pragmas in XQuery change the semantics of the query in which they are
> embedded?  Or do they leave the semantics of the query as they are
> defined by the XQuery spec alone, even when they request that processors
> capable of evaluating the alternate expression inside the pragma
> evaluate that expression in place of the 'fallback expression'?

That’s an interesting question. If I write an XQuery pragma that returns
“3” for a fallback expression of “1 + 1”, is that a different semantic,
or just a weird query?

If I write an XQuery pragma that takes an XPath expression as an
argument and evaluates it in an environment where “+” is interpreted to
mean subtraction and “-” is interpreted to mean addition, but I write a
pragma that evaluates “3-3” for a fallback expression of “3+3”, is that
a different semantic, or just a weird query?

                                        Be seeing you,
                                          norm

--
Norm Tovey-Walsh
Saxonica

Received on Saturday, 29 January 2022 10:20:48 UTC