[BACK]Return to data-format.tex CVS log [TXT][DIR] Up to [local] / OpenXM / doc / ascm2001p

Annotation of OpenXM/doc/ascm2001p/data-format.tex, Revision 1.3

1.3     ! takayama    1: % $OpenXM: OpenXM/doc/ascm2001p/data-format.tex,v 1.2 2001/06/20 05:42:47 takayama Exp $
1.1       noro        2:
                      3: \section{Data Format}
                      4:
1.2       takayama    5: OpenXM admits multiple mathematical encodings such as OpenMath, MP, CMO.
                      6: OpenXM itself does not exhibit a bias towards a particular encoding
                      7: as a main mathematical data carrier and an OpenXM compliant system
                      8: does not need to
1.1       noro        9: implement all possible data formats.
                     10: However  they should at least implement seven primitive
                     11: data types of the CMO, which are necessary to
1.2       takayama   12: carry various control information such as a {\it mathcap}\cite{ox-rfc-100}.
1.3     ! takayama   13: Mathcap is a list of supported CMO's, OX stack machine codes,
1.2       takayama   14: and necessary extra information.
                     15: If a program sends an OX message unknown to its peer,
1.1       noro       16: an unrecoverable error may occur.
                     17: By exchanging mathcaps, a program knows its peer's capability
                     18: and such an error can be avoided.
                     19: Mathcap is also defined as a CMO.
                     20:
                     21: Encoding types of OX data are distinguished with tags
                     22: of OX messages.
                     23: For example, an OX message with the tag
                     24: {\tt OX\_DATA} is followed by a CMO packet.
                     25: %An OX message with the tag
                     26: %{\tt OX\_DATA\_OPENMATH\_XML} is followed by
                     27: %an OpenMath XML string.
                     28: Any CMO packet consists of a header and a body.
                     29: The following seven primitive types should be implemented
                     30: on all OpenXM compliant systems:
                     31: \verb+CMO_ERROR2+, \verb+CMO_NULL+, \verb+CMO_INT32+, \verb+CMO_DATUM+,
                     32: \verb+CMO_STRING+, \verb+CMO_MATHCAP+, \verb+CMO_LIST+.
