=================================================================== RCS file: /home/cvs/OpenXM/doc/OpenXM-specs/formal-expression.tex,v retrieving revision 1.1 retrieving revision 1.8 diff -u -p -r1.1 -r1.8 --- OpenXM/doc/OpenXM-specs/formal-expression.tex 2000/01/20 08:52:46 1.1 +++ OpenXM/doc/OpenXM-specs/formal-expression.tex 2020/03/14 01:21:56 1.8 @@ -1,33 +1,34 @@ -%% $OpenXM$ -//&jp \section{ CMO の形式的表現方法 } +%% $OpenXM: OpenXM/doc/OpenXM-specs/formal-expression.tex,v 1.7 2000/09/09 21:59:13 takayama Exp $ +//&jp \section{ CMO 綵√茵憝号 } //&eg \section{ A formal expression of CMO } /*&jp -前の節で CMO の表現方法を形式的に定義せず, -CMO のBasic0 の表現法を説明したが, -ここでは, CMO の Lisp 風表現 (Lisp-like expression) -である +膀 CMO 茵憝号綵√絎臂, +CMO Primitive 茵憝茯, +с, 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 the previous section, we have explained the format of CMO's in the +Primitive group. In this section, we will introduce CMOexpression which is like the bracket expression of Lisp. We again explain a standard encoding method of CMO, -which we have already explained in the previous section. +which we have already explained in the previous section, but +the explanation is more formal. */ /*&jp -まず, CMOexpression を形式的に 拡張 BNF 記法を用いて定義しよう. -タイプライタフォントでかかれた記号は終端記号を意味する. -``:'' は定義を意味する. ``$|$'' は''または''を意味する. -\{ X \} は X の 0 回以上の繰り返しを表す. -[ x ] は X が 0 回または 1 回出現することを表す. -この記法を用いると CMOexpression は次のように定義できる. +障, CMOexpression 綵√ ≦宍 BNF 荐羈絎臂. +帥ゃゃ帥潟с荐垩腟腴荐垩潟. +``:'' 絎臂潟. ``$|$'' ''障''潟. +\{ X \} X 0 篁ヤ膵違菴茵. +[ x ] X 0 障 1 榊憗茵. +荐羈 CMOexpression 罨<絎臂с. */ /*&eg @@ -56,23 +57,21 @@ By using this notation, CMOexpression is defined as fo \end{eqnarray*} */ /*&jp -終端記号 {\tt int32} は, 32 bit integer を表す, 10 進または 16 進の数字の -列である. -終端記号 {\tt string} は''文字''の列である. -終端記号 {\tt byte} は 8 bit データを表す, 10 進または 16 進の数字の列である. - +腟腴荐 {\tt int32} , 32 bit integer 茵, 10 蚊障 16 蚊医 +с. +腟腴荐 {\tt string} ''絖''с. +腟腴荐 {\tt byte} 8 bit 若帥茵, 10 蚊障 16 蚊医с. */ -/*&jp +/*&eg Terminal {\tt int32} is signed 32 bit integer. Terminal {\tt string} is a byte array which usually expresses a string. Terminal {\tt byte} is 8 bit data. - */ /*&jp -CMOexpression にあらわれる各要素を区切るために {\tt ,} (コンマ) を用いてもよい. -{\tt cmo\_tag} は {\tt CMO\_} で始まる定数である. -CMOexpression で表現される object を CMObject と呼ぶ. +CMOexpression 荀膣阪 {\tt ,} (潟潟) . +{\tt cmo\_tag} {\tt CMO\_} у障絎違с. +CMOexpression ц;憗 object CMObject 若. */ /*&eg @@ -82,60 +81,57 @@ The comma ({\tt ,}) may be used to separate each eleme */ /*&jp -この表記法 CMOexpression を利用して, CMO Basic0 の object を記述 -してみよう. -Object 自体の構造を説明するため, -BNF をもうすこし拡張して, 非終端記号, 終端記号名のみならず, 変数の -名前も書くことにする. こうすることにより, object の意味の説明も容易になる -からである. また ``---'' でコメントのはじまりを表すものとする. +茵荐羈 CMOexpression , CMO Primitive object 荐菴 +帥. +Object 篏罕茯, +BNF ≦宍, 腟腴荐, 腟腴荐垸帥, 紊違 +吾. , object 潟茯絎号 +с. 障 ``---'' с潟<潟障茵. */ /*&eg -Let us describe CMO's in the Basic0 group. +Let us describe CMO's in the Primitive group. In order to explain the meaning of objects, we may also put variable names to CMOexpressions. The start of comments are denoted by ``---''. */ /*&jp -たとえば, (CMObject の) 32 bit integer である integer32 を -BNFで定義すれば, +, (CMObject ) 32 bit integer с integer32 +BNFу臂, \begin{center} Integer32 \ : \ ({\tt CMO\_INT32}, {\tt int32}) \end{center} -と書くのが本来の書き方による記法であるが, ここでは, +吾ャ吾鴻荐羈с, с, \begin{eqnarray*} \mbox{Integer32} \ &:& \ ({\tt CMO\_INT32}, {\sl int32}\ n) \\ -& & \ \mbox{--- 32 bit integer $n$ を表す. } \\ +& & \ \mbox{--- 32 bit integer $n$ 茵. } \\ \end{eqnarray*} -と書くことを許すことにする. -このように書くことにより, 非終端記号 Integer32 は, +吾荐宴. +吾, 腟腴荐 Integer32 , \begin{center} Integer32 \ : \ ({\tt CMO\_INT32}, {\tt int32}) \end{center} -のように, 終端記号 {\tt CMO\_INT32} と {\tt int32} を成分にもち, -CMObject の +, 腟腴荐 {\tt CMO\_INT32} {\tt int32} , +CMObject ({\tt CMO\_INT32}, {\sl int32}\ n) -は, -32 bit integer $n$ を表現しているんだということが, 1 行でわかる. +, +32 bit integer $n$ 茵憗, 1 茵с. */ -/*&eg -(This part has not yet been translated.) -*/ /*&jp -この記法を用いて, 前節で導入した, Basic0 の CMObject を -形式的に定義しよう. +荐羈, 膀уャ, Primitive CMObject +綵√絎臂. */ /*&eg By using this notation, let us define formally CMObjects in the group -Basic0. +Primitive. */ /*&C \bigbreak \noindent -Group CMObject/Basic0 requires nothing. \\ -Error2, Null, Integer32, Datum, Cstring, Mathcap, List $\in$ CMObject/Basic0. \\ -Document of CMObject/Basic0 is at {\tt http://www.math.kobe-u.ac.jp/OpenXM} +Group CMObject/Primitive requires nothing. \\ +Error2, Null, Integer32, Datum, Cstring, Mathcap, List $\in$ CMObject/Primitive. \\ +Document of CMObject/Primitive is at {\tt http://www.math.kobe-u.ac.jp/OpenXM} (in English and Japanese) \\ \begin{eqnarray*} \mbox{Error2}&:& ({\tt CMO\_ERROR2}, {\sl CMObject}\, \mbox{ob}) \\ @@ -157,7 +153,7 @@ Document of CMObject/Basic0 is at {\tt http://www.math */ -//&jp Cstring で, {\sl string} s の部分を {\tt byte} に分解すれば, +//&jp Cstring , {\sl string} s {\tt byte} 茹c, //&eg In the definition of ``Cstring'', if we decompose ``{\sl string} s'' into bytes, then ``Cstring'' should be defined as /*&C \begin{eqnarray*} @@ -166,27 +162,26 @@ Document of CMObject/Basic0 is at {\tt http://www.math \ldots, {\sl byte}\ \mbox{s[n-1]}) \end{eqnarray*} */ -//&jp となる. +//&jp . /*&jp -また, -``Group CMObject/Basic0 requires nothing'' -は, 以下は, グループ CMObject/Basic0 の定義であり, -このグループの CMObject を定義するのに, 要請される CMObject のグループは -ないことを示す. +障, +``Group CMObject/Primitive requires nothing'' +, 篁ヤ, 違若 CMObject/Primitive 絎臂с, +違若 CMObject 絎臂, 荀茫 CMObject 違若 +腓冴. ``Error2, Null, Integer32, Datum, Cstring, Mathcap, List -$\in$ CMObject/Basic0'' -は, グループ CMObject/Basic0 には, Error2, Null, Integer32, -Datum, Cstring なるクラスの object が属することを示す. +$\in$ CMObject/Primitive'' +, 違若 CMObject/Primitive , Error2, Null, Integer32, +Datum, Cstring 鴻 object 絮腓冴. */ /*&eg -また, -``Group CMObject/Basic0 requires nothing'' -means that there is no super group to define CMO's in the group Basic0. +``Group CMObject/Primitive requires nothing'' +means that there is no super group to define CMO's in the group Primitive. ``Error2, Null, Integer32, Datum, Cstring, Mathcap, List -$\in$ CMObject/Basic0'' +$\in$ CMObject/Primitive'' means that Error2, Null, Integer32, Datum, Cstring -are members of the group CMObject/Basic0. +are members of the group CMObject/Primitive. */ /*&C @@ -194,8 +189,8 @@ are members of the group CMObject/Basic0. */ /*&jp -では, 実際のデータの表現の例をみてみよう. -たとえば, 32 bit integer の 1234 は, +с, 絎若帥茵憗箴帥帥. +, 32 bit integer 1234 , */ /*&eg Let us see examples. @@ -207,8 +202,8 @@ Let us see examples. \end{center} */ /*&jp -とかく. -文字列 ``Hello'' は +. +絖 ``Hello'' */ /*&eg The string ``Hello'' is expressed as @@ -218,47 +213,79 @@ The string ``Hello'' is expressed as ({\tt CMO\_STRING}, 5, "Hello") \end{center} */ -//&jp と書く. +//&jp 吾. /*&C */ /*&jp -CMOexpression と, CMObject の区別を理解しておくのは重要である. -たとえば +CMOexpression , CMObject 阪ャ茹c荀с. + \begin{center} ({\tt CMO\_INT32}, 234, "abc",({\tt CMO\_STRING})) \end{center} -は CMOexpression ではあるが, CMObject ではない. -これは, 文法的には正しいプログラムだが, なにをやるのかは全く不明な -プログラムと似ている. + CMOexpression с, CMObject с. +, 羈罩c違, 鋇 +違篌若. -さて, Open math 風 (\cite{openmath}) -の SGML 表現法も可能であり, その場合は, 上の二つの例は次のように -書く. +*/ + +/*&jp +, Open math 蘂 (\cite{openmath}) + XML 茵憝純с, 翫, 筝篋ゃ箴罨< +吾. +*/ +/*&eg +CMO's are expressed by XML like Open Math (\cite{openmath}). +See example below. +*/ + +/*&C + \begin{verbatim} - -1234 - + + + 1234 + - -5 -"Hello" - + + 5 + "Hello" + + \end{verbatim} */ +//&jp \noindent cmo\_string 罨<. +//&eg \noindent cmo\_string may be expressed as follows. /*&C +\begin{verbatim} + + + 5 + 'H' 'e' 'l' + 'l' 'o' + + +\end{verbatim} */ +//&jp \noindent 翫 cmo\_string DTD 絎臂罨<. \\ +//&eg \noindent In this case, the DTD for cmo\_string is as follows; \\ +//&C \verb+ + +/*&C + +\bigbreak +*/ + /*&jp -次に, 標準 encoding 法を説明しよう. -標準 encoding 法では, cmo\_tag を ネットワークバイトオーダーの -32 bit integer {\tt int32} に, -その他のフィールドは, 定義に記述されているデータ型に従い, -byte データ {\tt byte} かまたは -ネットワークバイトオーダーの 32 bit integer {\tt int32} に, 変換する. +罨<, 罔羣 encoding 羈茯. +罔羣 encoding 羈с, cmo\_tag 若ゃ若若 +32 bit integer {\tt int32} , +篁c若, 絎臂荐菴違若水緇, +byte 若 {\tt byte} 障 +若ゃ若若 32 bit integer {\tt int32} , 紊. */ /*&eg Let us explain the standard encoding method. @@ -271,24 +298,26 @@ and byte data are encoded as it is. */ /*&jp -高速の通信方法を用いて -効率を重視する接続の場合には, {\tt int32} を network byte order -に変換する操作がおおきなオーバヘッドとなることが -報告されている. -100Mbps の通信路で 12Mbytes の {\tt CMO\_ZZ} の転送では -約 90\% の時間が network byte order への変換についやされているという -実験データもある. -効率を重視した encoding 法については後述する. +蕭篆≧号 +合荀・膓翫, {\tt int32} network byte order +紊篏若 +怨. +100Mbps 篆∴君 12Mbytes {\tt CMO\_ZZ} 荵∫с +膣 90\% network byte order 吾紊ゃ +絎薑若帥. +合荀 encoding 羈ゃ緇菴違 \ref{subsection:byteorder}. */ /*&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 +time are used 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. +12M bytes. +We used a 100Mbps network. +In a later section \ref{subsection:byteorder}, +we will discuss a protocol to avoid the translation. */ /*&C @@ -296,9 +325,9 @@ In a later section, we will discuss a protocol to avoi */ /*&jp -標準 encoding と CMOexpression の間の変換は容易である. -前節で用いたデータの表記法, -たとえば, +罔羣 encoding CMOexpression 紊絎号с. +膀х若帥茵荐羈, +, */ /*&eg The translation between the standard encoding and CMOexpression @@ -315,7 +344,7 @@ For example, \end{center} */ /*&jp -は, CMOexpression +, CMOexpression */ /*&eg is the encoding of the CMOexpression @@ -326,7 +355,60 @@ is the encoding of the CMOexpression \end{center} */ /*&jp -の 標準 encoding 法による表現である. + 罔羣 encoding 羈茵憗с. */ +/*&C +\bigbreak + +*/ + +/*&jp +(絎薑) +CMO OX packets XML 荀 \cite{xml} 羣. +XML 荀若 Attribute binary encode +劫ャ帥 \\ +*/ +/*&eg +(Experimental) +CMO and OX packets are complient to XML specification \cite{xml}. +In order to encode ``Attribute'' in XML in our binary format, +we have a tag: \\ +*/ +//&C \verb! #define CMO_ATTRIBUTE_LIST (LARGEID+3) ! \\ +/*&jp +. +*/ +/*&jp + Attribute {\tt font="Times-Roman" } \\ +*/ +/*&eg +For example, the attibute {\tt font="Times-Roman" } is encoded as \\ +*/ +/*&C +\begin{verbatim} + (CMO_ATTRIBUTE (CMO_LIST + (CMO_LIST (CMO_STRING,"font") (CMO_STRING, "Times-Roman")))) +\end{verbatim} +*/ +/*&jp + encoding . +*/ +//&C +/*&jp +劫ャ CMO tag {\tt CMO\_ATTRIBUTE\_LIST} 篁ュ, +XML 茵憗с XML 帥違茹c. +*/ +/*&eg +All tags except this special CMO tag {\tt CMO\_ATTRIBUTE\_LIST} +are XML tags in the CMO/XML expression. +*/ +/*&jp +CMO/XML {\it comment}, {\it for} ゃ +attributes CMO binary expression 潟潟若. +*/ +/*&eg +CMO/XML attributes such as {\it comment}, {\it for} +are not encoded in the CMO binary expression. +*/