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