1.2       takayama   33: As to the formats of other CMO's and XML, see the OX-RFC-100\cite{ox-rfc-100}.
1.1       noro       34:
                     35:
                     36: %Let us explain the data format of CMO.
                     37: %Any CMO packet consists of a header and a body.
                     38: %The size of the header is 4 bytes that tags the data type of the body.
                     39: %Data type tags are signed 32 bit integers which is called {\sl int32} in this
                     40: %paper.
                     41: %Following tags are registered in the OpenXM.
                     42: %\begin{verbatim}
                     43: %#define CMO_ERROR2                         0x7f000002
                     44: %#define CMO_NULL                           1
                     45: %#define CMO_INT32                          2
                     46: %#define CMO_DATUM                          3
                     47: %#define CMO_STRING                         4
                     48: %#define CMO_MATHCAP                        5
                     49: %#define CMO_LIST                           17
                     50: %
                     51: %#define CMO_MONOMIAL32                     19
                     52: %#define CMO_ZZ                             20
                     53: %#define CMO_QQ                             21
                     54: %#define CMO_ZERO                           22
                     55: %#define CMO_DMS_GENERIC                    24
                     56: %#define CMO_DMS_OF_N_VARIABLES             25
                     57: %#define CMO_RING_BY_NAME                   26
                     58: %#define CMO_RECURSIVE_POLYNOMIAL           27
                     59: %#define CMO_LIST_R                         28
                     60: %#define CMO_INT32COEFF                     30
                     61: %#define CMO_DISTRIBUTED_POLYNOMIAL         31
                     62: %#define CMO_POLYNOMIAL_IN_ONE_VARIABLE     33
                     63: %#define CMO_RATIONAL                       34
                     64: %#define CMO_64BIT_MACHINE_DOUBLE           40
                     65: %#define CMO_ARRAY_OF_64BIT_MACHINE_DOUBLE  41
                     66: %#define CMO_BIGFLOAT                       50
                     67: %#define CMO_IEEE_DOUBLE_FLOAT              51
                     68: %#define CMO_INDETERMINATE                  60
                     69: %#define CMO_TREE                           61
                     70: %#define CMO_LAMBDA                         62
                     71: %\end{verbatim}
                     72: %The first seven primitive types should be implemented
                     73: %on all OpenXM compliant systems.
                     74: %The formats are as follows. \\
                     75: %\begin{tabular}{|c|c|}
                     76: %\hline
                     77: %{\sl int32} {\tt CMO\_ERROR2} & {\sl CMObject} {\rm ob} \\
                     78: %\hline
                     79: %\end{tabular} \\
                     80: %\begin{tabular}{|c|c|}
                     81: %\hline
                     82: %{\sl int32} {\tt CMO\_NULL}  \\
                     83: %\hline
                     84: %\end{tabular} \\
                     85: %\begin{tabular}{|c|c|}
                     86: %\hline
                     87: %{\sl int32} {\tt CMO\_INT32}& {\sl int32} {\rm n}  \\
                     88: %\hline
                     89: %\end{tabular} \\
                     90: %\begin{tabular}{|c|c|c|}
                     91: %\hline
                     92: %{\sl int32} {\tt CMO\_DATUM}& {\sl int32} {\rm n} & {\sl byte} {\rm  data[0]} \\
                     93: %\hline
                     94: %$\cdots$ & {\sl byte} {\rm  data[n-1]} \\
                     95: %\cline{1-2}
                     96: %\end{tabular} \\
                     97: %\begin{tabular}{|c|c|c|}
                     98: %\hline
                     99: %{\sl int32} {\tt CMO\_STRING}& {\sl int32} {\rm n} & {\sl byte} {\rm data[0]} \\
                    100: %\hline
                    101: %$\cdots$ & {\sl byte} {\rm data[n-1]} \\
                    102: %\cline{1-2}
                    103: %\end{tabular} \\
                    104: %\begin{tabular}{|c|c|}
                    105: %\hline
                    106: %{\sl int32} {\tt CMO\_MATHCAP} & {\sl CMObject} {\rm ob} \\
                    107: %\hline
                    108: %\end{tabular} \\
                    109: %\begin{tabular}{|c|c|c|}
                    110: %\hline
                    111: %{\sl int32} {\tt CMO\_LIST}& {\sl int32} {\rm n} & {\sl CMObject} {\rm ob[0]} \\
                    112: %\hline
                    113: %$\cdots$ & {\sl CMObject} {\rm ob[n-1]} \\
                    114: %\cline{1-2}
                    115: %\end{tabular} \\
                    116: %CMO's can be expressed in terms of XML.
                    117: %For example, {\tt (CMO\_INT32} $1234${\tt )} can be expressed by
                    118: %{\footnotesize
                    119: %\begin{verbatim}
                    120: %<cmo>
                    121: % <cmo_int32>
                    122: %   <int32> 1234 </int32>
                    123: % </cmo_int32>
                    124: %</cmo>
                    125: %\end{verbatim}
                    126: %}
                    127: %As to the formats of other CMO's and XML, see \cite{ox-rfc-100}.
                    128: %
                    129: %When one wants to implement CMO on a server, the person proceeds
                    130: %as follows.
                    131: %\begin{enumerate}
                    132: %\item Look for the list of CMO's at the web cite \cite{openxm-web}.
                    133: %If there is a CMO that fits to one's requirement, then use this CMO.
                    134: %\item If there is no suitable CMO, design a new CMO and register
                    135: %the new CMO to \cite{openxm-web} with a description and examples.
                    136: %\end{enumerate}

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>