[BACK]Return to cmo-basic1.tex CVS log [TXT][DIR] Up to [local] / OpenXM / doc / OpenXM-specs

Diff for /OpenXM/doc/OpenXM-specs/cmo-basic1.tex between version 1.9 and 1.15

version 1.9, 2000/09/12 23:09:18 version 1.15, 2016/08/22 05:38:27
Line 1 
Line 1 
 %% $OpenXM: OpenXM/doc/OpenXM-specs/cmo-basic1.tex,v 1.8 2000/02/28 14:10:27 takayama Exp $  %% $OpenXM: OpenXM/doc/OpenXM-specs/cmo-basic1.tex,v 1.14 2015/08/18 02:54:05 noro Exp $
 //&jp \section{ 数, 多項式 の  CMO 表現 }  //&jp \section{ 数, 多項式 の  CMO 表現 }
 //&eg \section{ CMOexpressions for numbers and polynomials }  //&eg \section{ CMOexpressions for numbers and polynomials }
 \label{sec:basic1}  \label{sec:basic1}
Line 14 
Line 14 
 #define     CMO_RING_BY_NAME   26  #define     CMO_RING_BY_NAME   26
 #define     CMO_DISTRIBUTED_POLYNOMIAL 31  #define     CMO_DISTRIBUTED_POLYNOMIAL 31
 #define     CMO_RATIONAL       34  #define     CMO_RATIONAL       34
   #define     CMO_COMPLEX       35
   
   #define     CMO_BIGFLOAT32    52
   
 #define     CMO_INDETERMINATE  60  #define     CMO_INDETERMINATE  60
 #define     CMO_TREE           61  #define     CMO_TREE           61
