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

Annotation of OpenXM/doc/issac2000/openxm-stackmachines.tex, Revision 1.9

1.9     ! takayama    1: % $OpenXM: OpenXM/doc/issac2000/openxm-stackmachines.tex,v 1.8 2000/01/15 03:46:27 noro Exp $
1.2       takayama    2:
1.9     ! takayama    3: \section{OpenXM Stack machines}\label{sec:ox-stackmachines}
1.2       takayama    4:
1.4       ohara       5: In OpenXM specification, all servers are stack machines.
1.8       noro        6: %These are called OpenXM stack machines.
1.3       takayama    7: When a server ox\_xyz gets an OX data message,
1.9     ! takayama    8: it translates the data into a local object of ox\_xyz
        !             9: and pushes the object onto the stack.
        !            10: According to the OpenMath specification,
1.8       noro       11: the translation scheme together with definitions of mathematical operations
                     12: of the system ox\_xyz is called the {\it PhraseBook} of ox\_xyz.
1.2       takayama   13:
1.3       takayama   14: Any OX command message starts with the int32 tag OX\_COMMAND.
1.8       noro       15: The body is an OpenXM stack machine operation code expressed by int32.
1.2       takayama   16: The codes are listed below.
                     17: \begin{verbatim}
                     18: #define SM_popSerializedLocalObject               258
                     19: #define SM_popCMO                                 262
                     20: #define SM_popString                              263
                     21: #define SM_mathcap                                264
                     22: #define SM_pops                                   265
                     23: #define SM_setName                                266
                     24: #define SM_evalName                               267
                     25: #define SM_executeStringByLocalParser             268
                     26: #define SM_executeFunction                        269
                     27: #define SM_beginBlock                             270
                     28: #define SM_endBlock                               271
                     29: #define SM_shutdown                               272
                     30: #define SM_setMathCap                             273
                     31: #define SM_executeStringByLocalParserInBatchMode  274
                     32: #define SM_getsp                                  275
                     33: #define SM_dupErrors                              276
                     34: #define SM_control_kill                          1024
                     35: #define SM_control_to_debug_mode                 1025
                     36: #define SM_control_exit_debug_mode               1026
                     37: #define SM_control_reset_connection              1030
                     38: \end{verbatim}
                     39:
                     40: OpenXM does not have a standard for mathematical operation sets
1.9     ! takayama   41: while it is a work in progress in the GAP group \cite{gap}.
1.8       noro       42: Each OpenXM server has its own set of mathematical operations,
                     43: which are performed as follows.
1.9     ! takayama   44: First, arguments for a mathematical operation
        !            45: and the number of the arguments are pushed.
        !            46: Second,
        !            47: the mathematical operator name,
        !            48: such as {\tt fctr} (asir factorization command),
        !            49: is pushed as a string.
        !            50: Finally, the stack machine command
        !            51: {\tt SM\_executeFunction} (269) evaluates the operator and
        !            52: pushes the result onto the stack
        !            53: after poping the operator name, the number of arguments
        !            54: and arguments.
1.2       takayama   55: For example, the following code factorizes $x^{100}-1$ by calling
1.9     ! takayama   56: {\tt ox\_asir} from asir.
1.2       takayama   57: \begin{verbatim}
                     58: P = ox_launch();
1.8       noro       59: ox_push_cmo(P,x^100-1); ox_push_cmo(P,ntoint32(1));
1.2       takayama   60: ox_push_cmd(P,269);
                     61: Ans = ox_pop_cmo(P);
                     62: \end{verbatim}
                     63:
                     64: When an error has occurred on an OpenXM server,
                     65: an error object is pushed to the stack instead of a result of the computation.
                     66: The error object consists of the serial number of the OX message
                     67: which caused the error, and an error message.
                     68: \begin{verbatim}
                     69: [341] ox_rpc(0,"fctr",1.2*x)$
                     70: [342] ox_pop_cmo(0);
                     71: error([8,fctr : invalid argument])
                     72: \end{verbatim}
                     73:
1.7       tam        74: OpenXM server won't send error messages to the client
1.9     ! takayama   75: except when it receives a {\tt SM\_pop*} command.
        !            76: OX stackmachines work in the asynchronous mode which is similar
1.2       takayama   77: to X servers.
1.9     ! takayama   78: For servers for graphic and sound applications, it is an advantageous feature.
1.2       takayama   79: It is also easy to emulate RPC and a web server for MCP \cite{iamc}
1.3       takayama   80: on our asynchronous OX stackmachines.
1.2       takayama   81:
                     82:
                     83:
                     84:
                     85:

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