version 1.5, 2000/01/13 10:58:16 |
version 1.9, 2000/01/16 10:55:40 |
|
|
% $OpenXM: OpenXM/doc/issac2000/data-format.tex,v 1.4 2000/01/11 05:35:48 noro Exp $ |
% $OpenXM: OpenXM/doc/issac2000/data-format.tex,v 1.8 2000/01/16 06:02:41 takayama Exp $ |
|
|
\section{Data Format} (Ohara) |
\section{Data Format} |
|
|
OpenXM admits multiple mathematical encodings such as OpenMath, MP, CMO |
OpenXM admits multiple mathematical encodings such as OpenMath, MP, CMO |
(Common Mathematical Object format). |
(Common Mathematical Object format). |
OpenXM itself does not exhibit a bias towards a particular encodings |
OpenXM itself does not exhibit a bias towards a particular encodings |
as a main mathematical data carrier and an OpenXM compliant system do not need to |
as a main mathematical data carrier and an OpenXM compliant system do not need to |
implement all possible data formats. |
implement all possible data formats. |
A server or a client does not necessarily implement full specifications |
However they should at least implement seven primitive |
of OpenXM. |
data types of the CMO, which are necessary to |
However, if a program sends an OX data or an OX command unknown to its peer, |
carry several control informations such as a {\it mathcap}. |
|
Mathcap is a list of supported CMO's, OpenXM stack machine codes, |
|
and necessary extra informations. |
|
If a program sends an OX messages unknown to its peer, |
an unrecoverable error may occur. |
an unrecoverable error may occur. |
To avoid such a case OpenXM provides a scheme not |
By exchanging mathcaps, a program knows its peer's capability |
to send an OX message unknown to peers. |
and such an error can be avoided. |
It is realized by exchanging a list of |
Mathcap is also defined as a CMO. |
supported CMO's, OpenXM stack machine codes, and necessary extra informations. |
See \cite{noro-takayama} for the details. |
The list is called {\it mathcap}. |
|
% Mathcap is also defined as a CMO and its elements are 32bit integers |
|
% or strings. |
|
Mathcap is also defined as a CMO and the CMO has a structure of a nest |
|
of lists. its leafs of the end are also a CMO which tags with |
|
CMO\_INT32 or CMO\_STRING. |
|
|
|
Mathematical encoding types of OX data are distinguished with tags |
Encoding types of OX data are distinguished with tags |
of OX messages. |
of OX messages. |
For example, |
For example, |
an OX message with the tag |
an OX message with the tag |
OX\_DATA is followed by a CMO packet. |
{\tt OX\_DATA} is followed by a CMO packet. |
An OX message with the tag |
An OX message with the tag |
OX\_DATA\_OPENMATH\_XML is followed by |
{\tt OX\_DATA\_OPENMATH\_XML} is followed by |
an OpenMath XML string and its length. |
an OpenMath XML string. |
|
|
All OpenXM compliant systems should implement seven primitive data types |
|
of the CMO. |
|
These are used not only to express mathematical objects, but also |
|
indispensable to carry control informations such as mathcap. |
|
CMO is an original mathematical data encoding system of the OpenXM project. |
|
Let us explain the data format of CMO. |
Let us explain the data format of CMO. |
Any CMO packet consists of a header and a body. |
Any CMO packet consists of a header and a body. |
The size of the header is 4 bytes that tags the data type of the body. |
The size of the header is 4 bytes that tags the data type of the body. |
Data type tags are signed 32 bit integers which is called {\sl int32} in this |
Data type tags are signed 32 bit integers which is called {\sl int32} in this |
paper. |
paper. |
Following tags are registered in the OpenXM for now. |
Following tags are registered in the OpenXM. |
\begin{verbatim} |
\begin{verbatim} |
#define CMO_ERROR2 0x7f000002 |
#define CMO_ERROR2 0x7f000002 |
#define CMO_NULL 1 |
#define CMO_NULL 1 |
Line 66 Following tags are registered in the OpenXM for now. |
|
Line 58 Following tags are registered in the OpenXM for now. |
|
#define CMO_RATIONAL 34 |
#define CMO_RATIONAL 34 |
#define CMO_64BIT_MACHINE_DOUBLE 40 |
#define CMO_64BIT_MACHINE_DOUBLE 40 |
#define CMO_ARRAY_OF_64BIT_MACHINE_DOUBLE 41 |
#define CMO_ARRAY_OF_64BIT_MACHINE_DOUBLE 41 |
#define CMO_128BIT_MACHINE_DOUBLE 42 |
|
#define CMO_ARRAY_OF_128BIT_MACHINE_DOUBLE 43 |
|
#define CMO_BIGFLOAT 50 |
#define CMO_BIGFLOAT 50 |
#define CMO_IEEE_DOUBLE_FLOAT 51 |
#define CMO_IEEE_DOUBLE_FLOAT 51 |
#define CMO_INDETERMINATE 60 |
#define CMO_INDETERMINATE 60 |
#define CMO_TREE 61 |
#define CMO_TREE 61 |
#define CMO_LAMBDA 62 |
#define CMO_LAMBDA 62 |
\end{verbatim} |
\end{verbatim} |
The first seven types should be implemented on all OpenXM compliant systems. |
The first seven primitive types should be implemented |
The format of the first seven CMO's are as follows. \\ |
on all OpenXM compliant systems. |
|
The formats are as follows. \\ |
\begin{tabular}{|c|c|} |
\begin{tabular}{|c|c|} |
\hline |
\hline |
{\sl int32} {\tt CMO\_ERROR2} & {\sl CMObject} {\rm ob} \\ |
{\sl int32} {\tt CMO\_ERROR2} & {\sl CMObject} {\rm ob} \\ |
Line 118 $\cdots$ & {\sl CMObject} {\rm ob[n-1]} \\ |
|
Line 109 $\cdots$ & {\sl CMObject} {\rm ob[n-1]} \\ |
|
\cline{1-2} |
\cline{1-2} |
\end{tabular} \\ |
\end{tabular} \\ |
|
|
A mathematical programmer who wants to implement CMO on a server proceeds |
As to the formats of other CMO's, see \cite{noro-takayama}. |
|
|
|
When one wants to implement CMO on a server, the person proceeds |
as follows. |
as follows. |
\begin{enumerate} |
\begin{enumerate} |
\item Look for the CMO list at the web cite \cite{openxm-web}. |
\item Look for the list of CMO's at the web cite \cite{openxm-web}. |
If there is a CMO that fits to her or his requirement, then use this CMO. |
If there is a CMO that fits to one's requirement, then use this CMO. |
\item If there is no suitable CMO, design a new CMO and register |
\item If there is no suitable CMO, design a new CMO and register |
the new CMO to \cite{openxm-web} with a description and examples. |
the new CMO to \cite{openxm-web} with a description and examples. |
\end{enumerate} |
\end{enumerate} |