[BACK]Return to openxm-clients.tex CVS log [TXT][DIR] Up to [local] / OpenXM / doc / issac2000

Annotation of OpenXM/doc/issac2000/openxm-clients.tex, Revision 1.12

1.12    ! noro        1: % $OpenXM: OpenXM/doc/issac2000/openxm-clients.tex,v 1.11 2000/01/17 06:10:40 noro Exp $
1.2       takayama    2:
                      3: \section{OpenXM Clients}
1.3       noro        4:
                      5: \subsection{Risa/Asir}
                      6:
1.11      noro        7: Risa/Asir provides a launcher {\tt ox\_launch}
                      8: to invoke an OpenXM server and to set up the
                      9: communication between the server and itself.
1.6       noro       10: Fundamental operations on OpenXM servers are
1.12    ! noro       11: exchange of OX data and sending of stack machine commands.
1.11      noro       12: As a client, Asir provides the following functions
                     13: to execute these primitive operations:
1.12    ! noro       14: {\tt ox\_push\_cmo()} for pushing data,
        !            15: {\tt ox\_push\_cmd()} for sending a stack machine command
1.3       noro       16: and {\tt ox\_get()} for receiving data from a stream.
                     17:
1.10      noro       18: Some operations including the reset operation are implemented by
1.3       noro       19: combining these primitives.  Among them, frequently used ones are
1.10      noro       20: provided as built-in functions. We show some of them.
1.3       noro       21:
                     22: \begin{itemize}
                     23: \item {\tt ox\_pop\_cmo()}
                     24:
                     25: It requests a server to send data on the stack to the stream, then
                     26: it receives the data from the stream.
                     27:
                     28: \item {\tt ox\_cmo\_rpc()}
                     29:
                     30: After pushing the name of a function, arguments and the number of the
1.6       noro       31: arguments to the stack of a server, it requests the server to execute
1.3       noro       32: the function. It does not wait the termination of the function call.
                     33:
                     34: \item {\tt ox\_reset()}
                     35:
                     36: After sending {\tt SM\_control\_reset\_connection} to a control server,
                     37: it completes the operations stated in Section \ref{control}.
                     38: \end{itemize}
1.10      noro       39: Furthermore {\tt ox\_select()} is provided to detect if streams are ready for
                     40: reading. It is implemented by the {\tt select()} system call and is used
1.3       noro       41: to avoid blocking on read operations.
1.4       ohara      42:
                     43: \subsection{Mathematica}
                     44:
                     45: We provide an OpenXM client {\tt math2ox} written as an external module
1.7       takayama   46: for Mathematica.
                     47: The module {\tt math2ox} communicates with Mathematica by MathLink and
                     48: with any OpenXM server by the OpenXM protocol.
1.5       takayama   49: By using the module {\tt math2ox},
                     50: we can call OpenXM servers from Mathematica;
1.8       takayama   51: here is a demonstration of a computation of the de Rham cohomology groups
1.7       takayama   52: of ${\bf C}^2 \setminus V(x^3-y^2)$ from Mathematica.
1.5       takayama   53: {\footnotesize
                     54: \begin{verbatim}
                     55: In[1]:= Install["math2ox"]
                     56: In[2]:= OxStart["../lib/sm1/bin/ox_sm1_forAsir"]
                     57: In[3]:= OxExecute[" [(x^3-y^2) (x,y)] deRham "]
                     58: In[4]:= OxPopString[]
1.7       takayama   59: Out[4]=  [ 1 , 1 , 0 ]  (* The dimension of
                     60:                            cohomology groups *)
1.5       takayama   61: \end{verbatim}
                     62: }
1.4       ohara      63:
1.7       takayama   64: The {\tt math2ox} adds the following functions to Mathematica.
1.4       ohara      65: \begin{quote}
                     66: {\tt OxStart[s\_String]} \\
                     67: {\tt OxStartInsecure[s\_String]} \\
                     68: {\tt OxExecuteString[s\_String]}  \\
                     69: {\tt OxParse[s\_String]} \\
                     70: {\tt OxGet[]} \\
                     71: {\tt OxPopCMO[]} \\
                     72: {\tt OxPopString[]} \\
                     73: {\tt OxClose[]} \\
                     74: {\tt OxReset[]}
                     75: \end{quote}
1.7       takayama   76: Although the list of functions speaks itself,
                     77: we add some explanations.
                     78: The function {\tt OxPopCMO[]} executes the same operation
                     79: as {\tt ox\_pop\_cmo()} in Risa/Asir;
                     80: it pops data from the server stack.
1.5       takayama   81: The {\tt OxGet[]} receives an OX data message
                     82: and returns its translation to an local object.
1.9       takayama   83: The function {\tt OxParse[]} helps debugging to connect Mathematica
                     84: and ox servers.
                     85: By using the function, one can send OX messages,
1.7       takayama   86: written by the OX expression, to a server.
                     87: OX expressions are Lisp-like expressions for OX messages and are defined
                     88: in~\cite{noro-takayama}.

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