Line 59  bash$ ./bconv
Line 61  bash$ ./bconv
 \bigbreak  \bigbreak
 \noindent  \noindent
 Group CMObject/Basic requires CMObject/Primitive. \\  Group CMObject/Basic requires CMObject/Primitive. \\
 ZZ, QQ, Zero, Rational, Indeterminate,$\in$ CMObject/Basic. \\  ZZ, QQ, Zero, Rational, Indeterminate $\in$ CMObject/Basic. \\
 \begin{eqnarray*}  \begin{eqnarray*}
 \mbox{Zero} &:& ({\tt CMO\_ZERO}) \\  \mbox{Zero} &:& ({\tt CMO\_ZERO}) \\
 & & \mbox{ --- ユニバーサルな ゼロを表す. } \\  & & \mbox{ --- ユニバーサルな ゼロを表す. } \\
 \mbox{ZZ}         &:& ({\tt CMO\_ZZ},{\sl int32}\, {\rm f}, {\sl byte}\, \mbox{a[1]}, \ldots  \mbox{ZZ}         &:& ({\tt CMO\_ZZ},{\sl int32}\, {\rm f}, {\sl byte}\, \mbox{a[1]}, \ldots ,
 {\sl byte}\, \mbox{a[$|$f$|$]} ) \\  {\sl byte}\, \mbox{a[$|$f$|$]} ) \\
 &:& \mbox{ --- bignum をあらわす. a[i] についてはあとで説明}\\  &:& \mbox{ --- bignum をあらわす. a[i] についてはあとで説明}\\
 \mbox{QQ}        &:& ({\tt CMO\_QQ},  \mbox{QQ}        &:& ({\tt CMO\_QQ},
Line 72  ZZ, QQ, Zero, Rational, Indeterminate,$\in$ CMObject/B
Line 74  ZZ, QQ, Zero, Rational, Indeterminate,$\in$ CMObject/B
 & & \mbox{ --- 有理数 $a/b$ を表す. } \\  & & \mbox{ --- 有理数 $a/b$ を表す. } \\
 \mbox{Rational}        &:& ({\tt CMO\_RATIONAL}, {\sl CMObject}\, {\rm a}, {\sl CMObject}\, {\rm b}) \\  \mbox{Rational}        &:& ({\tt CMO\_RATIONAL}, {\sl CMObject}\, {\rm a}, {\sl CMObject}\, {\rm b}) \\
 & & \mbox{ ---  $a/b$ を表す. } \\  & & \mbox{ ---  $a/b$ を表す. } \\
   \mbox{Bigfloat32}         &:& ({\tt CMO\_BIGFLOAT32},
   {\sl int32}\, {\rm prec}, {\sl int32}\, {\rm sign}, {\sl int32}\, {\rm exp},
   {\sl int32}\, \mbox{a[1]}, \ldots , {\sl int32}\, \mbox{a[k]} ) \\
   &:& \mbox{ --- bigfloat をあらわす. a[i], k についてはあとで説明}\\
   \mbox{Complex}        &:& ({\tt CMO\_COMPLEX}, {\sl CMObject}\, {\rm re}, {\sl CMObject}\, {\rm im}) \\
   & & \mbox{ ---  $a+b\sqrt{-1}$ を表す. } \\
 \mbox{Indeterminate}        &:& ({\tt CMO\_INDETERMINATE}, {\sl Cstring}\, {\rm v}) \\  \mbox{Indeterminate}        &:& ({\tt CMO\_INDETERMINATE}, {\sl Cstring}\, {\rm v}) \\
 & & \mbox{ --- 変数名 $v$ . } \\  & & \mbox{ --- 変数名 $v$ . } \\
 \end{eqnarray*}  \end{eqnarray*}
 */  */
   
   
 /*&eg  /*&eg
   
 \bigbreak  \bigbreak
 \noindent  \noindent
 Group CMObject/Basic requires CMObject/Primitive. \\  Group CMObject/Basic requires CMObject/Primitive. \\
 ZZ, QQ, Zero, Rational, Indeterminate,$\in$ CMObject/Basic. \\  ZZ, QQ, Zero, Rational, Indeterminate $\in$ CMObject/Basic. \\
 \begin{eqnarray*}  \begin{eqnarray*}
 \mbox{Zero} &:& ({\tt CMO\_ZERO}) \\  \mbox{Zero} &:& ({\tt CMO\_ZERO}) \\
 & & \mbox{ --- Universal zero } \\  & & \mbox{ --- Universal zero } \\
 \mbox{ZZ}         &:& ({\tt CMO\_ZZ},{\sl int32}\, {\rm f}, {\sl byte}\, \mbox{a[1]}, \ldots  \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{ --- bignum. The meaning of a[i] will be explained later.}\\
 \mbox{QQ}        &:& ({\tt CMO\_QQ},  \mbox{QQ}        &:& ({\tt CMO\_QQ},
Line 94  ZZ, QQ, Zero, Rational, Indeterminate,$\in$ CMObject/B
Line 104  ZZ, QQ, Zero, Rational, Indeterminate,$\in$ CMObject/B
 & & \mbox{ --- Rational number $a/b$. } \\  & & \mbox{ --- Rational number $a/b$. } \\
 \mbox{Rational}        &:& ({\tt CMO\_RATIONAL}, {\sl CMObject}\, {\rm a}, {\sl CMObject}\, {\rm b}) \\  \mbox{Rational}        &:& ({\tt CMO\_RATIONAL}, {\sl CMObject}\, {\rm a}, {\sl CMObject}\, {\rm b}) \\
 & & \mbox{ ---  Rational expression $a/b$. } \\  & & \mbox{ ---  Rational expression $a/b$. } \\
   \mbox{Bigfloat32}         &:& ({\tt CMO\_BIGFLOAT32},
   {\sl int32}\, {\rm prec}, {\sl int32}\, {\rm sign}, {\sl int32}\, {\rm exp},
   {\sl int32}\, \mbox{a[1]}, \ldots , {\sl int32}\, \mbox{a[k]} ) \\
   &:& \mbox{ --- bigfloat. The meaning of a[i], k will be explained later.}\\
   \mbox{Complex}        &:& ({\tt CMO\_COMPLEX}, {\sl CMObject}\, {\rm re}, {\sl CMObject}\, {\rm im}) \\
   & & \mbox{ ---  Complex number $a+b\sqrt{-1}$. } \\
 \mbox{Indeterminate}        &:& ({\tt CMO\_INDETERMINATE}, {\sl Cstring}\, {\rm v}) \\  \mbox{Indeterminate}        &:& ({\tt CMO\_INDETERMINATE}, {\sl Cstring}\, {\rm v}) \\
 & & \mbox{ --- Variable name $v$ . } \\  & & \mbox{ --- Variable name $v$ . } \\
 \end{eqnarray*}  \end{eqnarray*}
Line 101  ZZ, QQ, Zero, Rational, Indeterminate,$\in$ CMObject/B
Line 117  ZZ, QQ, Zero, Rational, Indeterminate,$\in$ CMObject/B
 /*&C  /*&C
   
 */  */
   /*&C
   
   */
   
 /*&jp  /*&jp
 Indeterminate は変数名をあらわす.  Indeterminate は変数名をあらわす.
 v はバイト列であればなにを用いてもよいが,  v はバイト列であればなにを用いてもよいが,
Line 114  escape sequence を用いて実現するのは, 無理があるようで
Line 133  escape sequence を用いて実現するのは, 無理があるようで
 テーブルを作成する必要があるであろう.)  テーブルを作成する必要があるであろう.)
 */  */
 /*&eg  /*&eg
 Indeterminate is a name of a variable.  The name of a variable should be expressed by using Indeterminate.
 v may be any sequence of bytes, but each system has its own  v may be any sequence of bytes, but each system has its own
 restrictions on the names of variables.  restrictions on the names of variables.
 Indeterminates of CMO and internal variable names must be translated  Indeterminates of CMO and internal variable names must be translated
 in one to one correspondence.  in one-to-one correspondence.
 */  */
   
   
 /*&jp  /*&jp
   \subsection{Indeterminate および Tree}
   
 \noindent  \noindent
 Group CMObject/Tree requires CMObject/Basic. \\  Group CMObject/Tree requires CMObject/Basic. \\
 Tree, Lambda $\in$ CMObject/Basic. \\  Tree, Lambda $\in$ CMObject/Tree. \\
 \begin{eqnarray*}  \begin{eqnarray*}
 \mbox{Tree}        &:& ({\tt CMO\_TREE}, {\sl Cstring}\, {\rm name},  \mbox{Tree}        &:& ({\tt CMO\_TREE}, {\sl Cstring}\, {\rm name},
  {\sl Cstring}\, {\rm cdname}, {\sl List}\, {\rm leaves}) \\   {\sl List}\, {\rm attributes}, {\sl List}\, {\rm leaves}) \\
 & & \mbox{ --- 名前 name の定数または関数. 関数の評価はおこなわない. } \\  & & \mbox{ --- 名前 name の定数または関数. 関数の評価はおこなわない. } \\
 & & \mbox{ --- cdname は空文字列でなければ name の意味が説明されている }\\  & & \mbox{ --- attributes は空リストでなければ name の属性を保持している. }\\
 & & \mbox{ --- OpenMath CD (content dictionary) の名前. } \\  & & \mbox{ --- 属性リストは, key と 値のペアである. }\\
 \mbox{Lambda}        &:& ({\tt CMO\_LAMBDA}, {\sl List}\, {\rm args},  \mbox{Lambda}        &:& ({\tt CMO\_LAMBDA}, {\sl List}\, {\rm args},
                           {\sl Tree} {\rm body}) \\                            {\sl Tree} {\rm body}) \\
 & & \mbox{ --- body を args を引数とする関数とする. } \\  & & \mbox{ --- body を args を引数とする関数とする. } \\
 & & \mbox{ --- optional な引数が必要なときは, leaves の後へつづける.} \\  
 \end{eqnarray*}  \end{eqnarray*}
 */  */
 /*&eg  /*&eg
   \subsection{Indeterminate and Tree}
   
 \noindent  \noindent
 Group CMObject/Tree requires CMObject/Basic. \\  Group CMObject/Tree requires CMObject/Basic. \\
 Tree, Lambda $\in$ CMObject/Basic. \\  Tree, Lambda $\in$ CMObject/Tree. \\
 \begin{eqnarray*}  \begin{eqnarray*}
 \mbox{Tree}        &:& ({\tt CMO\_TREE}, {\sl Cstring}\, {\rm name},  \mbox{Tree}        &:& ({\tt CMO\_TREE}, {\sl Cstring}\, {\rm name},
  {\sl Cstring}\, {\rm cdname}, {\sl List}\, {\rm leaves}) \\   {\sl List}\, {\rm attributes}, {\sl List}\, {\rm leaves}) \\
 & & \mbox{ --- A function or a constant of name. Functions are not evaluated. } \\  & & \mbox{ --- ``name'' is the name of the node of the tree. } \\
 & & \mbox{ --- cdname may be a null. If it is not null, it is the name of}\\  & & \mbox{ --- Attributes may be a null list. If it is not null, it is a list of}\\
 & & \mbox{ --- the OpenMath CD (content dictionary). } \\  & & \mbox{ --- key and value pairs. } \\
 \mbox{Lambda}        &:& ({\tt CMO\_LAMBDA}, {\sl List}\, {\rm args},  \mbox{Lambda}        &:& ({\tt CMO\_LAMBDA}, {\sl List}\, {\rm args},
                           {\sl Tree} {\rm body}) \\                            {\sl Tree} {\rm body}) \\
 & & \mbox{ --- a function with the arguments body. } \\  & & \mbox{ --- a function with the arguments body. } \\
 & & \mbox{ --- optional arguments come after leaves.} \\  
 \end{eqnarray*}  \end{eqnarray*}
 */  */
   
Line 205  Lisp の Lambda 表現と同じ.
Line 225  Lisp の Lambda 表現と同じ.
 */  */
 /*&eg  /*&eg
 Lambda is used to define functions.  Lambda is used to define functions.
 It is the same as the Lambda expression in Lisp.  The notion ``lambda'' is borrowed from the language Lisp.
 */  */
   
 \noindent  \noindent
 //&jp 例: $sin(x+e)$ の表現.  //&jp 例: $sin(x+e)$ の表現.
 //&eg Example: the expression of $sin(x+e)$.  //&eg Example: the expression of $sin(x+e)$.
 \begin{verbatim}  \begin{verbatim}
 (CMO_TREE, (CMO_STRING, "sin"), (CMO_STRING, "basic"),  (CMO_TREE, (CMO_STRING, "sin"),
       (CMO_LIST,[size=]1,(CMO_LIST,[size=]2,(CMO_STRING, "cdname"),
                                             (CMO_STRING,"basic")))
     (CMO_LIST,[size=]1,      (CMO_LIST,[size=]1,
         (CMO_TREE, (CMO_STRING, "plus"), (CMO_STRING, "basic"),          (CMO_TREE, (CMO_STRING, "plus"), (CMO_STRING, "basic"),
             (CMO_LIST,[size=]2, (CMO_INDETERMINATE,"x"),              (CMO_LIST,[size=]2, (CMO_INDETERMINATE,"x"),
 //&jp                  (CMO_TREE,(CMO_STRING, "e"),  自然対数の底  //&jp                  (CMO_TREE,(CMO_STRING, "e"),  自然対数の底
 //&eg                  (CMO_TREE,(CMO_STRING, "e"),  the base of natural logarithms  //&eg                  (CMO_TREE,(CMO_STRING, "e"),  the base of natural logarithms
                             (CMO_STRING, "basic"))      (CMO_LIST,[size=]1,(CMO_LIST,[size=]2,(CMO_STRING, "cdname"),
                                             (CMO_STRING,"basic")))
         ))          ))
     )      )
 )  )
 \end{verbatim}  \end{verbatim}
   //&jp  Leave の成分には, 多項式を含む任意のオブジェクトがきてよい.
   //&eg  Elements of the leave may be any objects including polynomials.
   
 \noindent  \noindent
 Example:  Example:
 \begin{verbatim}  \begin{verbatim}
 sm1> [(plus) (Basic) [(123).. (345)..]] [(class) (tree)] dc ::  sm1> [(plus) [[(cdname) (basic)]] [(123).. (345)..]] [(class) (tree)] dc ::
 Class.tree [    $plus$ , $basic$ , [    123 , 345 ]  ]  Class.tree [$plus$ , [[$cdname$ , $basic$ ]], [ 123 , 345 ]  ]
 \end{verbatim}  \end{verbatim}
   
   \noindent
   Example:
   \begin{verbatim}
   asir
   [753] taka_cmo100_xml_form(quote(sin(x+1)));
   <cmo_tree>  <cmo_string>"sin"</cmo_string>
    <cmo_list><cmo_int32 for="length">1</cmo_int32>
      <cmo_list><cmo_int32 for="length">2</cmo_int32>
        <cmo_string>"cdname"</cmo_string>
        <cmo_string>"basic"</cmo_string>
      </cmo_list> </cmo_list>
   <cmo_tree>    <cmo_string>"plus"</cmo_string>
     <cmo_list><cmo_int32 for="length">1</cmo_int32>
       <cmo_list><cmo_int32 for="length">2</cmo_int32>
         <cmo_string>"cdname"</cmo_string>
         <cmo_string>"basic"</cmo_string>
       </cmo_list> </cmo_list>
    <cmo_indeterminate> <cmo_string>"x"</cmo_string>  </cmo_indeterminate>
    <cmo_zz>1</cmo_zz>
   </cmo_tree></cmo_tree>
   \end{verbatim}
   
   
 \bigbreak  \bigbreak
 //&jp 次に, 分散表現多項式に関係するグループを定義しよう.  //&jp 次に, 分散表現多項式に関係するグループを定義しよう.
 /*&eg  /*&eg
 Let us define a group for distributed polynomials. In the following  Let us define a group for distributed polynomials. In the following,
 DMS stands for Distributed Monomial System.  DMS stands for Distributed Monomial System.
 */  */
   
Line 259  $x^e = x_1^{e_1} \cdots x_n^{e_n}$ の各指数 $e_i$
Line 305  $x^e = x_1^{e_1} \cdots x_n^{e_n}$ の各指数 $e_i$
 をあらわす.} \\  をあらわす.} \\
 \mbox{Coefficient}&:& \mbox{ZZ} | \mbox{Integer32} \\  \mbox{Coefficient}&:& \mbox{ZZ} | \mbox{Integer32} \\
 \mbox{Dpolynomial}&:& \mbox{Zero} \\  \mbox{Dpolynomial}&:& \mbox{Zero} \\
 & & |\ ({\tt CMO\_DISTRIBUTED\_POLYNOMIAL},{\sl int32} m, \\  & & |\ ({\tt CMO\_DISTRIBUTED\_POLYNOMIAL},{\sl int32}\, m, \\
 & & \ \ \mbox{DringDefinition},  & & \ \ \mbox{DringDefinition},
 [\mbox{Monomial32}|\mbox{Zero}], \\  [\mbox{Monomial32}|\mbox{Zero}], \\
 & &\ \  & &\ \
Line 301  $x^e = x_1^{e_1} \cdots x_n^{e_n}$ の各指数 $e_i$
Line 347  $x^e = x_1^{e_1} \cdots x_n^{e_n}$ の各指数 $e_i$
                       $x^e = x_1^{e_1} \cdots x_n^{e_n}$. } \\                        $x^e = x_1^{e_1} \cdots x_n^{e_n}$. } \\
 \mbox{Coefficient}&:& \mbox{ZZ} | \mbox{Integer32} \\  \mbox{Coefficient}&:& \mbox{ZZ} | \mbox{Integer32} \\
 \mbox{Dpolynomial}&:& \mbox{Zero} \\  \mbox{Dpolynomial}&:& \mbox{Zero} \\
                  & & |\ ({\tt CMO\_DISTRIBUTED\_POLYNOMIAL},{\sl int32} m, \\                   & & |\ ({\tt CMO\_DISTRIBUTED\_POLYNOMIAL},{\sl int32}\, m, \\
                  & & \ \ \mbox{DringDefinition}, [\mbox{Monomial32}|\mbox{Zero}], \\                   & & \ \ \mbox{DringDefinition}, [\mbox{Monomial32}|\mbox{Zero}], \\
                  & &\ \                   & &\ \
                     \{\mbox{Monomial32}\})  \\                      \{\mbox{Monomial32}\})  \\
