=================================================================== RCS file: /home/cvs/OpenXM/doc/OpenXM-specs/communication-model.tex,v retrieving revision 1.2 retrieving revision 1.3 diff -u -p -r1.2 -r1.3 --- OpenXM/doc/OpenXM-specs/communication-model.tex 2000/01/20 09:22:01 1.2 +++ OpenXM/doc/OpenXM-specs/communication-model.tex 2000/01/21 01:30:38 1.3 @@ -1,4 +1,4 @@ -%% $OpenXM: OpenXM/doc/OpenXM-specs/communication-model.tex,v 1.1.1.1 2000/01/20 08:52:46 noro Exp $ +%% $OpenXM: OpenXM/doc/OpenXM-specs/communication-model.tex,v 1.2 2000/01/20 09:22:01 noro Exp $ //&jp \section{ Open XM ¤ÎÄÌ¿®¥â¥Ç¥ë} //&eg \section{ Communication model of Open XM} (This part has not yet been translated) @@ -25,7 +25,7 @@ In our model of comutation, mathematical processes proceed a computation by exchanging messages. Each process is a stack machine, which is called an OX stack machine. -The following method are possible to realize communications between +The following methods are possible to realize communications between mathematical processes. \begin{enumerate} \item Communication by files. @@ -69,45 +69,15 @@ CMObject ¤Ë¤Ä¤¤¤Æ¤Ï¤¹¤Ç¤Ë Basic0 ¤Î CMObject ¤ÎÀâÌÀ¤ò¤ ¤¢¤È¤Ç CMObject ¥ì¥Ù¥ë 1¤ÎÀâÌÀ¤ò¤¹¤ë. OX Message ¤Î {\tt ox message\_tag} ¤ÎÄê¿ô¤Ï {\tt OX\_} ¤Ç»Ï¤Þ¤ë. - -¤³¤Î¥á¥Ã¥»¡¼¥¸¤ò, OX Message (Open XM message object) ¤È¤è¤Ö. -OX Message ¤Ï¥È¥Ã¥×¥ì¥Ù¥ë¤Î¥á¥Ã¥»¡¼¥¸ object ¤Ç¤¢¤ê, -»ÅÍͽñ¤Ç¤Ï, ¤µ¤Þ¤¶¤Þ¤Ê¥°¥ë¡¼¥×¤Ë°¤¹¤ë object ¤¬Åо줹¤ë. -¥°¥ë¡¼¥×̾¤Ï, ¤¿¤È¤¨¤Ð, OX Message/TCPIP/Basic0 ¤Ê¤É¤È½ñ¤¯. -{\tt message\_body} ¤ÎÉôʬ¤Î»ÅÍͤÏ, OX Message -¤Î¾å°Ì¤Ë°ÌÃÖ¤¹¤ëÉôʬ¤Ç¤¢¤ê, SMobject ¤Þ¤¿¤Ï CMObject ¤¬¤¯¤ë. -¤³¤ì¤é¤Î object ¤Ï¥¿¥°¤ò¤â¤Á, ¤½¤Î¥¿¥°Äê¿ô¤Ï {\tt SM\_} ¤Þ¤¿¤Ï -{\tt CMO\_} ¤Ç¤Ï¤¸¤Þ¤ë. -SMobject ¤Ï, ¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¥³¥Þ¥ó¥É¥á¥Ã¥»¡¼¥¸ object ¤Ç¤¢¤ê, -¤ä¤Ï¤ê, ¥°¥ë¡¼¥×ʬ¤±¤µ¤ì¤Æ¤¤¤ë. -³Æ¥°¥ë¡¼¥×̾¤Ï, -SMobject/Basic0, SMobject/Basic1 ¤Ê¤É¤È½ñ¤¯. -SMobject ¤Î¹½Â¤¤Ï -¥µ¡¼¥Ð¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¤ÎÀá¤Ç¾Ü¤·¤¯ÀâÌÀ¤¹¤ë. -CMObject ¤Ë¤Ä¤¤¤Æ¤Ï¤¹¤Ç¤Ë Basic0 ¤Î CMObject ¤ÎÀâÌÀ¤ò¤·¤¿¤¬, -¤¢¤È¤Ç CMObject ¥ì¥Ù¥ë 1¤ÎÀâÌÀ¤ò¤¹¤ë. -OX Message ¤Î -{\tt ox message\_tag} ¤ÎÄê¿ô¤Ï {\tt OX\_} ¤Ç»Ï¤Þ¤ë. */ /*&eg We call it an OX message (OpenXM message object). OX Message is the top level message object. The OX messages are classified into three types: DATA, COMMAND, and SPECIAL. They are distinguished by {\tt ox message\_tag}. -{\tt message\_body} depends on the {\tt ox message\_tag}. The name of an ox message tag begins with {\tt OX\_}. -The following table shows the correspondence between -an OX message tag and a message body. - -\begin{center} -\begin{tabular}{|c||c|c|} \hline -ox message tag & message body & category \\ \hline -{\tt OX\_DATA} & CMOobject & DATA \\ \hline -{\tt OX\_COMMAND} & SMobject & COMMAND \\ \hline -{\tt OX\_DATA\_OPENMATH\_XML} & OpenMath data & DATA \\ \hline -\end{tabular} -\end{center} - +Typical OX message tags are {\tt OX\_COMMAND} followed by +SMobject and {\tt OX\_DATA} followed by CMOobject. Each message object also has its tag. For SMobject, the name of a tag begins with {\tt SM\_}. For CMOobject, the name of a tag begins with {\tt CMO\_}. @@ -207,7 +177,7 @@ a 32 bit (4 byte) integer with the network byte order. */ //&jp \subsection{OXexpression ¤Î ɸ½à encoding ¤È TCP/IP ¥½¥±¥Ã¥È¤Ë¤è¤ë¼ÂÁõË¡} -//*eg \subsection{Standard enconding of OXexpressions and an implementation by TCP/IP sockets} +//&eg \subsection{Standard enconding of OXexpressions and an implementation by TCP/IP sockets} /*&jp ÄÌ¿®¤Î¼Â¸½ÊýË¡¤ÏÄÌ¿®Ï©¤Î¤È¤ê¤«¤¿¤Ë¤è¤ê¤«¤ï¤ë¤¬, ÏÀÍý¹½Â¤¤ÏÅý°ìŪ¤Ë¤¢¤Ä¤«¤ï¤Ê¤¤¤È¤¤¤±¤Ê¤¤. @@ -236,30 +206,21 @@ OX ¥Ñ¥±¥Ã¥È¤ÎÈÖ¹æ¤òÌ᤹¤Î¤Ë¼ç¤ËÍøÍѤµ¤ì¤ë. /*&eg The logical structure of OX messages are independent of implementations -of communication. -ÄÌ¿®¤Î¼Â¸½ÊýË¡¤ÏÄÌ¿®Ï©¤Î¤È¤ê¤«¤¿¤Ë¤è¤ê¤«¤ï¤ë¤¬, -ÏÀÍý¹½Â¤¤ÏÅý°ìŪ¤Ë¤¢¤Ä¤«¤ï¤Ê¤¤¤È¤¤¤±¤Ê¤¤. -OXexpression ¤Ï¤½¤ÎÏÀÍý¹½Â¤¤òµ­½Ò¤·¤Æ¤¤¤ë. +of communication. The OXexpression represents the logical structure. +Here we explain an outline of the standard encoding scheme of OXexpression. +This encoding scheme is used to implement OpenXM protocols on TCP/IP sockets. +In addition, we also explain the control messages to control stack machines. -¤³¤³¤Ç¤Ï OXexpression ¤Îɸ½à encoding ¤Î³µÎ¬¤òÀâÌÀ¤¹¤ë. -¤³¤Î encoding Ë¡¤ÏTCP/IP ¥½¥±¥Ã¥ÈÍѤΠencoding Ë¡¤È¤·¤Æ -¸½ºß¸ºß¤·¤Æ¤¤¤ë¥µ¡¼¥Ð¤Ë»ÈÍѤµ¤ì¤Æ¤¤¤ë. -¤µ¤é¤ËOX ¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¤Î·×»»¾õÂÖ¤òÀ©¸æ¤¹¤ë¤¿¤á¤Î, ¥³¥ó¥È¥í¡¼¥ë¥á¥Ã¥»¡¼¥¸¤Ë -¤Ä¤¤¤Æ¤âÀâÌÀ¤¹¤ë. - - -{\tt destination}, {\tt origin} ¤ÎÉôʬ¤Ï, ¥½¥±¥Ã¥È¤Ë¤è¤ë -peer to peer ¤ÎÀܳ¤Ê¤Î¤Ç¾Êά¤¹¤ë. -{\tt extension} ¥Õ¥£¡¼¥ë¥É¤Ï -{\tt message\_tag} ¥Õ¥£¡¼¥ë¥É¤Î¼¡¤Ë¤¯¤ë. -{\tt extension} ¥Õ¥£¡¼¥ë¥É¤Ï OX ¥Ñ¥±¥Ã¥È¤Î¥·¥ê¥¢¥ëÈֹ椬¤Ï¤¤¤ë. -¥·¥ê¥¢¥ëÈÖ¹æ¤Ï {\tt int32} ¤Ç¤¢¤ë. -¤³¤ÎÈÖ¹æ¤Ï, ¥µ¡¼¥Ð¤¬¥¨¥é¡¼¤òµ¯¤³¤·¤¿¾ì¹ç, ¥¨¥é¡¼¤ò¤ª¤³¤·¤¿, -OX ¥Ñ¥±¥Ã¥È¤ÎÈÖ¹æ¤òÌ᤹¤Î¤Ë¼ç¤ËÍøÍѤµ¤ì¤ë. -°Ê²¼ {\tt extension} ¥Õ¥£¡¼¥ë¥É¤Ï, {\tt message\_tag} ¤Î -¤Ë´Þ¤Þ¤ì¤ë¤ÈÍý²ò¤· {\tt extension} ¥Õ¥£¡¼¥ë¥É¤Ï¾Êά¤¹¤ë. -¤·¤¿¤¬¤Ã¤Æ¥Ñ¥±¥Ã¥È¤Ï -¼¡¤Î¤è¤¦¤Ëµ­½Ò¤¹¤ë +As the socket connection is peer to peer, {\tt destination} and {\tt origin} +are omitted. +The {\tt extension} field is placed after the {\tt message\_tag} field. +The {\tt extension} field consists of the serial number for OX message, +which is {\tt int32}. +The serial number is used to identify an OX message which caused +an error on a server. +In the following we regard the {\tt extension} as a component of +the {\tt message\_tag} field and omit the {\tt extension} field. +Thus OX messages are represented as follows. */ /*&C \begin{center} @@ -271,6 +232,7 @@ OX ¥Ñ¥±¥Ã¥È¤ÎÈÖ¹æ¤òÌ᤹¤Î¤Ë¼ç¤ËÍøÍѤµ¤ì¤ë. \end{center} */ //&jp ¤¬, ¤â¤Ã¤È¤³¤Þ¤«¤¯¸«¤ë¤È, +//&eg More precisely it has the following representation. /*&C \begin{center} \begin{tabular}{|c|c|} @@ -286,6 +248,7 @@ OX ¥Ñ¥±¥Ã¥È¤ÎÈÖ¹æ¤òÌ᤹¤Î¤Ë¼ç¤ËÍøÍѤµ¤ì¤ë. ¥°¥ë¡¼¥× OX Message/TCPIP/Basic0 ¤Î {\tt ox message\_tag} ¤È¤·¤Æ¤Ï¼¡¤Î¤â¤Î¤¬ÍÑ°Õ¤µ¤ì¤Æ¤¤¤ë. */ +//&eg As {\tt ox message\_tag} the following are provided. /*&C @plugin/oxMessageTag.h @@ -321,8 +284,18 @@ OX ¥Ñ¥±¥Ã¥È¤ÎÈÖ¹æ¤òÌ᤹¤Î¤Ë¼ç¤ËÍøÍѤµ¤ì¤ë. ¼Â¸½¤·¤Æ¤¤¤ë. -\verb+ OX_COMMAND + ¥á¥Ã¥»¡¼¥¸¤Ï¼¡¤Î·Á¤Î¥Ñ¥±¥Ã¥È: \\ +\verb+ OX_COMMAND + ¥á¥Ã¥»¡¼¥¸¤Ï¼¡¤Î·Á¤Î¥Ñ¥±¥Ã¥È¤Çɽ¸½¤µ¤ì¤ë: \\ */ +/*&eg +Two streams are used for communication between a client and a server. +One is the stream to exchange data and to send stack machine commands. +The other is the stream to control stack machines. +Messages on the latter stream are called control messages and +results of control messages. The sample server implements +the above two streams by using two ports on TCP/IP. + +The stack machine command message has the following forms: \\ +*/ /*&C \begin{tabular}{|c|c|} \hline @@ -334,7 +307,8 @@ OX ¥Ñ¥±¥Ã¥È¤ÎÈÖ¹æ¤òÌ᤹¤Î¤Ë¼ç¤ËÍøÍѤµ¤ì¤ë. \\ */ -//&jp \verb+ OX_DATA + ¥á¥Ã¥»¡¼¥¸¤Ï¼¡¤Î·Á¤Î¥Ñ¥±¥Ã¥È: \\ +//&jp \verb+ OX_DATA + ¥á¥Ã¥»¡¼¥¸¤Ï¼¡¤Î·Á¤Î¥Ñ¥±¥Ã¥È¤Çɽ¸½¤µ¤ì¤ë: \\ +//&eg CMO data message has the following form:\\ /*&C \begin{tabular}{|c|c|} \hline @@ -344,11 +318,8 @@ OX ¥Ñ¥±¥Ã¥È¤ÎÈÖ¹æ¤òÌ᤹¤Î¤Ë¼ç¤ËÍøÍѤµ¤ì¤ë. ({\tt OX\_DATA}, {\sl CMObject} data) \\ */ -/*&jp -¥Ç¡¼¥¿¤Ï CMO ¤òÍѤ¤¤Æɽ¸½¤¹¤ë. - -¥³¥ó¥È¥í¡¼¥ë¥á¥Ã¥»¡¼¥¸¤Ï¼¡¤Î·Á¤Î¥Ñ¥±¥Ã¥È: \\ -*/ +//&jp ¥³¥ó¥È¥í¡¼¥ë¥á¥Ã¥»¡¼¥¸¤Ï¼¡¤Î·Á¤Î¥Ñ¥±¥Ã¥È¤Çɽ¸½¤µ¤ì¤ë: \\ +//&eg The control message has the following form:\\ /*&C \begin{tabular}{|c|c|} \hline @@ -360,9 +331,14 @@ OX ¥Ñ¥±¥Ã¥È¤ÎÈÖ¹æ¤òÌ᤹¤Î¤Ë¼ç¤ËÍøÍѤµ¤ì¤ë. /*&jp ¥³¥ó¥È¥í¡¼¥ë¥á¥Ã¥»¡¼¥¸¤Ï, ·×»»¤òÃæÃǤ·¤¿¤¤, debug ÍѤΠ¥¹¥ì¥Ã¥É¤òµ¯Æ°¤¹¤ë, debug ¥â¡¼¥É¤òÈ´¤±¤¿¤¤, ¤Ê¤É¤ÎÍÑÅÓ¤ËÍøÍѤ¹¤ë. - -¥³¥ó¥È¥í¡¼¥ë¥á¥Ã¥»¡¼¥¸¤Î·ë²Ì¥á¥Ã¥»¡¼¥¸¤Ï¼¡¤Î·Á¤Î¥Ñ¥±¥Ã¥È: \\ */ +/*&eg +The control message is used to interrupt a computation, to invoke +debugging threads, or to exit form the debugging mode. +*/ + +//&jp ¥³¥ó¥È¥í¡¼¥ë¥á¥Ã¥»¡¼¥¸¤Î·ë²Ì¥á¥Ã¥»¡¼¥¸¤Ï¼¡¤Î·Á¤Î¥Ñ¥±¥Ã¥È¤Çɽ¸½¤µ¤ì¤ë: \\ +//&eg The result of a cotrol message has the following form:\\ /*&C \begin{tabular}{|c|c|l|} \hline @@ -379,6 +355,11 @@ debug ¥â¡¼¥É¤òÈ´¤±¤¿¤¤, ¤Ê¤É¤ÎÍÑÅÓ¤ËÍøÍѤ¹¤ë. ¥°¥ë¡¼¥× SMobject/Basic0 ¤ª¤è¤Ó SMobject/Basic1 ¤Ë°¤¹¤ë ¥¿¥°¤È¤·¤Æ°Ê²¼¤Î¤â¤Î¤¬¤¢¤ë. */ +/*&eg +{\tt int32 function\_id} is the value of a stack machine command. +SM tags in SMobject/Basic0 and SMobject/Basic1 and corresponding +values are as follows. +*/ /*&C @plugin/oxFunctionId.h \begin{verbatim} @@ -407,13 +388,15 @@ debug ¥â¡¼¥É¤òÈ´¤±¤¿¤¤, ¤Ê¤É¤ÎÍÑÅÓ¤ËÍøÍѤ¹¤ë. */ //&jp ¤¿¤È¤¨¤Ð, +//&eg For example /*C \begin{center} (OX\_COMMAND, SM\_pops) \end{center} */ //&jp ¤Ï -/*C +//&eg is encoded as follows. +/*&C \begin{center} \begin{tabular}{|c|c|} \hline @@ -422,10 +405,14 @@ debug ¥â¡¼¥É¤òÈ´¤±¤¿¤¤, ¤Ê¤É¤ÎÍÑÅÓ¤ËÍøÍѤ¹¤ë. \end{tabular} \end{center} */ -/*&jp -¤È¥¨¥ó¥³¡¼¥É¤µ¤ì¤ë. +//&jp ¤È¥¨¥ó¥³¡¼¥É¤µ¤ì¤ë. +/*&jp operator ¤Î¾ÜºÙ¤Ï¼¡¤ÎÀá¤ÇÀâÌÀ¤¹¤ë. ¤³¤ì¤é¤ÎÄê¿ô¤Î̾Á°¤Ï¥¤¥ó¥×¥ê¥á¥ó¥È¤Î¤È¤­Ã»½Ì·Á¤Çɽ¸½¤·¤Æ¤â¤è¤¤. +*/ +/*&eg +The details of the operators are described in Section \ref{sec:stackmanine}. +Names of these constants may be represented by abbrebiated forms. */