Dictionary for OpenMath

Nice, May 23-24, 1997.

An HTML version of this paper is available at:

http://www.inf.ethz.ch/personal/gonnet/ContDict/Progr.html

The Programming Content Dictionary, provides a mechanism to exchange programs, functions and procedures between OpenMath (OM) complaint applications. All the principles of OpenMath communications apply. This Content Dictionary (CD) defines the most common programming constructs, and allows the encoding of most scientific computation programs. For those who prefer, a BNF grammar version of the programming CD is available.

- Provide portability to several popular programming languages
(for scientific computation).

- Steal successful constructs from existing languages.

- As with all of OpenMath, what is defined should be
correctly implemented/translated, what is outside the definition
is up to the user.

- Conceptually, a greatest common denominator of several
languages.

- Special handling of objects is done by a library
(e.g. string manipulation, input/output, etc.).

- Automatic (simpler) generation of code is possible.
In most cases this means increasing the reliability of the code.

- Increased portability. This is one of the main goals.

- Possibility of optimization
at various levels, some of
these completely beyond the reach of compilers.

- Execution in different languages provides better
testing (tighter compilers, run time checkings, etc.).

- Symbolic execution
(partial or complete) provides proofs or correctness.

- Automatic generation of debugging versions,
profiling versions, etc.

- Library of Metafunctions

We will use as an example, the computation of a Moving Parabolic approximation.

The input for this computation is a vector *x* of dimension
*n*.
We will compute a parabolic approximation (polynomial approximation
of degree 2) for each consecutive set of *m* points ending at
position *i*.
That is, for each position *i*

x[i-j] ~ a0[i] + a1[i]*j + a2[i]*j^2for

We will call this procedure
*MovingParabApprox* and we
will code it in OpenMath.
A maple session is used to compute
the crucial equations and to optimize this code.
This function can be converted to C
or to Maple.

To test this function we write a Main program. This is also written in OpenMath. This program can be converted to C or to Maple. The output of both programs is, fortunately, identical. The code for Maple can also be executed symbolically, this provides some level of program verification.