version 1.11, 2000/01/16 06:39:39 |
version 1.14, 2000/01/17 08:50:56 |
|
|
% $OpenXM: OpenXM/doc/issac2000/openxm-stackmachines.tex,v 1.10 2000/01/16 06:02:41 takayama Exp $ |
% $OpenXM: OpenXM/doc/issac2000/openxm-stackmachines.tex,v 1.13 2000/01/17 08:06:15 noro Exp $ |
|
|
\section{OpenXM Stack machines}\label{sec:ox-stackmachines} |
\section{OpenXM Stack machines}\label{sec:ox-stackmachines} |
|
|
Line 7 In OpenXM specification, all servers are stack machine |
|
Line 7 In OpenXM specification, all servers are stack machine |
|
When a server ox\_xyz gets an OX data message, |
When a server ox\_xyz gets an OX data message, |
it translates the data into a local object of ox\_xyz |
it translates the data into a local object of ox\_xyz |
and pushes the object onto the stack. |
and pushes the object onto the stack. |
According to the OpenMath specification, |
The translation scheme |
the translation scheme |
|
%% together with definitions of mathematical operations |
%% together with definitions of mathematical operations |
%% of the system ox\_xyz |
%% of the system ox\_xyz |
is called the {\it PhraseBook} of ox\_xyz. |
is called the {\it PhraseBook} of ox\_xyz (cf. OpenMath \cite{OpenMath}). |
For example, the Asir command {\tt ox\_push\_cmo(P,1)} |
For example, the Asir command {\tt ox\_push\_cmo(P,1)} |
(push integer $1$ onto the server $P$) |
(push integer $1$ onto the server $P$) |
sends an OX data message |
sends an OX data message |
|
|
{\tt OX\_DATA} stands for {\tt OX\_DATA} header and |
{\tt OX\_DATA} stands for {\tt OX\_DATA} header and |
{\tt (CMO\_ZZ,1)} is a body standing for $1$ expressed |
{\tt (CMO\_ZZ,1)} is a body standing for $1$ expressed |
by the CMO. |
by the CMO. |
The server tranlates {\tt (CMO\_ZZ, 1)} to its internal object of |
The server translates {\tt (CMO\_ZZ, 1)} to its internal object of |
the integer $1$ |
the integer $1$ |
and pushes the object onto the stack. |
and pushes the object onto the stack. |
|
|
Line 72 For example, the following code factorizes $x^{100}-1$ |
|
Line 71 For example, the following code factorizes $x^{100}-1$ |
|
\begin{verbatim} |
\begin{verbatim} |
P = ox_launch(); |
P = ox_launch(); |
ox_push_cmo(P,x^100-1); ox_push_cmo(P,ntoint32(1)); |
ox_push_cmo(P,x^100-1); ox_push_cmo(P,ntoint32(1)); |
ox_push_cmd(P,269); |
ox_push_cmo(P,"fctr"); ox_push_cmd(P,269); |
Ans = ox_pop_cmo(P); |
Ans = ox_pop_cmo(P); |
\end{verbatim} |
\end{verbatim} |
|
|
Line 90 error([8,fctr : invalid argument]) |
|
Line 89 error([8,fctr : invalid argument]) |
|
|
|
OpenXM server won't send error messages to the client |
OpenXM server won't send error messages to the client |
except when it receives a {\tt SM\_pop*} command. |
except when it receives a {\tt SM\_pop*} command. |
OX stackmachines work in the asynchronous mode which is similar |
OX stack machines work in the asynchronous mode which is similar |
to X servers. |
to X servers. |
For servers of graphic and sound applications, |
For servers of graphic and sound applications, |
it may be an advantageous feature. |
it may be an advantageous feature. |
It is also possible to emulate RPC and a web server for MCP \cite{iamc} |
It is also possible to emulate RPC and a web server for MCP \cite{iamc} |
on our asynchronous OX stackmachines. |
on our asynchronous OX stack machines. |
|
|
|
|
|
|