=================================================================== RCS file: /home/cvs/OpenXM/doc/issac2000/data-format.tex,v retrieving revision 1.3 retrieving revision 1.8 diff -u -p -r1.3 -r1.8 --- OpenXM/doc/issac2000/data-format.tex 2000/01/03 04:27:52 1.3 +++ OpenXM/doc/issac2000/data-format.tex 2000/01/16 06:02:41 1.8 @@ -1,44 +1,39 @@ -% $OpenXM: OpenXM/doc/issac2000/data-format.tex,v 1.2 2000/01/02 07:32:11 takayama Exp $ +% $OpenXM: OpenXM/doc/issac2000/data-format.tex,v 1.7 2000/01/15 12:18:42 takayama Exp $ -\section{Data Format} (Ohara) +\section{Data Format} -OpenXM admits multiple math encodings such as OpenMath, MP, CMO +OpenXM admits multiple mathematical encodings such as OpenMath, MP, CMO (Common Mathematical Object format). OpenXM itself does not exhibit a bias towards a particular encodings -as a main math data carrier and 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. -A server or a client does not necessarily implement full specifications -of OpenXM. -However, if a program sends an OX data or an OX command unknown to its peer, +However they should at least implement seven primitive +data types of the CMO, which are necessary to +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. -To avoid such a case OpenXM provides a scheme not -to send an OX message unknown to peers. -It is realized by exchanging a list of -supported CMO's, OpenXM stackmachine codes, and necessary extra informations. -The list is called {\it mathcap}. -Mathcap is also defined as a CMO and the elements are 32bit integers -or strings. +By exchanging mathcaps a program knows its peer's capability +and such an error can be avoided. +Mathcap is also defined as a CMO. +See \cite{noro-takayama} for the details. -Math encoding types of OX data are distinguished with tags +Encoding types of OX data are distinguished with tags of OX messages. For example, 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 -OX\_DATA\_OPENMATH\_XML is followed by -an OpenMath XML string and its length. +{\tt OX\_DATA\_OPENMATH\_XML} is followed by +an OpenMath XML string. -All OpenXM compliant systems should implement 7 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 methematical data encoding system of the OpenXM project. Let us explain the data format of CMO. 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. Data type tags are signed 32 bit integers which is called {\sl int32} in this paper. -Following tags are registered in the OpenXM for now. +Following tags are registered in the OpenXM. \begin{verbatim} #define CMO_ERROR2 0x7f000002 #define CMO_NULL 1 @@ -47,6 +42,7 @@ Following tags are registered in the OpenXM for now. #define CMO_STRING 4 #define CMO_MATHCAP 5 #define CMO_LIST 17 + #define CMO_MONOMIAL32 19 #define CMO_ZZ 20 #define CMO_QQ 21 @@ -62,67 +58,64 @@ Following tags are registered in the OpenXM for now. #define CMO_RATIONAL 34 #define CMO_64BIT_MACHINE_DOUBLE 40 #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_IEEE_DOUBLE_FLOAT 51 #define CMO_INDETERMINATE 60 #define CMO_TREE 61 #define CMO_LAMBDA 62 \end{verbatim} -The first seven types should be implemented on all OpenXM compliant systems. -The format of the first seven CMO's are as follows. \\ +The first seven primitive types should be implemented +on all OpenXM compliant systems. +The formats are as follows. \\ \begin{tabular}{|c|c|} \hline -{\tt int32 CMO\_ERROR2} & {\sl CMObject} {\rm ob} \\ +{\sl int32} {\tt CMO\_ERROR2} & {\sl CMObject} {\rm ob} \\ \hline \end{tabular} \\ \begin{tabular}{|c|c|} \hline -{\tt int32 CMO\_NULL} \\ +{\sl int32} {\tt CMO\_NULL} \\ \hline \end{tabular} \\ \begin{tabular}{|c|c|} \hline -{\tt int32 CMO\_INT32}& {\tt int32} {\rm n} \\ +{\sl int32} {\tt CMO\_INT32}& {\sl int32} {\rm n} \\ \hline \end{tabular} \\ \begin{tabular}{|c|c|c|} \hline -{\tt int32 CMO\_DATUM}& {\tt int32} {\rm n} & {\tt byte} {\rm data[0]} \\ +{\sl int32} {\tt CMO\_DATUM}& {\sl int32} {\rm n} & {\sl byte} {\rm data[0]} \\ \hline -$\cdots$ & {\tt byte} {\rm data[n-1]} \\ +$\cdots$ & {\sl byte} {\rm data[n-1]} \\ \cline{1-2} \end{tabular} \\ \begin{tabular}{|c|c|c|} \hline -{\tt int32 CMO\_STRING}& {\tt int32} {\rm n} & {\tt byte} {\rm data[0]} \\ +{\sl int32} {\tt CMO\_STRING}& {\sl int32} {\rm n} & {\sl byte} {\rm data[0]} \\ \hline -$\cdots$ & {\tt byte} {\rm data[n-1]} \\ +$\cdots$ & {\sl byte} {\rm data[n-1]} \\ \cline{1-2} \end{tabular} \\ \begin{tabular}{|c|c|} \hline -{\tt int32 CMO\_MATHCAP} & {\it CMObject} {\rm ob} \\ +{\sl int32} {\tt CMO\_MATHCAP} & {\sl CMObject} {\rm ob} \\ \hline \end{tabular} \\ \begin{tabular}{|c|c|c|} \hline -{\tt int32 CMO\_LIST}& {\tt int32} {\rm n} & {\tt CMObject} {\rm ob[0]} \\ +{\sl int32} {\tt CMO\_LIST}& {\sl int32} {\rm n} & {\sl CMObject} {\rm ob[0]} \\ \hline -$\cdots$ & {\tt CMObject} {\rm ob[n-1]} \\ +$\cdots$ & {\sl CMObject} {\rm ob[n-1]} \\ \cline{1-2} \end{tabular} \\ +As to the formats of other CMO's, see \cite{noro-takayama}. -A mathematical programmer who wants to implement CMO on a server proceeds +When one wants to implement CMO on a server, the person proceeds as follows. \begin{enumerate} \item Look for the CMO list at the web cite \cite{openxm-web}. -If there is a CMO tht 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 the new CMO to \cite{openxm-web} with a description and examples. \end{enumerate} - - -