=================================================================== RCS file: /home/cvs/OpenXM/doc/OpenXM-specs/cmo-basic1.tex,v retrieving revision 1.3 retrieving revision 1.10 diff -u -p -r1.3 -r1.10 --- OpenXM/doc/OpenXM-specs/cmo-basic1.tex 2000/01/23 05:28:33 1.3 +++ OpenXM/doc/OpenXM-specs/cmo-basic1.tex 2001/04/10 11:56:29 1.10 @@ -1,7 +1,7 @@ -%% $OpenXM: OpenXM/doc/OpenXM-specs/cmo-basic1.tex,v 1.1.1.1 2000/01/20 08:52:46 noro Exp $ +%% $OpenXM: OpenXM/doc/OpenXM-specs/cmo-basic1.tex,v 1.9 2000/09/12 23:09:18 noro Exp $ //&jp \section{ 数, 多項式 の CMO 表現 } //&eg \section{ CMOexpressions for numbers and polynomials } - +\label{sec:basic1} /*&C @../SSkan/plugin/cmotag.h \begin{verbatim} @@ -24,31 +24,51 @@ */ /*&jp -以下, グループ CMObject/Basic1, CMObject/Tree +以下, グループ CMObject/Basic, CMObject/Tree および CMObject/DistributedPolynomial に属する CMObject の形式を説明する. -\noroa{ tagged list を導入すべきか? cf. SSkan/plugin/cmo.txt } +\noindent +{\tt OpenXM/src/ox\_toolkit} にある {\tt bconv} をもちいると +CMO expression を binary format に変換できるので, +これを参考にするといい. */ /*&eg In the sequel, we will explain on the groups -CMObject/Basic1, CMObject/Tree +CMObject/Basic, CMObject/Tree and CMObject/DistributedPolynomial. + +\noindent +The program {\tt bconv} at {\tt OpenXM/src/ox\_toolkit} +translates +CMO expressions into binary formats. +It is convinient to understand the binary formats explained in +this section. */ +/*&C +\noindent Example: +\begin{verbatim} +bash$ ./bconv +> (CMO_ZZ,123123); +00 00 00 14 00 00 00 01 00 01 e0 f3 +\end{verbatim} +*/ /*&jp \bigbreak \noindent -Group CMObject/Basic1 requires CMObject/Basic0. \\ -ZZ, QQ, Zero, Rational, Indeterminate,$\in$ CMObject/Basic1. \\ +Group CMObject/Basic requires CMObject/Primitive. \\ +ZZ, QQ, Zero, Rational, Indeterminate,$\in$ CMObject/Basic. \\ \begin{eqnarray*} \mbox{Zero} &:& ({\tt CMO\_ZERO}) \\ & & \mbox{ --- ユニバーサルな ゼロを表す. } \\ \mbox{ZZ} &:& ({\tt CMO\_ZZ},{\sl int32}\, {\rm f}, {\sl byte}\, \mbox{a[1]}, \ldots -{\sl byte}\, \mbox{a[m]} ) \\ +{\sl byte}\, \mbox{a[$|$f$|$]} ) \\ &:& \mbox{ --- bignum をあらわす. a[i] についてはあとで説明}\\ -\mbox{QQ} &:& ({\tt CMO\_QQ}, {\sl ZZ}\, {\rm a}, {\sl ZZ}\, {\rm b}) \\ +\mbox{QQ} &:& ({\tt CMO\_QQ}, + {\sl int32}\, {\rm m}, {\sl byte}\, \mbox{a[1]}, \ldots, {\sl byte}\, \mbox{a[$|$m$|$]}, + {\sl int32}\, {\rm n}, {\sl byte}\, \mbox{b[1]}, \ldots, {\sl byte}\, \mbox{b[$|$n$|$]})\\ & & \mbox{ --- 有理数 $a/b$ を表す. } \\ \mbox{Rational} &:& ({\tt CMO\_RATIONAL}, {\sl CMObject}\, {\rm a}, {\sl CMObject}\, {\rm b}) \\ & & \mbox{ --- $a/b$ を表す. } \\ @@ -60,15 +80,17 @@ ZZ, QQ, Zero, Rational, Indeterminate,$\in$ CMObject/B \bigbreak \noindent -Group CMObject/Basic1 requires CMObject/Basic0. \\ -ZZ, QQ, Zero, Rational, Indeterminate,$\in$ CMObject/Basic1. \\ +Group CMObject/Basic requires CMObject/Primitive. \\ +ZZ, QQ, Zero, Rational, Indeterminate,$\in$ CMObject/Basic. \\ \begin{eqnarray*} \mbox{Zero} &:& ({\tt CMO\_ZERO}) \\ & & \mbox{ --- Universal zero } \\ \mbox{ZZ} &:& ({\tt CMO\_ZZ},{\sl int32}\, {\rm f}, {\sl byte}\, \mbox{a[1]}, \ldots -{\sl byte}\, \mbox{a[m]} ) \\ +{\sl byte}\, \mbox{a[$|$m$|$]} ) \\ &:& \mbox{ --- bignum. The meaning of a[i] will be explained later.}\\ -\mbox{QQ} &:& ({\tt CMO\_QQ}, {\sl ZZ}\, {\rm a}, {\sl ZZ}\, {\rm b}) \\ +\mbox{QQ} &:& ({\tt CMO\_QQ}, + {\sl int32}\, {\rm m}, {\sl byte}\, \mbox{a[1]}, \ldots, {\sl byte}\, \mbox{a[$|$m$|$]}, + {\sl int32}\, {\rm n}, {\sl byte}\, \mbox{b[1]}, \ldots, {\sl byte}\, \mbox{b[$|$n$|$]})\\ & & \mbox{ --- Rational number $a/b$. } \\ \mbox{Rational} &:& ({\tt CMO\_RATIONAL}, {\sl CMObject}\, {\rm a}, {\sl CMObject}\, {\rm b}) \\ & & \mbox{ --- Rational expression $a/b$. } \\ @@ -102,8 +124,8 @@ in one to one correspondence. /*&jp \noindent -Group CMObject/Tree requires CMObject/Basic1. \\ -Tree, Lambda $\in$ CMObject/Basic1. \\ +Group CMObject/Tree requires CMObject/Basic. \\ +Tree, Lambda $\in$ CMObject/Basic. \\ \begin{eqnarray*} \mbox{Tree} &:& ({\tt CMO\_TREE}, {\sl Cstring}\, {\rm name}, {\sl Cstring}\, {\rm cdname}, {\sl List}\, {\rm leaves}) \\ @@ -119,8 +141,8 @@ Tree, Lambda $\in$ CMObject/Basic1. \\ /*&eg \noindent -Group CMObject/Tree requires CMObject/Basic1. \\ -Tree, Lambda $\in$ CMObject/Basic1. \\ +Group CMObject/Tree requires CMObject/Basic. \\ +Tree, Lambda $\in$ CMObject/Basic. \\ \begin{eqnarray*} \mbox{Tree} &:& ({\tt CMO\_TREE}, {\sl Cstring}\, {\rm name}, {\sl Cstring}\, {\rm cdname}, {\sl List}\, {\rm leaves}) \\ @@ -160,14 +182,14 @@ For example, $\sin(x+e)$ is expressed as {\tt (sin, (plus, x, e))} as a tree. -Tree may be expressed by putting itself between +Tree may be expressed by putting the expression between {\tt SM\_beginBlock} and {\tt SM\_endBlock}, which are stack machine commands for delayed evaluation. (cf. {\tt \{ }, {\tt \} } in PostScript). However it makes the implementation of stack machines complicated. It is desirable that CMObject is independent of OX stack machine. Therefore we introduce an OpenMath like tree representation for CMO -tree object. +Tree object. This method allows us to implement tree structure easily on individual OpenXM systems. Note that CMO Tree corresponds to Symbol and Application in OpenMath. @@ -194,31 +216,36 @@ It is the same as the Lambda expression in Lisp. (CMO_LIST,[size=]1, (CMO_TREE, (CMO_STRING, "plus"), (CMO_STRING, "basic"), (CMO_LIST,[size=]2, (CMO_INDETERMINATE,"x"), -//&jp (CMO_TREE,(CMO_STRING, "e"), 自然対数の底 -//&eg (CMO_TREE,(CMO_STRING, "e"), Napier's number - (CMO_STRING, "basic")) +//&jp (CMO_TREE,(CMO_STRING, "e"), 自然対数の底 +//&eg (CMO_TREE,(CMO_STRING, "e"), the base of natural logarithms + (CMO_STRING, "basic")) )) ) ) \end{verbatim} +//&jp Leave の成分には, 多項式を含む任意のオブジェクトがきてよい. +//&eg Elements of the leave may be any objects including polynomials. \noindent Example: \begin{verbatim} sm1> [(plus) (Basic) [(123).. (345)..]] [(class) (tree)] dc :: -Class.tree [ $plus$ , $Basic$ , [ 123 , 345 ] ] +Class.tree [ $plus$ , $basic$ , [ 123 , 345 ] ] \end{verbatim} \bigbreak //&jp 次に, 分散表現多項式に関係するグループを定義しよう. -//&eg Let us define a group for distributed polynomials. +/*&eg +Let us define a group for distributed polynomials. In the following +DMS stands for Distributed Monomial System. +*/ \medbreak \noindent -Group CMObject/DistributedPolynomials requires CMObject/Basic0, -CMObject/Basic1. \\ +Group CMObject/DistributedPolynomials requires CMObject/Primitive, +CMObject/Basic. \\ Monomial, Monomial32, Coefficient, Dpolynomial, DringDefinition, Generic DMS ring, RingByName, DMS of N variables $\in$ CMObject/DistributedPolynomials. \\ @@ -289,7 +316,7 @@ $x^e = x_1^{e_1} \cdots x_n^{e_n}$ の各指数 $e_i$ \mbox{Generic DMS ring} &:& ({\tt CMO\_DMS\_GENERIC}) \\ \mbox{RingByName}&:& ({\tt CMO\_RING\_BY\_NAME}, {\sl Cstring} s) \\ - & & \mbox{ --- The ring definition refered by the name ``s''.} \\ + & & \mbox{ --- The ring definition referred by the name ``s''.} \\ \mbox{DMS of N variables} &:& ({\tt CMO\_DMS\_OF\_N\_VARIABLES}, \\ & & \ ({\tt CMO\_LIST}, {\sl int32}\, \mbox{m}, @@ -394,7 +421,7 @@ a CMO\_ZZ $14$ is expressed by \mbox{(CMO\_ZZ, 1, 0, 0, 0, e)}, \] //&jp と表わす. これはバイト列では -//&egThe corresponding byte sequence is +//&eg The corresponding byte sequence is \[ \mbox{\tt 00 00 00 14 00 00 00 01 00 00 00 0e} \] @@ -442,25 +469,22 @@ Ring by Name を用いた場合, 現在の名前空間で変数 yyy に /*&eg We treat polynomial rings and their elements as follows. -An element of a generic DMS ring is an element of -an $n$-variate polynomial ring $K[x_1, \ldots, x_n]$, +Generic DMS ring is an $n$-variate polynomial ring $K[x_1, \ldots, x_n]$, where $K$ is some coefficient set. $K$ is unknown in advance -and it is determined when coefficients are received. -When a server has received an element in a generic DMS ring, +and it is determined when coefficients of an element are received. +When a server has received an element in Generic DMS ring, the server has to translate it into the corresponding local object on the server. Each server has its own translation scheme. - In Asir such an element are translated into a distributed polynomial. - In {\tt kan/sm1} things are complicated. -{\tt kan/sm1} does not have any class corresponding to a generic DMS ring. +{\tt kan/sm1} does not have any class corresponding to Generic DMS ring. {\tt kan/sm1} translates a DMS of N variables into an element of the CurrentRing. If the CurrentRing is $n'$-variate and $n' < n$, then -a polynomial ring is newly created. Optional informations such as +an $n$-variate polynomial ring is newly created. Optional informations such as the term order are all ignored. -If RingbyName ({\tt CMO\_RING\_BY\_NAME}, yyy) +If RingByName ({\tt CMO\_RING\_BY\_NAME}, yyy) is specified as the second field of DMS, it requests a sever to use a ring object whose name is yyy as the destination ring for the translation. @@ -504,7 +528,7 @@ $3 x^2 y$ is regarded as an element of a six-variate p #define CMO_POLYNOMIAL_IN_ONE_VARIABLE 33 \end{verbatim} -Group CMObject/RecursivePolynomial requires CMObject/Basic0, CMObject/Basic1.\\ +Group CMObject/RecursivePolynomial requires CMObject/Primitive, CMObject/Basic.\\ Polynomial in 1 variable, Coefficient, Name of the main variable, Recursive Polynomial, Ring definition for recursive polynomials $\in$ CMObject/RecursivePolynomial \\ @@ -533,7 +557,7 @@ $\in$ CMObject/RecursivePolynomial \\ \mbox{ Polynomial in 1 variable}\, | \, \mbox{Coefficient} \\ \mbox{RringDefinition} & : & \mbox{ {\sl List} v } \\ -& & \quad \mbox{ --- v は, 変数名(indeterminate) のリスト. } \\ +& & \quad \mbox{ --- v は, 変数名(indeterminate) または Tree のリスト. } \\ & & \quad \mbox{ --- 順序の高い順. } \\ \end{eqnarray*} */ @@ -543,8 +567,8 @@ $\in$ CMObject/RecursivePolynomial \\ \mbox{({\tt CMO\_POLYNOMIAL\_IN\_ONE\_VARIABLE},\, {\sl int32}\, m, } \\ & & \quad \mbox{ Name of the main variable }, \\ & & \quad \mbox{ \{ {\sl int32} e, Coefficient \}} \\ -& & \mbox{ --- m is the number of monimials. } \\ -& & \mbox{ --- A pair of e and Coefficieint represents a monomial. } \\ +& & \mbox{ --- m is the number of monomials. } \\ +& & \mbox{ --- A pair of e and Coefficient represents a monomial. } \\ & & \mbox{ --- The pairs of e and Coefficient are sorted in the } \\ & & \mbox{ \quad decreasing order, usually with respect to e.} \\ & & \mbox{ --- e denotes an exponent of a monomial with respect to } \\ @@ -563,7 +587,7 @@ $\in$ CMObject/RecursivePolynomial \\ \mbox{ Polynomial in 1 variable}\, | \, \mbox{Coefficient} \\ \mbox{RringDefinition} & : & \mbox{ {\sl List} v } \\ -& & \quad \mbox{ --- v is a list of names of indeterminates. } \\ +& & \quad \mbox{ --- v is a list of names of indeterminates or trees. } \\ & & \quad \mbox{ --- It is sorted in the decreasing order. } \\ \end{eqnarray*} */ @@ -591,7 +615,7 @@ $$ x^3 (1234 y^5 + 17 ) + x^1 (y^{10} + 31 y^5) $$ /*&eg We intend to represent non-commutative polynomials with the same form. In such a case, the order of products are defined -as above, that is a power of the mail variable $\times$ a coeffcient. +as above, that is a power of the main variable $\times$ a coeffcient. */ \noindent @@ -613,7 +637,7 @@ Class.recursivePolynomial h * ((-1)) + (x^2 * (1)) \end{verbatim} \noindent -Group CMObject/MachineDouble requires CMObject/Basic0.\\ +Group CMObject/MachineDouble requires CMObject/Primitive.\\ 64bit machine double, Array of 64bit machine double 128bit machine double, Array of 128bit machine double $\in$ CMObject/MachineDouble \\ @@ -677,7 +701,7 @@ $\in$ CMObject/MachineDouble \\ \bigbreak //&jp 次に IEEE 準拠の float および Big float を定義しよう. -//&eg We define IEEE conformant float and big float. +//&eg We define float and big float conforming to the IEEE standard. \begin{verbatim} #define CMO_BIGFLOAT 50 #define CMO_IEEE_DOUBLE_FLOAT 51 @@ -688,12 +712,12 @@ IEEE 準拠の float については, IEEE 754 double precisio format (64 bit) の定義を見よ. */ /*&eg -See IEEE 754 double precision floating-point (64 bit) for the details of IEEE -conformant float. +See IEEE 754 double precision floating-point (64 bit) for the details of +float conforming to the IEEE standard. */ \noindent -Group CMObject/Bigfloat requires CMObject/Basic0, CMObject/Basic1.\\ +Group CMObject/Bigfloat requires CMObject/Primitive, CMObject/Basic.\\ Bigfloat $\in$ CMObject/Bigfloat \\