=================================================================== RCS file: /home/cvs/OpenXM/src/kxx/openxxx.tex,v retrieving revision 1.5 retrieving revision 1.6 diff -u -p -r1.5 -r1.6 --- OpenXM/src/kxx/openxxx.tex 2000/01/02 07:35:15 1.5 +++ OpenXM/src/kxx/openxxx.tex 2000/01/13 01:52:19 1.6 @@ -1,4 +1,4 @@ -%% $OpenXM: OpenXM/src/kxx/openxxx.tex,v 1.4 1999/11/22 08:52:55 takayama Exp $ +%% $OpenXM: OpenXM/src/kxx/openxxx.tex,v 1.5 2000/01/02 07:35:15 takayama Exp $ /*&jp %\documentclass{jarticle} \documentstyle{jarticle} @@ -139,13 +139,13 @@ CMO (Common Mathematical Object format) ¥°¥ë¡¼¥× Basic (Common Mathematical Object) ¤ò·Á¼°Åª¤ÊÊýË¡¤ò¤Ä¤«¤ï¤ºÆ³Æþ¤·¤è¤¦. */ /*&eg -Objects in CMO (Common Mathematical Object format) Group Basic0 +Objects in CMO (Common Mathematical Object format) group Basic0 are primitive data such as {\tt int}, {\tt string}. All OpenXM compliant systems should implement all data types -in Group Basic0. +in the group Basic0. In this section, as an introduction, we will introduce -CMObject (Common Mathematical Object) of group Basic0 without formal -method. +CMObject (Common Mathematical Object) of the group Basic0 without +using the Backus-Nauer form. */ /*&jp ¤³¤Î¥°¥ë¡¼¥×¤ÎÀµ¼°¤Ê̾Á°¤Ï, @@ -160,12 +160,14 @@ The canonical name of this group is CMObject/Basic0. In the sequel, {\tt int32} means the signed 32 bit integer expressed by two's complement -(Most internal expressions of {\tt int} of the language C take this expression). +(internal expressions of {\tt int} of the language C usually use +this expression). {\tt byte} means 8 bit data. */ //&C /*&jp +CMObject ¤Î TCP/IP ÍѤμÂÁõ¤Ç¤Ï, CMO ¤Î object ¤Ï \\ \begin{tabular}{|c|c|} \hline @@ -177,13 +179,14 @@ CMO ¤Î object ¤Ï \\ {\tt int32} ¤Çɽ¸½¤¹¤ë¤â¤Î¤Èµ¬Ì󤹤ë. */ /*&eg -CMO consists of a tag and a body: \\ +In our encoding of the CMO's for TCP/IP, +any CMObject consists of a tag and a body: \\ \begin{tabular}{|c|c|} \hline {\tt cmo\_tag}& {\tt cmo\_body} \\ \hline \end{tabular} \\ -{\tt cmo\_tag} should be given a positive +{\tt cmo\_tag} should be given by a positive {\tt int32}. */ @@ -224,12 +227,12 @@ However, {\tt CMO\_ERROR2}, {\tt CMO\_NULL}, {\tt CMO\_INT32}, {\tt CMO\_STRING}, {\tt CMO\_MATHCAP}, {\tt CMO\_LIST} are primitive data and -all servers and clients should implement them. +all servers and clients have to implement them. */ /*&C -\noindent +\medbreak \noindent */ //&jp CMObject Error2 ¤Ï \\ //&eg CMObject Error2 is of the form \\ @@ -250,16 +253,17 @@ ob ¤Ï¥ê¥¹¥È¤Ç¤¢¤ê, TCP/IP ¤Ë¤è¤ë¥¹¥È¥ê¡¼¥à·¿Àܳ¤Î¾ì¹ ¥·¥ê¥¢¥ëÈÖ¹æ¤Ï Integer32 ¤Çɽ¸½¤¹¤ë. */ /*&eg -It is an object when a server makes an error. +It is an object used when a server makes an error. {\it CMObject} ob carries error informations. -ob is a list and in case of the stream connection like TCP/IP -the first element must be the serial number of the OX message causes the error. -The serial number is Integer32. +The instance ob is a list and in case of a stream connection like TCP/IP +the first element must be the serial number of the OX message +that caused the error. +The serial number is given by the data type Integer32. */ /*&C -\noindent +\medbreak \noindent */ //&jp CMObject Null ¤Ï \\ @@ -281,7 +285,7 @@ The serial number is Integer32. */ //&jp 32 bit integer n ¤Ï CMObject ¤È¤·¤Æ¤Ï Integer32 ¤È¸Æ¤Ð¤ì, \\ -//&eg 32 bit integer n is called Integer32 as CMObject and has the format \\ +//&eg 32 bit integer n is called Integer32 as a CMObject and has the format \\ /*&C \begin{tabular}{|c|c|} \hline @@ -293,12 +297,12 @@ The serial number is Integer32. /*&C -\noindent +\medbreak \noindent */ //&jp Ťµ n ¤Î ¥Ð¥¤¥ÈÎó data ¤Ï CMObject ¤È¤·¤Æ¤Ï, Datum ·¿¤È¤è¤Ð¤ì \\ -//&eg A byte array of the length n is called Datum as CMObject and has the format \\ +//&eg A byte array of the length n is called Datum as a CMObject and has the format \\ /*&C \begin{tabular}{|c|c|c|c|} \hline @@ -338,7 +342,7 @@ $\cdots$ & {\tt byte} {\rm data[n-1]} \\ \noindent */ //&jp CMObject Mathcap ¤Ï \\ -//*eg CMObject Mathcap has the format \\ +//&eg CMObject Mathcap has the format \\ /*&C \begin{tabular}{|c|c|} \hline @@ -348,29 +352,32 @@ $\cdots$ & {\tt byte} {\rm data[n-1]} \\ */ /*&jp ¤Ê¤ë·Á¤Çɽ¸½¤¹¤ë. -{\tt ob} ¤Ï¥ê¥¹¥È¤Ç¤¢¤ê¾¯¤Ê¤¯¤È¤â2¤Ä¤ÎÍ×ÁǤò¤â¤Ä. +{\tt ob} ¤Ï¥ê¥¹¥È¤Ç¤¢¤ê¾¯¤Ê¤¯¤È¤â3¤Ä¤ÎÍ×ÁǤò¤â¤Ä. 0 ÈÖÌܤÎÍ×ÁǤÏ, Integer32 ¤Çɽ¤·¤¿ OpenXM protocol version number ¤È, Cstring ¤Çɽ¤·¤¿¥·¥¹¥Æ¥à̾, Server version, CPU type, ¤½¤Î¾¤Î¾ðÊó ¤Î¥ê¥¹¥È¤Ç¤¢¤ë. 1 ÈÖÌܤÎÍ×ÁǤÏ, ¥·¥¹¥Æ¥à xxx ¤¬°·¤¦¤³¤È¤Î²Äǽ¤Ê -SM ¥¿¥°, OX DATA ¥¿¥¤¥×¤È¤½¤ÎÉղþðÊó (CMO ¥¿¥°¤Ê¤É) -¤ò, Integer32 ¤Çɽ¸½¤·¤¿¤â¤Î¤ò½¸¤á¤¿¥ê¥¹¥È¤Ç¤¢¤ë. +SM ¥¿¥°¤ò, Integer32 ¤Çɽ¸½¤·¤¿¤â¤Î¤ò½¸¤á¤¿¥ê¥¹¥È¤Ç¤¢¤ë. +3 ÈÖÌܤÎÍ×ÁǤÏ, ¥·¥¹¥Æ¥à xxx ¤¬¤¢¤Ä¤«¤¦¤³¤È¤Î²Äǽ¤Ê +¥Ç¡¼¥¿·Á¼°¤ò¤¢¤Ä¤á¤¿¥ê¥¹¥È¤Ç¤¢¤ë. +¾ÜºÙ¤Ï mathcap ¤ÎÀá¤ÇÀâÌÀ¤¹¤ë. */ /*&eg -ob is a list of which length is more than or equal to two. +ob is a list of which length is more than or equal to three. The first element is a list of OpenXM protocol version number in Integer32, the server name in Cstring, the server version and CPU type in Cstring, and extra informations. -The second element is a list of SM tags and OX data type tags with -suplementary informations (e.g., a list of available CMO tags) -in Integer 32. +The second element is a list of SM tags in Integer 32. +The third element is a list of data type tags which the server or the client +can understand. +The details will be explained in the section on mathcap. */ /*&C -\noindent +\medbreak \noindent */ //&jp Ťµ m ¤Î¥ê¥¹¥È¤Ï \\ //&eg A list of the length m has the form \\ @@ -394,14 +401,16 @@ CMO ¤ÎBasic0 ¤Îɽ¸½Ë¡¤òÀâÌÀ¤·¤¿¤¬, ¤³¤³¤Ç¤Ï, CMO ¤Î Lisp É÷ɽ¸½ (Lisp-like expression) ¤Ç¤¢¤ë CMOexpression -¤ª¤è¤Ó CMO ¤Îɸ½à encoding Ë¡¤òÀâÌÀ¤¹¤ë. +¤ª¤è¤ÓÁ°Àá¤ÇÀâÌÀ¤·¤¿ CMO ¤Îɸ½à encoding Ë¡¤ò¤â¤¦°ìÅÙÀâÌÀ¤¹¤ë. % (¥¿¥°¤Î¾Êάµ­Ë¡¤¬¤Û¤·¤¤.) */ /*&eg In the previous setion, we have explained the format of CMO's in the Basic0 group. In this section, we will introduce CMOexpression which is like the -bracket expression of Lisp and a standard encoding method of CMO. +bracket expression of Lisp. +We again explain a standard encoding method of CMO, +which we have already explained in the previous section. */ /*&jp @@ -411,6 +420,8 @@ bracket expression of Lisp and a standard encoding met ``:'' ¤ÏÄêµÁ¤ò°ÕÌ£¤¹¤ë. ``$|$'' ¤Ï''¤Þ¤¿¤Ï''¤ò°ÕÌ£¤¹¤ë. \{ X \} ¤Ï X ¤Î 0 ²ó°Ê¾å¤Î·«¤êÊÖ¤·¤òɽ¤¹. [ x ] ¤Ï X ¤¬ 0 ²ó¤Þ¤¿¤Ï 1 ²ó½Ð¸½¤¹¤ë¤³¤È¤òɽ¤¹. +¤³¤Îµ­Ë¡¤òÍѤ¤¤ë¤È CMOexpression ¤Ï¼¡¤Î¤è¤¦¤ËÄêµÁ¤Ç¤­¤ë. + */ /*&eg @@ -420,6 +431,7 @@ Symbols in the type writer fonts mean terminals. ``$|$'' means ''or''. \{ X \} is a repetition of X of more than or equal to 0 times. [ x ] stands for X or nothing. +By using this notation, CMOexpression is defined as follows. */ @@ -499,7 +511,7 @@ CMObject ¤Î 32 bit integer $n$ ¤òɽ¸½¤·¤Æ¤¤¤ë¤ó¤À¤È¤¤¤¦¤³¤È¤¬, 1 ¹Ô¤Ç¤ï¤«¤ë. */ /*&eg -(Example part has not yet been translated.) +(This part has not yet been translated.) */ /*&jp ¤³¤Îµ­Ë¡¤òÍѤ¤¤Æ, Á°Àá¤ÇƳÆþ¤·¤¿, Basic0 ¤Î CMObject ¤ò @@ -627,14 +639,31 @@ CMOexpression ¤È, CMObject ¤Î¶èÊ̤òÍý²ò¤·¤Æ¤ª¤¯¤Î¤Ï½ÅÍ "Hello" \end{verbatim} +*/ +/*&C + +*/ + +/*&jp ¼¡¤Ë, ɸ½à encoding Ë¡¤òÀâÌÀ¤·¤è¤¦. ɸ½à encoding Ë¡¤Ç¤Ï, cmo\_tag ¤ò ¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤Î 32 bit integer {\tt int32} ¤Ë, ¤½¤Î¾¤Î¥Õ¥£¡¼¥ë¥É¤Ï, ÄêµÁ¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¥Ç¡¼¥¿·¿¤Ë½¾¤¤, byte ¥Ç¡¼¥¿ {\tt byte} ¤«¤Þ¤¿¤Ï ¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤Î 32 bit integer {\tt int32} ¤Ë, ÊÑ´¹¤¹¤ë. +*/ +/*&eg +Let us explain the standard encoding method. +All {\tt int32} data are encoded into network byte order 32 bit integers +and byte data are encoded as it is. +*/ +/*&C + +*/ + +/*&jp ¹â®¤ÎÄÌ¿®ÊýË¡¤òÍѤ¤¤Æ ¸úΨ¤ò½Å»ë¤¹¤ëÀܳ¤Î¾ì¹ç¤Ë¤Ï, {\tt int32} ¤ò network byte order ¤ËÊÑ´¹¤¹¤ëÁàºî¤¬¤ª¤ª¤­¤Ê¥ª¡¼¥Ð¥Ø¥Ã¥É¤È¤Ê¤ë¤³¤È¤¬ @@ -643,12 +672,33 @@ byte ¥Ç¡¼¥¿ {\tt byte} ¤«¤Þ¤¿¤Ï Ìó 90\% ¤Î»þ´Ö¤¬ network byte order ¤Ø¤ÎÊÑ´¹¤Ë¤Ä¤¤¤ä¤µ¤ì¤Æ¤¤¤ë¤È¤¤¤¦ ¼Â¸³¥Ç¡¼¥¿¤â¤¢¤ë. ¸úΨ¤ò½Å»ë¤·¤¿ encoding Ë¡¤Ë¤Ä¤¤¤Æ¤Ï¸å½Ò¤¹¤ë. +*/ +/*&eg +When we are using a high speed network, +the translation from the internal expression of 32 bit integers to +network byte order may become a bottle neck. +There are experimental data which presents that 90 percents of the transmission +time are +for the translation to the network byte order to send {\tt CMO\_ZZ} of size +12M bytes on a 100Mbps network. +In a later section, we will discuss a protocol to avoid the translation. +*/ +/*&C -ɸ½à encoding Ë¡¤ÏÁ´¤Æ¤Î¥·¥¹¥Æ¥à¤¬´ðÁäȤ·¤ÆÈ÷¤¨¤ë¤Ù¤­ÊÑ´¹Ë¡¤Ç¤¢¤ë. +*/ + +/*&jp ɸ½à encoding ¤È CMOexpression ¤Î´Ö¤ÎÊÑ´¹¤ÏÍưפǤ¢¤ë. Á°Àá¤ÇÍѤ¤¤¿¥Ç¡¼¥¿¤Îɽµ­Ë¡, ¤¿¤È¤¨¤Ð, +*/ +/*&eg +The translation between the standard encoding and CMOexpression +is easy. +For example, +*/ +/*&C \begin{center} \begin{tabular}{|c|c|} \hline @@ -656,17 +706,23 @@ byte ¥Ç¡¼¥¿ {\tt byte} ¤«¤Þ¤¿¤Ï \hline \end{tabular} \end{center} +*/ +/*&jp ¤Ï, CMOexpression +*/ +/*&eg +is the encoding of the CMOexpression +*/ +/*&C \begin{center} ({\tt CMO\_INT32}, 1234) \end{center} +*/ +/*&jp ¤Î ɸ½à encoding Ë¡¤Ë¤è¤ëɽ¸½¤Ç¤¢¤ë. - */ -/*&eg -(This part has not yet been translated.) -*/ + //&jp \section{ Open XM ¤ÎÄÌ¿®¥â¥Ç¥ë} //&eg \section{ Communication model of Open XM} (This part has not yet been translated) @@ -1967,8 +2023,11 @@ Tree, Lambda $\in$ CMObject/Basic1. \\ \end{eqnarray*} */ -/*&jp +/*&C +*/ + +/*&jp ¿ô¼°¤ò½èÍý¤¹¤ë¥·¥¹¥Æ¥à¤Ç¤Ï, Tree ¹½Â¤¤¬°ìÈ̤ˤâ¤Á¤¤¤é¤ì¤ë. ¤¿¤È¤¨¤Ð, $\sin(x+e)$ ¤Ï, {\tt (sin, (plus, x, e))} @@ -1986,7 +2045,22 @@ Tree ¹½Â¤¤Ï Open Math É÷¤Îɽ¸½¤ò¤â¤Á¤¤¤¿ CMO ¤òƳÆþ¤¹¤ ¤Þ¤¿¤³¤Î¤Û¤¦¤¬, ¤ï¤ì¤ï¤ì¤ÎÁÛÄꤹ¤ë¥·¥¹¥Æ¥à xxx ¤Ë¤ª¤¤¤Æ, Open XM Âбþ¤¬ ¤Ï¤ë¤«¤ËÍưפǤ¢¤ë. ¤Ê¤ª, Tree ¤Ï, Open Math ¤Ç¤Ï, Symbol, Application ¤Î¥á¥«¥Ë¥º¥à¤ËÁêÅö¤¹¤ë. +*/ +/*&eg +In many computer algebra systems, mathematical expressions are usually +expressed in terms of a tree structure. +For example, +$\sin(x+e)$ is expressed as +{\tt (sin, (plus, x, e))} +as a tree. +We can @@@ +*/ + +/*&C + +*/ +/*&jp Lambda ¤Ï´Ø¿ô¤òÄêµÁ¤¹¤ë¤¿¤á¤Î´Ø¿ô¤Ç¤¢¤ë. Lisp ¤Î Lambda ɽ¸½¤ÈƱ¤¸.