[Om] getting started with openMath

Alberto González Palomo Alberto.Gonzalez at matracas.org
Tue Oct 9 10:50:33 CEST 2012


ken wrote: (09/10/12 05:16)
> Hello,
>
> I would like a simple introduction to openMath xml objects like <mo> (I
> assume that stands for “math object” but have not yet been able to
> verify that), and how they are used. I read the The OpenMath Standard
> 2.0 pdf document but find it confusing.

     Well, <mo> is MathML, not OpenMath. Let's see if I can help you out.

>[...]
> I was thinking about using openMath for the input format for a wrapper
> for a Computer Algebra System that would then be used by a C++
> application I am writing.

     That's an advantage only if you want to be able to swap the CAS
without modifying your application.
     I wanted to do that some time ago, but it does not work well in
practice: beyond trivial expressions, the differences among CASs are
so serious that you end up having to create new OpenMath symbols for
each CAS, at which point the only benefit left is that you need an XML
parser instead of one for each of the CASs languages. That's valuable,
but probably not worth the effort depending on what you want to do.

     Maybe you know the Yacas CAS, to which I added OpenMath support
years ago:
http://yacas.sourceforge.net/

     Yacas is written in C++, but the OpenMath parser/serializer are
written in Yacas' script language. You can find the documentation
for those functions (OMForm(), OMRead(), OMDef()) in the manual
"Using Yacas, function reference", section "Input/output and plotting":
http://yacas.sourceforge.net/refchapter28.html#OMForm

     You can use it for learning about OpenMath by just using OMForm
as shown in the manual.

>
> Is there a very simple example or tutorial (preferable in a c like
> language) that uses openMath for input or output, that I could use for
> an example on how to construct or parse openMath structures?
>
> I am looking for:
>
> (1) a simple introduction to openMath and
>
> (2) a simple C++ example

     I did write a C++ application that outputs OpenMath: it's called
QMath, available from my web site:
http://matracas.org/qmath/

     If you download the source code, the OpenMath object class is at:
src/OpenMath/OpenMath_object/OpenMath_object.h

     You can see how to create OpenMath objects in C++ at:
test/example.cc

     QMath can only produce OpenMath, not parse it.

     Cheers,
-- 
	Alberto González Palomo
	Toledo, España / Saarbrücken, Deutschland
	http://www.matracas.org


More information about the Om mailing list