Mathematica Client for Open XM

Katsuyoshi Ohara

January 20, 2000

1 Mathematica Client

We provide an OX client named math2ox by an external module for Mathematica. That is, we can call an OX server on Mathematica. The math2ox has communication with the OX server by OpenXM protocols and communication with Mathematica by MathLink. The math2ox interpret our commands and translate them to OX messages.

The math2ox has the following commands:

OxStart[s String], OxStartInsecure[s String, p Integer, q Integer],
OxStartRemoteSSH[s String, t String], OxExecuteString[s String], OxParse[s String],
OxGet[], OxPopCMO[], OxPopString[], OxClose[], OxReset[].

First, let us load the math2ox.

In[1]:= Install["math2ox"]

Second, let us open a connection with an OX server. For example, if we want to call the ox sm1 (the kan/sm1 server), then

In[2] := OxStart["ox_sm1"]

where we have the connection of reverse mode. The OxStart function automatically invoke ox sm1 on the local machine. If you need to connect an OX server on a remote machine, then you can use reverse mode.

In[2] := OxStartInsecure["water.s.kanazawa-u.ac.jp", 1300, 1400]

The mode is not secured but you can crypt data stream by using ssh (Secure SHell).

In[3] := Run["ssh -f water ox -insecure -ox ox_sm1 -host water"]

Third, let us send an OX message to the OX server. We can send an OX message written in OX/CMO expressions.

In[4] := OxParse["(CMO_LIST, (CMO_STRING, "hello world"), (CMO_ZERO))"]
In[5] := OxParse["(OX_COMMAND, (SM_popCMO))"]

If the expression is illegal, then nothing is sent.

Remarks: if SM popCMO is sent by the OxParse[] function, then the OX stack machine returns the top of the stack to the math2ox. Then, in order to receive the message, we need to call the OxGet[] function.

In[6] := OxGet[]

If we do not use the OxParse function and use the OxPopCMO[] function, then we do not need to call the OxGet[].

In[5] := OxPopCMO[]

Fourth, if we send a command expressed in the local language of the OX server, then we need to call the OxExecuteString[] function.

Last, let us close the connection.

In[7] := OxClose[]

2 Examples

1. OpenXM/lib/math/primadec.m is a Mathematica program to make primary ideal decompositions by calling ox asir. As to usages, see comments in this file.

2. OpenXM/lib/math/beta.m is a Mathematica program to get beta-nbc bases by calling ox asir.

References

[1] M. Noro, N. Takayama: Design and Implementation of OpenXM, 1996, 1997, 1998, 1999, 2000.

 [2] http://www.math.kobe-u.ac.jp/OpenXM/

[3] M. Noro, K. Ohara, N. Takayama: Introduction to Open Asir, 1999, Suusiki Shori, Vol 7, No 2, 2–17. (ISBN4-87243-086-7, SEG Publishing, Tokyo). (in Japanese)

[4] Stephen Wolfram: The Mathematica Book, Third edition, Wolfram Media/Cambridge University Press, 1996.

[5] T. Miyachi: Mathematica Network Programming, Iwanami Book Co., 1998. (in Japanese)