Line 347  are implemented on Asir and Kan.
Line 393  are implemented on Asir and Kan.
   
 \subsection{ Zero}  \subsection{ Zero}
 /*&jp  /*&jp
 CMO では ゼロの表現法がなんとおりもあるが,  CMO では ゼロの表現法がなんとおりもあることに注意.
 どのようなゼロをうけとっても,  %% どのようなゼロをうけとっても,
 システムのゼロに変換できるべきである.  %% システムのゼロに変換できるべきである.
 */  */
 /*&eg  /*&eg
 Though CMO has various representations of zero,  Note that CMO has various representations of zero.
 each representation should be translated into zero  
 in the system.  
 */  */
   
   
Line 373  GNU MPライブラリなどを参考にして設計されていて, 符号付
Line 417  GNU MPライブラリなどを参考にして設計されていて, 符号付
 plugin/cmo-gmp.c}) CMO\_ZZ は次の形式をとる.  plugin/cmo-gmp.c}) CMO\_ZZ は次の形式をとる.
 */  */
 /*&eg  /*&eg
 We describe the bignum (multi-precision integer) representation in OpenXM.  We describe the bignum (multi-precision integer) representation
 In OpenXM {\tt CMO\_ZZ} is used to represent bignum. Its design is similar  {\tt CMO\_ZZ} in OpenXM.
   The format is similar
 to that in GNU MP. (cf. {\tt plugin/cmo-gmp.c} in the {\tt kan/sm1}  to that in GNU MP. (cf. {\tt plugin/cmo-gmp.c} in the {\tt kan/sm1}
 distribution). CMO\_ZZ is defined as follows.  distribution). CMO\_ZZ is defined as follows.
 */  */
