W3C home > Mailing lists > Public > www-math@w3.org > June 2005

Re: MathML Content and Operators

From: David Carlisle <davidc@nag.co.uk>
Date: Tue, 14 Jun 2005 23:42:02 +0100
Message-Id: <200506142242.XAA29266@penguin.nag.co.uk>
To: maths@mathsonly.com
CC: www-math@w3.org

>    I can see the use of the <csymbol> element in defining new symbolic
> operators, although I'm put off using it a little by the spec. saying
> <csymbol> can be used for "unknown or *user-defined* functions and
> symbols". 

> The phrase 'user-defined function' puts me off its use, since
> differential operators (a) are widely used and should not be 'defined'
> by any one user (unless they are being 'redefined' in a particular
> context), (b) they aren't functions or really symbols, but instead
> operators (and as such require things like bound variables?).

You can use <bvar> and all other mathml qualifiers with csymbol.

user defined here means defined by someone other than the core mathml
spec. it's the mathml markup that is being defined not the function,
just as "<log/> is defined by the W3C WG", means we defined the mathml
log markup, it doesn't mean we defined the log function.

>   As I see it, operators and constructs are defined by (empty)
>   elements, while functions and symbols are defined by the contents of
>   other elements (like <ci> and <csymbol>). 

No, the way to think about it is that the general mechanism is that of
csymbol, but a fixed set of empty elements (roughly covering up to
pre-university mathematics education) are supplied as a shorthand.
<log/> is more or less
<csymbol definitionURL="http://www.w3.org/TR/MathML/appendixc.html#cedef.log">log</csymbol>

OpenMath has already been mentioned in this thread. OpenMath essentially
_only_ has <apply> and <csymbol> (with a different syntax) this means
that its syntax is more regular than mathml, there are no shorthand
elements for common symbols, but it's initial use is more complicated as
there are no symbols built in, not even for + you always have to refer
to a symbol definition (although definitions are provided covering the
same range as MathML)

>    As
 a result, the way I would like to extend the Content ML is to
>    use a new operator *empty element* in an <apply> - operators like
>    <diff /> and <partialdiff /> already exist, so why can I not use
>    <differential /> as a new child of <apply>? Since an unknown first
>    child of <apply> is interpreted as being a user-defined function,
>    is there any way to link this completely new element to a
>    definition? 

Such an extension mechanism would have been possible but wasn't the one
chosen for MathML. It would have been more difficult for users to extend
in this way and still have documents valid to a dtd or schema as the dtd
would have to be extended each time a new mathematical function was

>    For example:
>    <apply>
>      <differential /> <!-- with a definition URI somewhere in the doc. -->
>      <ci>x</ci>
>    </apply>
>    where "<ci>x</ci>" can be replaced with any expression.

csymbol is what you should use here, if you want to consider dx as a
construct in its own right rather than just a notation that's part of

>    What concerns me a little about the "definitionURL" attribute is
>    that the syntax or encoding of the target are completely
>    undefined. Additionally, most of the examples given in the
>    spec. point to human-readable URIs and resources. This means that
>    any operator defined by a MathML document using <csymbol> almost
>    certainly cannot be interpreted by a computer algebra system
>    correctly - although I see no easy way round this problem. 

Not at all. maple for example when writing out its expressions as
mathml uses the definitionurl mechanism to flag that certain csymbols
have maple definitions and these are used when the expression is read
back in.

> MathML[ExportContent](dsolve);
"<math xmlns='http://www.w3.org/1998/Math/MathML'>
   <csymbol id='id1'

Note that there isn't anything returned by that URI, but it is
interpreted in this context as meaning "the function dsolve as defined
by maple" so when this mathml is read back in, the dsolve csymbol is
converted to the maple dsolve function.

>    Just one comment on the example syntax you provided: the
>    spec. states that "The diff element is the differentiation operator
>    element for functions of a single variable." (section
> Since 'f' is a function of both 'x' and 'y', it is
>    clearly not a function of just one variable (assuming 'x' and 'y'
>    are independent). Therefore, according to the specification, it
>    would be erroneous to use <diff /> in this case (although I agree
>    totally with the use of <partialdiff /> here). 

Hmm probably you are correct here, but you could use diff with a
definitionurl that points to an extended semantics or use a different
csymbol all together. (diff is more likely to be "automatically"
converted to the correct thing  in CA symbols I would guess)

>    I'm not worried in the slightest about presentation (or the
>    conversion of Content ML to presentation), but I want to get the
>    semantics right so they can be interpreted by an algebraic system. 

This is a good approach to take of course. OpenMath takes this to the
extreme of not defining any presentation at all for its symbols, however
the difference between OpenMath and MathML is largely one of syntax
rather than semantics. OpenMath does have the Content Dictionary
mechanism, an XML document that defines the XML symbols,  You cab use
these as the targets for definitionURL even if you are using content
mathml rather than OM to mark up expressions.

   Any further thoughts?

   Best regards,
   Charles Lyons.

>    P.S. I've taken on-board your comments about my sloppy Presentation
>    syntax and use of the &InvisibleTimes; - I agree, it was
>    incorrect. However, it is also important for the &dd; and the
>    following character not to line-break... 

 wrapping in mrow should discourage line breaking, invisible times
 needn't have any effect on line breaking at all 


This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
Received on Tuesday, 14 June 2005 22:42:26 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 20 February 2010 06:12:57 GMT