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