Annotation of OpenXM/doc/calc2000/openxm-clients.tex, Revision 1.2
1.2 ! noro 1: % $OpenXM: OpenXM/doc/calc2000/openxm-clients.tex,v 1.1.1.1 2000/04/24 04:20:11 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
13: to execute these primitive operations:
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:
18: Some operations including the reset operation are implemented by
19: combining these primitives. Among them, frequently used ones are
1.2 ! noro 20: provided as built-in functions.
! 21: {\tt ox\_pop\_cmo()} receives the data on the stack of a server.
! 22: {\tt ox\_cmo\_rpc()} requests a server to execute a function.
! 23: {\tt ox\_reset()} completes
! 24: the operations stated in Section \ref{control}.
! 25: {\tt ox\_select()} is provided to detect if streams are ready for
! 26: reading to avoid blocking on read operations.
1.1 noro 27:
28: \subsection{Mathematica}
29:
30: We provide an OpenXM client {\tt math2ox} written as an external module
31: for Mathematica.
32: The module {\tt math2ox} communicates with Mathematica by MathLink and
33: with any OpenXM server by the OpenXM protocol.
34: By using the module {\tt math2ox},
35: we can call OpenXM servers from Mathematica;
36: here is a demonstration of a computation of the de Rham cohomology groups
37: of ${\bf C}^2 \setminus V(x^3-y^2)$ from Mathematica.
1.2 ! noro 38:
1.1 noro 39: {\footnotesize
40: \begin{verbatim}
41: In[1]:= Install["math2ox"]
42: In[2]:= OxStart["../lib/sm1/bin/ox_sm1_forAsir"]
43: In[3]:= OxExecute[" [(x^3-y^2) (x,y)] deRham "]
44: In[4]:= OxPopString[]
1.2 ! noro 45: Out[4]= [ 1 , 1 , 0 ] (* The dimension of cohomology groups *)
1.1 noro 46: \end{verbatim}
47: }
48:
1.2 ! noro 49: \noindent
1.1 noro 50: The {\tt math2ox} adds the following functions to Mathematica.
51: \begin{quote}
52: {\tt OxStart[s\_String]},
53: {\tt OxStartInsecure[s\_String]} \\
54: {\tt OxExecuteString[s\_String]},
55: {\tt OxParse[s\_String]},
56: {\tt OxGet[]},
57: {\tt OxPopCMO[]},
58: {\tt OxPopString[]},
59: {\tt OxClose[]},
60: {\tt OxReset[]}
61: \end{quote}
62: Although the list of functions speaks itself,
63: we add some explanations.
64: The function {\tt OxPopCMO[]} executes the same operation
65: as {\tt ox\_pop\_cmo()} in Risa/Asir;
66: it pops data from the server stack.
67: The {\tt OxGet[]} receives an OX data message
68: and returns its translation to an local object.
69: The function {\tt OxParse[]} helps debugging to connect Mathematica
70: and ox servers.
71: By using the function, one can send OX messages,
72: written by the OX expression, to a server.
73: OX expressions are Lisp-like expressions for OX messages and are defined
74: in~\cite{noro-takayama}.
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>