Konrad Hinsen skrev 2014-02-21 16.31:
Dear all,

I discovered OpenMath a while ago and I am trying to figure out how to
use it. The documentation looks quite complete in the sense of
defining the meaning of OpenMath objects, but what I need is the
inverse: find out how to encode a certain formula in OpenMath. In
theory, I could study all the content dictionaries, but I'd probably
give up before completing that task.

So what I am looking for is either a tutorial, or at least a list of
examples. I don't need anything particularly exotic, but I don't even
see immediately how to express something like "a sum over all pairs of
indices".

One resource I've found useful is the "Index of all symbols" (http://www.openmath.org/cdindex.html). Searching in this page has a good chance of turning up something relevant, even if it's in a content dictionary you didn't expect.

As for encoding a sum over all pairs of indices, there is the complication that the official OMCDs aren't fond of expressing things using binder symbols (even if the standard supports the concept of such), so one typically has to wrap the body up in a lambda before feeding it to a summation symbol; sort of like writing $\sum_{[a,b]} f$ rather than $\sum_{k=a}^b f(k)$. Thus we get

<OMA>
  <OMS cd="arith1" name="sum"/>
  <OMA> <!-- the set of pairs of indices: -->
    <OMS cd="set1" name="cartesian_product"/>
    <OMV name="my_index_set"/>
    <OMV name="my_index_set"/>
  </OMA>
  <OMBIND>
    <OMS cd="fns1" name="lambda"/>
    <OMBVAR> <OMV name="i"/> <OMV name="j"/> </OMBVAR>

    <!-- Insert expression you're summing here. -->

  </OMBIND>
</OMA>

(with reservation for typing errors) as the basic idiom for summing over all pairs $(i,j)$ of indices. It's the same with integrals.

Lars Hellström

Version 2.0 of the OpenMath standard refers to "OpenMath primer" at
http://www.openmath.org/standard/primer/, but the contents are a bit
disappointing.

For a bit of background information, I intend to use OpenMath for
describing potential energies in molecular modelling. I am working on
a data model for computational chemistry
(http://mosaic-data-model.github.io/), which is to molecular modelling
what OpenMath is to maths: a data model with multiple encodings
designed for exchanging data between programs.

Konrad.
_______________________________________________
Om mailing list
[email protected]
http://openmath.org/mailman/listinfo/om



_______________________________________________
Om mailing list
[email protected]
http://openmath.org/mailman/listinfo/om

Reply via email to