Annotation of OpenXM/doc/issac2000/openxm-stackmachines.tex, Revision 1.2
1.2 ! takayama 1: % $OpenXM: OpenXM/doc/issac2000/openxm-stackmachines.tex,v 1.1 1999/12/23 10:25:09 takayama Exp $
! 2:
! 3: \section{OpenXM Stackmachines} (Tamura)
! 4:
! 5: In OpenXM specification, all servers are stackmachines.
! 6: These are called OpenXM stachmachines.
! 7: When a server ox\_xyz gets a OX data message,
! 8: it translates the data into its own object and push the object
! 9: on the stack.
! 10: The translation scheme together with mathematical operation definitions
! 11: of the system ox\_xyz is called the {\it phrase dictionary} of
! 12: ox\_xyz following the idea of OpenMath.
! 13:
! 14: OX command message starts with the int32 tag OX\_COMMAND.
! 15: The body is OpenXM stackmachine operation code expressed by int32.
! 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_DUMMY_sendcmo 280
! 35: #define SM_sync_ball 281
! 36: #define SM_control_kill 1024
! 37: #define SM_control_to_debug_mode 1025
! 38: #define SM_control_exit_debug_mode 1026
! 39: #define SM_control_reset_connection 1030
! 40: \end{verbatim}
! 41:
! 42: OpenXM does not have a standard for mathematical operation sets
! 43: while it is one of the main future projects of \cite{gap}.
! 44: Each OpenXM server has its own mathematical operation set.
! 45: Mathematical operator name, such as fctr (asir factorization command),
! 46: is pushed as a string,
! 47: SM\_executeFunction pops the operator name, the number of arguments
! 48: and arguments,
! 49: evaluates the operator, and pushes the result on the stack.
! 50: For example, the following code factorizes $x^{100}-1$ by calling
! 51: ox\_asir.
! 52: \begin{verbatim}
! 53: P = ox_launch();
! 54: ox_push_cmo(P,x^100-1); ox_push_cmo(P,ox_int32(1));
! 55: ox_push_cmd(P,269);
! 56: Ans = ox_pop_cmo(P);
! 57: \end{verbatim}
! 58:
! 59: When an error has occurred on an OpenXM server,
! 60: an error object is pushed to the stack instead of a result of the computation.
! 61: The error object consists of the serial number of the OX message
! 62: which caused the error, and an error message.
! 63: \begin{verbatim}
! 64: [341] ox_rpc(0,"fctr",1.2*x)$
! 65: [342] ox_pop_cmo(0);
! 66: error([8,fctr : invalid argument])
! 67: \end{verbatim}
! 68:
! 69: Errors are not sent to the client except a SM\_pop* command is received.
! 70: Open XM stackmachines works in the asynchoronous mode which is similar
! 71: to X servers.
! 72: For servers of graphic applications, it is an advantageous feature.
! 73: It is also easy to emulate RPC and a web server for MCP \cite{iamc}
! 74: on our OpenXM stackmachines.
! 75:
! 76:
! 77:
! 78:
! 79:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>