Line 396  Open xxx 規約では上の CMO は以下の整数を意味する. ($R 
Line 441  Open xxx 規約では上の CMO は以下の整数を意味する. ($R 
 /*&eg  /*&eg
 $f$ is a 32bit integer. $b_0, \ldots, b_n$ are unsigned 32bit integers.  $f$ is a 32bit integer. $b_0, \ldots, b_n$ are unsigned 32bit integers.
 $|f|$ is equal to $n+1$.  $|f|$ is equal to $n+1$.
 The sign of $f$ represents that of the above CMO. As stated in Section  The sign of $f$ represents that of the above integer to be expressed.
   As stated in Section
 \ref{sec:basic0}, a negative 32bit integer is represented by  \ref{sec:basic0}, a negative 32bit integer is represented by
 two's complement.  two's complement.
   
Line 408  In OpenXM the above CMO represents the following integ
Line 454  In OpenXM the above CMO represents the following integ
 \]  \]
   
 /*&jp  /*&jp
   \noindent  例:
 {\tt int32} を network byte order で表現  {\tt int32} を network byte order で表現
 しているとすると,例えば, 整数 $14$ は CMO\_ZZ で表わすと,  しているとすると,例えば, 整数 $14$ は CMO\_ZZ で表わすと,
 */  */
 /*&eg  /*&eg
   \noindent Example:
 If we express {\tt int32} by the network byte order,  If we express {\tt int32} by the network byte order,
 a CMO\_ZZ $14$ is expressed by  a CMO\_ZZ $14$ is expressed by
 */  */
Line 468  Ring by Name を用いた場合, 現在の名前空間で変数 yyy に
Line 516  Ring by Name を用いた場合, 現在の名前空間で変数 yyy に
 We treat polynomial rings and their elements as follows.  We treat polynomial rings and their elements as follows.
   
 Generic DMS ring is 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  where $K$ is a coefficient set. $K$ is unknown in advance
 and it is determined when coefficients of an element are received.  and it is determined when coefficients of an element are received.
 When a server has received an element in Generic DMS ring,  When a server has received an element in Generic DMS ring,
 the server has to translate it into the corresponding local object  the server has to translate it into the corresponding local object
Line 479  In {\tt kan/sm1} things are complicated.
Line 527  In {\tt kan/sm1} things are complicated.
 {\tt kan/sm1} translates a DMS of N variables into an element of  {\tt kan/sm1} translates a DMS of N variables into an element of
 the CurrentRing.  the CurrentRing.
 If the CurrentRing is $n'$-variate and $n' < n$, then  If the CurrentRing is $n'$-variate and $n' < n$, then
 an $n$-variate polynomial ring is newly created. Optional informations such as  an $n$-variate polynomial ring is newly created.
 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,  is specified as the second field of DMS,
 it requests a sever to use a ring object whose name is yyy  it requests a sever to use a ring object whose name is yyy
 as the destination ring for the translation.  as the destination ring for the translation.
 This is done in {\tt kan/sm1}.  
 */  */
   
 \medbreak \noindent  \medbreak \noindent
Line 536  $\in$ CMObject/RecursivePolynomial \\
Line 583  $\in$ CMObject/RecursivePolynomial \\
 \mbox{Polynomial in 1 variable} &:&  \mbox{Polynomial in 1 variable} &:&
 \mbox{({\tt CMO\_POLYNOMIAL\_IN\_ONE\_VARIABLE},\, {\sl int32}\, m, } \\  \mbox{({\tt CMO\_POLYNOMIAL\_IN\_ONE\_VARIABLE},\, {\sl int32}\, m, } \\
 & & \quad \mbox{ Name of the main variable }, \\  & & \quad \mbox{ Name of the main variable }, \\
 & & \quad \mbox{ \{ {\sl int32} e, Coefficient \}} \\  & & \quad \mbox{ \{ {\sl int32} e, Coefficient \}} ) \\
 & & \mbox{ --- m はモノミアルの個数. } \\  & & \mbox{ --- m はモノミアルの個数. } \\
 & & \mbox{ --- e, Coefficieint はモノミアルを表現している. } \\  & & \mbox{ --- e, Coefficieint はモノミアルを表現している. } \\
 & & \mbox{ --- 順序の高い順にならべる. 普通は巾の高い順.} \\  & & \mbox{ --- 順序の高い順にならべる. 普通は巾の高い順.} \\
Line 552  $\in$ CMObject/RecursivePolynomial \\
Line 599  $\in$ CMObject/RecursivePolynomial \\
 \mbox{ ( {\tt CMO\_RECURSIVE\_POLYNOMIAL}, } \\  \mbox{ ( {\tt CMO\_RECURSIVE\_POLYNOMIAL}, } \\
 & & \quad \mbox{ RringDefinition, } \\  & & \quad \mbox{ RringDefinition, } \\
 & & \quad  & & \quad
 \mbox{ Polynomial in 1 variable}\, | \, \mbox{Coefficient}   \\  \mbox{ Polynomial in 1 variable}\, | \, \mbox{Coefficient} )  \\
 \mbox{RringDefinition}  \mbox{RringDefinition}
 & : &  \mbox{ {\sl List} v } \\  & : &  \mbox{ {\sl List} v } \\
 & & \quad \mbox{ --- v は, 変数名(indeterminate) のリスト. } \\  & & \quad \mbox{ --- v は, 変数名(indeterminate) または Tree のリスト. } \\
 & & \quad \mbox{ --- 順序の高い順. } \\  & & \quad \mbox{ --- 順序の高い順. } \\
 \end{eqnarray*}  \end{eqnarray*}
 */  */
Line 564  $\in$ CMObject/RecursivePolynomial \\
Line 611  $\in$ CMObject/RecursivePolynomial \\
 \mbox{Polynomial in 1 variable} &:&  \mbox{Polynomial in 1 variable} &:&
 \mbox{({\tt CMO\_POLYNOMIAL\_IN\_ONE\_VARIABLE},\, {\sl int32}\, m, } \\  \mbox{({\tt CMO\_POLYNOMIAL\_IN\_ONE\_VARIABLE},\, {\sl int32}\, m, } \\
 & & \quad \mbox{ Name of the main variable }, \\  & & \quad \mbox{ Name of the main variable }, \\
 & & \quad \mbox{ \{ {\sl int32} e, Coefficient \}} \\  & & \quad \mbox{ \{ {\sl int32} e, Coefficient \}} ) \\
 & & \mbox{ --- m is the number of monomials. } \\  & & \mbox{ --- m is the number of monomials. } \\
 & & \mbox{ --- A pair of e and Coefficient represents a monomial. } \\  & & \mbox{ --- A pair of e and Coefficient represents a monomial. } \\
 & & \mbox{ --- The pairs of e and Coefficient are sorted in the } \\  & & \mbox{ --- The pairs of e and Coefficient are sorted in the } \\
Line 582  $\in$ CMObject/RecursivePolynomial \\
Line 629  $\in$ CMObject/RecursivePolynomial \\
 \mbox{ ( {\tt CMO\_RECURSIVE\_POLYNOMIAL}, } \\  \mbox{ ( {\tt CMO\_RECURSIVE\_POLYNOMIAL}, } \\
 & & \quad \mbox{ RringDefinition, } \\  & & \quad \mbox{ RringDefinition, } \\
 & & \quad  & & \quad
 \mbox{ Polynomial in 1 variable}\, | \, \mbox{Coefficient}   \\  \mbox{ Polynomial in 1 variable}\, | \, \mbox{Coefficient} )  \\
 \mbox{RringDefinition}  \mbox{RringDefinition}
 & : &  \mbox{ {\sl List} v } \\  & : &  \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. } \\  & & \quad \mbox{ --- It is sorted in the decreasing order. } \\
 \end{eqnarray*}  \end{eqnarray*}
 */  */
Line 607  Example:
Line 654  Example:
 $$   x^3 (1234 y^5 + 17 ) +  x^1 (y^{10} + 31 y^5)  $$  $$   x^3 (1234 y^5 + 17 ) +  x^1 (y^{10} + 31 y^5)  $$
 /*&jp  /*&jp
 をあらわす.  をあらわす.
 非可換多項式もこの形式であらわしたいので, 積の順序を上のように  %%非可換多項式もこの形式であらわしたいので, 積の順序を上のように
 すること. つまり, 主変数かける係数の順番.  %%すること. つまり, 主変数かける係数の順番.
 */  */
 /*&eg  /*&eg
 We intend to represent non-commutative polynomials with the  %%We intend to represent non-commutative polynomials with the
 same form. In such a case, the order of products are defined  %%same form. In such a case, the order of products are defined
 as above, that is a power of the main variable $\times$ a coeffcient.  %%as above, that is a power of the main variable $\times$ a coeffcient.
   
 */  */
   
 \noindent  \noindent
Line 644  $\in$ CMObject/MachineDouble \\
Line 692  $\in$ CMObject/MachineDouble \\
 \begin{eqnarray*}  \begin{eqnarray*}
 \mbox{64bit machine double} &:&  \mbox{64bit machine double} &:&
 \mbox{({\tt CMO\_64BIT\_MACHINE\_DOUBLE}, } \\  \mbox{({\tt CMO\_64BIT\_MACHINE\_DOUBLE}, } \\
 & & \quad \mbox{ {\sl byte} s1 , \ldots , {\sl byte}} s8)\\  & & \quad \mbox{ {\sl byte} s1 , \ldots , {\sl byte} s8})\\
 & & \mbox{ --- s1, $\ldots$, s8 は {\tt double} (64bit). } \\  & & \mbox{ --- s1, $\ldots$, s8 は {\tt double} (64bit). } \\
 & & \mbox{ --- この表現はCPU依存である.}\\  & & \mbox{ --- この表現はCPU依存である.}\\
 &&  \mbox{\quad\quad mathcap に CPU 情報を付加しておく.} \\  &&  \mbox{\quad\quad byte order negotiation を用いる.} \\
 \mbox{Array of 64bit machine double} &:&  \mbox{Array of 64bit machine double} &:&
 \mbox{({\tt CMO\_ARRAY\_OF\_64BIT\_MACHINE\_DOUBLE}, {\sl int32} m, } \\  \mbox{({\tt CMO\_ARRAY\_OF\_64BIT\_MACHINE\_DOUBLE}, {\sl int32} m, } \\
 & & \quad \mbox{ {\sl byte} s1[1] , \ldots , {\sl byte}}\, s8[1], \ldots , {\sl byte}\, s8[m])\\  & & \quad \mbox{ {\sl byte} s1[1] , \ldots , {\sl byte}}\, s8[1], \ldots , {\sl byte}\, s8[m])\\
 & & \mbox{ --- s*[1], $\ldots$ s*[m] は m 個の double (64bit) である. } \\  & & \mbox{ --- s*[1], $\ldots$ s*[m] は m 個の double (64bit) である. } \\
 & & \mbox{ --- この表現はCPU依存である.}\\  & & \mbox{ --- この表現はCPU依存である.}\\
 & & \mbox{ \quad\quad mathcap に CPU 情報を付加しておく.} \\  & & \mbox{ \quad\quad byte order negotiation を用いる.} \\
 \mbox{128bit machine double} &:&  \mbox{128bit machine double} &:&
 \mbox{({\tt CMO\_128BIT\_MACHINE\_DOUBLE}, } \\  \mbox{({\tt CMO\_128BIT\_MACHINE\_DOUBLE}, } \\
 & & \quad \mbox{ {\sl byte} s1 , \ldots , {\sl byte}} s16)\\  & & \quad \mbox{ {\sl byte} s1 , \ldots , {\sl byte} s16})\\
 & & \mbox{ --- s1, $\ldots$, s16 は {\tt long double} (128bit). } \\  & & \mbox{ --- s1, $\ldots$, s16 は {\tt long double} (128bit). } \\
 & & \mbox{ --- この表現はCPU依存である.}\\  & & \mbox{ --- この表現はCPU依存である.}\\
 &&  \mbox{\quad\quad mathcap に CPU 情報を付加しておく.} \\  &&  \mbox{\quad\quad byte order negotiation を用いる.} \\
 \mbox{Array of 128bit machine double} &:&  \mbox{Array of 128bit machine double} &:&
 \mbox{({\tt CMO\_ARRAY\_OF\_128BIT\_MACHINE\_DOUBLE}, {\sl int32} m, } \\  \mbox{({\tt CMO\_ARRAY\_OF\_128BIT\_MACHINE\_DOUBLE}, {\sl int32} m, } \\
 & & \quad \mbox{ {\sl byte} s1[1] , \ldots , {\sl byte}} s16[1], \ldots , {\sl byte} s16[m])\\  & & \quad \mbox{ {\sl byte} s1[1] , \ldots , {\sl byte} s16[1], \ldots , {\sl byte} s16[m]})\\
 & & \mbox{ --- s*[1], $\ldots$ s*[m] は m 個の long double (128bit) である. } \\  & & \mbox{ --- s*[1], $\ldots$ s*[m] は m 個の long double (128bit) である. } \\
 & & \mbox{ --- この表現はCPU依存である.}\\  & & \mbox{ --- この表現はCPU依存である.}\\
 & & \mbox{ \quad\quad mathcap に CPU 情報を付加しておく.}  & & \mbox{ \quad\quad byte order negotiation を用いる.}
 \end{eqnarray*}  \end{eqnarray*}
 */  */
 /*&eg  /*&eg
 \begin{eqnarray*}  \begin{eqnarray*}
 \mbox{64bit machine double} &:&  \mbox{64bit machine double} &:&
 \mbox{({\tt CMO\_64BIT\_MACHINE\_DOUBLE}, } \\  \mbox{({\tt CMO\_64BIT\_MACHINE\_DOUBLE}, } \\
 & & \quad \mbox{ {\sl byte} s1 , \ldots , {\sl byte}} s8)\\  & & \quad \mbox{ {\sl byte} s1 , \ldots , {\sl byte} s8})\\
 & & \mbox{ --- s1, $\ldots$, s8 は {\tt double} (64bit). } \\  & & \mbox{ --- s1, $\ldots$, s8 は {\tt double} (64bit). } \\
 & & \mbox{ --- This depends on CPU.}\\  & & \mbox{ --- Encoding depends on CPU.}\\
 &&  \mbox{\quad\quad Add informations on CPU to the mathcap.} \\  &&  \mbox{\quad\quad Need the byte order negotiation.} \\
 \mbox{Array of 64bit machine double} &:&  \mbox{Array of 64bit machine double} &:&
 \mbox{({\tt CMO\_ARRAY\_OF\_64BIT\_MACHINE\_DOUBLE}, {\sl int32} m, } \\  \mbox{({\tt CMO\_ARRAY\_OF\_64BIT\_MACHINE\_DOUBLE}, {\sl int32} m, } \\
 & & \quad \mbox{ {\sl byte} s1[1] , \ldots , {\sl byte}}\, s8[1], \ldots , {\sl byte}\, s8[m])\\  & & \quad \mbox{ {\sl byte} s1[1] , \ldots , {\sl byte}}\, s8[1], \ldots , {\sl byte}\, s8[m])\\
 & & \mbox{ --- s*[1], $\ldots$ s*[m] are 64bit double's. } \\  & & \mbox{ --- s*[1], $\ldots$ s*[m] are 64bit double's. } \\
 & & \mbox{ --- This depends on CPU.}\\  & & \mbox{ --- Encoding depends on CPU.}\\
 & & \mbox{\quad\quad Add informations on CPU to the mathcap.} \\  & & \mbox{\quad\quad Need the byte order negotiation.} \\
 \mbox{128bit machine double} &:&  \mbox{128bit machine double} &:&
 \mbox{({\tt CMO\_128BIT\_MACHINE\_DOUBLE}, } \\  \mbox{({\tt CMO\_128BIT\_MACHINE\_DOUBLE}, } \\
 & & \quad \mbox{ {\sl byte} s1 , \ldots , {\sl byte}} s16)\\  & & \quad \mbox{ {\sl byte} s1 , \ldots , {\sl byte} s16})\\
 & & \mbox{ --- s1, $\ldots$, s16 は {\tt long double} (128bit). } \\  & & \mbox{ --- s1, $\ldots$, s16 は {\tt long double} (128bit). } \\
 & & \mbox{ --- This depends on CPU.}\\  & & \mbox{ --- Encoding depends on CPU.}\\
 & & \mbox{\quad\quad Add informations on CPU to the mathcap.} \\  & & \mbox{\quad\quad Need the byte order negotiation.} \\
 \mbox{Array of 128bit machine double} &:&  \mbox{Array of 128bit machine double} &:&
 \mbox{({\tt CMO\_ARRAY\_OF\_128BIT\_MACHINE\_DOUBLE}, {\sl int32} m, } \\  \mbox{({\tt CMO\_ARRAY\_OF\_128BIT\_MACHINE\_DOUBLE}, {\sl int32} m, } \\
 & & \quad \mbox{ {\sl byte} s1[1] , \ldots , {\sl byte}} s16[1], \ldots , {\sl byte} s16[m])\\  & & \quad \mbox{ {\sl byte} s1[1] , \ldots , {\sl byte} s16[1], \ldots , {\sl byte} s16[m]})\\
 & & \mbox{ --- s*[1], $\ldots$ s*[m] are 128bit long double's. } \\  & & \mbox{ --- s*[1], $\ldots$ s*[m] are 128bit long double's. } \\
 & & \mbox{ --- This depends on CPU.}\\  & & \mbox{ --- Encoding depends on CPU.}\\
 & & \mbox{\quad\quad Add informations on CPU to the mathcap.} \\  & & \mbox{\quad\quad Need the byte order negotiation.} \\
 \end{eqnarray*}  \end{eqnarray*}
 */  */
   
 \bigbreak  \bigbreak
 //&jp 次に IEEE 準拠の float および Big float を定義しよう.  
 //&eg We define float and big float conforming to the IEEE standard.  
 \begin{verbatim}  \begin{verbatim}
 #define CMO_BIGFLOAT   50  
 #define CMO_IEEE_DOUBLE_FLOAT 51  #define CMO_IEEE_DOUBLE_FLOAT 51
 \end{verbatim}  \end{verbatim}
   
 /*&jp  /*&jp
 IEEE 準拠の float については, IEEE 754 double precision floating-point  IEEE 準拠の float については, IEEE 754 double precision floating-point
 format (64 bit) の定義を見よ.  format (64 bit) の定義を見よ.
   
   256.100006 の Intel Pentium の double64 での内部表現は
   {\tt cd 0c 80 43 } \\
   256.100006 の PowerPC (Mac) の double64 での内部表現は
   {\tt 43 80 0c cd }.
   この例でみるように byte の順序が逆である.
   エンジンスタートの時の byte order negotiation で byte の順序を指定する.
   
   
 */  */
 /*&eg  /*&eg
 See IEEE 754 double precision floating-point (64 bit) for the details of  See IEEE 754 double precision floating-point (64 bit) for the details of
 float conforming to the IEEE standard.  float compliant to the IEEE standard.
   
   The internal expression of 256.100006 in the Intel Pentium  is
   {\tt cd 0c 80 43 } \\
   The internal expression of 256.100006 in the PowerPC (Mac) is
   {\tt 43 80 0c cd }.
   As you have seen in this example,
   the orders of the bytes are opposite each other.
   The byte order is specified by the byte order negotiation protocol
   when the engine starts.
   
 */  */
   
 \noindent  \subsection{Bigfloat32}
 Group CMObject/Bigfloat requires CMObject/Primitive, CMObject/Basic.\\  /*&jp
 Bigfloat  int32 を基本とした bigfloat の表現方法について述べる.
 $\in$ CMObject/Bigfloat \\  この形式は mpfr を 32bit CPU で使用した時の内部表現と共通である.
   */
   /*&eg
   This subsection describes our format for bigfloat in terms of the int32.
   This format is identical to the internal format of mpfr on 32 bit CPU's.
   */
   Ref: {\tt OpenXM/src/mpfr/bfsize/bfsize.c}
   
 \begin{eqnarray*}  \begin{verbatim}
 \mbox{Bigfloat} &:&  #define     CMO_BIGFLOAT32          52
 \mbox{({\tt CMO\_BIGFLOAT}, } \\  \end{verbatim}
 & & \quad \mbox{ {\sl ZZ} a , {\sl ZZ} e})\\  
 & & \mbox{ --- $a \times 2^e$. } \\  
 \end{eqnarray*}  /*&jp
   Bigfloat32 は次の形式の int32 の配列である.
   */
   /*&eg
   The bigfloat32 is an array of int32 numbers of the following format.
   */
   
   \begin{center}
   {\sl int32}\, {\rm prec}, {\sl int32}\, {\rm sign}, {\sl int32}\, {\rm exp},
   {\sl int32}\, \mbox{a[1]}, \ldots , {\sl int32}\, \mbox{a[k]}
   \end{center}
   
   /*&jp
   p=prec は精度, s=sign は符号(1 が正の数,  -1 (2の補数表現)が負の数) ,
   E=exp は指数部で, 上のデータは数
   $$ s (a[k]/B + a[k-1]/B^2 + ... + a[1]/B^k) 2^E  $$
   を表す.
   ここで $B=2^{32}$,
   $k = \lceil p/32 \rceil$
   である.
   */
   /*&eg
   p=prec is the precision, s=sign is the sign(1 means positive,  -1 (expressed by two's complement) is nevative),
   E=exp is the exponent, and the data above expresses the number
   $$ s (a[k]/B + a[k-1]/B^2 + ... + a[1]/B^k) 2^E.  $$
   Here, $B=2^{32}$,
   $k = \lceil p/32 \rceil$.
   */
   

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.15

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