In MathML, constants are defined as being any of the following:
e
, i
, pi
, gamma
, infinity
,
true
, false
or not a number (NaN)
. They appear
within <cn>
tags when the attribute type
is set to
constant
. For instance would be represented in MathML as:
<cn
type="constant">pi</cn>
In OpenMath, these constants all appear as different symbols and from
different CDs. Hence, we face a similar problem as we did with MathML
attributes. The <cn>
tag with the attribute set to
constant
can map to different OpenMath symbols.
It is important that the translator detects the use of the
constant
attribute value and maps the constant expressed to the
correct OpenMath symbol.
MathML also allows to define Cartesian complex numbers and polar
complex numbers. A complex number is of the form two real point
numbers separated by the <sep/>
tag. For instance 3+4i is
represented as:
<cn type="cartesian_complex"> 3 <sep/> 4 </cn>
OpenMath is more flexible in its definition of complex numbers. The real and imaginary parts, or the magnitude and argument of a complex number do not have to be only real numbers. They may be variables. This allows OpenMath to represent numbers such as x+iy or which cannot be done in MathML.
So how should one map such an OpenMath expression to MathML? Because there is no specific construct for such complex numbers, the easiest way is to generate a MathML representation using simple operators. The two expressions in figure 3.3 are equivalent and illustrate how a translator should perform:
The problem is the same when representing rationals, since OpenMath allows variables to be used as elements of a rational number, whereas MathML only allows real numbers.