Annotation of OpenXM/doc/Papers/ohp-metro.tex, Revision 1.1
1.1 ! takayama 1: % $OpenXM$
! 2:
! 3: \documentclass{slides}
! 4: \usepackage{epsfig}
! 5:
! 6: \begin{document}
! 7: http://www.openxm.org \\
! 8: takayama@openxm.org, takayama@math.kobe-u.ac.jp \\
! 9:
! 10: Open message eXchange protocol for Mathematics.
! 11:
! 12: \fbox{Aim of the project}
! 13: \begin{enumerate}
! 14: \item An experiment to connect mathematical software each other
! 15: \begin{enumerate}
! 16: \item Efficient and easy distributed computation
! 17: \item Use other system as a subroutine or a remote object
! 18: \item New generation of mathematical software
! 19: (old regime = maple, mathematica, ...)
! 20: \end{enumerate}
! 21: \item Provide a package of high level of mathematics and
! 22: documentation on the OpenXM protocol infrastructure.
! 23: \item Attractive to mathematicians.
! 24: \item Presentation on web.
! 25: \end{enumerate}
! 26:
! 27: \fbox{Release schedule}
! 28:
! 29: \fbox{Other projects}
! 30:
! 31: \newpage
! 32:
! 33: \fbox{Design outline}
! 34: \begin{enumerate}
! 35: \item Communication is an exchange of messages. The messages are classified into
! 36: three types:
! 37: DATA, COMMAND, and SPECIAL.
! 38: They are called OX (OpenXM) messages.
! 39: Among the three types,
! 40: {\it OX data messages} wrap mathematical data.
! 41: We use standards of mathematical data formats such as OpenMath and MP
! 42: as well as our own data format {\it CMO}
! 43: ({\it Common Mathematical Object format}).
! 44: \item Servers, which provide services to other processes, are stack machines.
! 45: The stack machine is called the
! 46: {\it OX stack machine}.
! 47: Existing mathematical software are wrapped with this stack machine.
! 48: Minimal requirements for a target wrapped with the OX stack machine
! 49: are as follows:
! 50: \begin{enumerate}
! 51: \item The target must have a serialized interface such as a character based
! 52: interface.
! 53: \item An output of the target must be understandable for computer programs;
! 54: it should follow a grammar that can be parsed with other software tools.
! 55: \end{enumerate}
! 56: \item Any server may have a hybrid interface;
! 57: it may accept and execute not only stack machine commands,
! 58: but also its original command sequences.
! 59: For example,
! 60: if we send the following string to the {\tt ox\_asir} server \\
! 61: \verb+ " fctr(x^100-y^100); " + \\
! 62: and call the stack machine command \\
! 63: \verb+ SM_executeStringByLocalParser + \\
! 64: then the server executes the asir command \\
! 65: \verb+ fctr(x^100-y^100); +
! 66: (factorize $x^{100}-y^{100}$ over ${\bf Q}$)
! 67: and pushes the result onto the stack.
! 68: \item Network transparent supports for controlling servers are provided.
! 69: For example OpenXM defines a robust reset procedure to restart computations
! 70: without any confusion in I/O buffers.
! 71: It is very useful for debugging programs running on distributed environment.
! 72: \end{enumerate}
! 73:
! 74: \newpage
! 75:
! 76: \fbox{Components of version 1.1.2}
! 77: \begin{description}
! 78: \item{\tt ox\_asir}
! 79: A server for Risa/Asir, a general-purpose computer algebra
! 80: system. It provides almost
! 81: all functionalities of Risa/Asir such as polynomial factorization over algebraic numbers,
! 82: Gr\"obner basis computation, primary ideal decomposition,
! 83: and efficient computation over finite fields.
! 84: (Noro, Yokoyama, Shimoyama, Takeshima)
! 85: \item{\tt ox\_pari} {\footnotesize ftp://megrez.math.u-bordeaux.fr/pub/pari}\\
! 86: pari is contained in {\tt ox\_asir}.
! 87: (C. Batut, K. Belabas, D. Bernardi, H. Cohen and M. Olivier)
! 88: \item{\tt ox\_sm1}
! 89: A server for Kan/sm1, a system for computation in
! 90: the ring of differential operators including computation of Gr\"obner bases
! 91: and cohomology groups.
! 92: (Oaku, Takayama)
! 93: \item {\tt ox\_phc} {\footnotesize http://www.math.msu.edu/~jan/download.html} \\
! 94: A server for PHC pack, a general-purpose solver for
! 95: polynomial systems by homotopy continuation.
! 96: (Verschelde)
! 97: \item {\tt ox\_tigers} {\footnotesize http://www.math.tamu.edu/~rekha/programs.html } \\
! 98: A server for TiGERS, a system to enumerate
! 99: all Gr\"obner bases of affine toric ideals.
! 100: It can be used to determine the state polytope
! 101: of a given affine toric ideal.
! 102: (Hubert, Rekha)
! 103: \item {\tt ox\_gnuplot} {\footnotesize ftp://ftp.gnuplot.vt.edu/pub/gnuplot/}\\
! 104: \item {\tt ox\_math}
! 105: A server for Mathematica.
! 106: (Ohara)
! 107: \item {\tt OMproxy} {\footnotesize cf. http://www.openmath.org} \\
! 108: A server for translation between CMO and OpenMath/XML expressions.
! 109: It is written in Java.
! 110: This module provides Java classes OXmessage, CMO, and SM
! 111: for the OpenXM protocol, too.
! 112: (Tamura)
! 113: \end{description}
! 114: In addition to these servers, Risa/Asir, Kan/sm1 and Mathematica
! 115: can act as clients.
! 116: \newpage
! 117: \fbox{OX}
! 118: {\footnotesize
! 119: \begin{verbatim}
! 120: #define OX_COMMAND 513 // COMMAND
! 121: #define OX_DATA 514 // DATA
! 122: #define OX_SYNC_BALL 515 // SPECIAL
! 123: #define OX_DATA_WITH_LENGTH 521 // DATA
! 124: #define OX_DATA_OPENMATH_XML 523 // DATA
! 125: #define OX_DATA_OPENMATH_BINARY 524 // DATA
! 126: #define OX_DATA_MP 525 // DATA
! 127: \end{verbatim} }
! 128: \newpage
! 129:
! 130: \fbox{CMO}
! 131: {\footnotesize
! 132: \begin{verbatim}
! 133: #define CMO_ERROR2 0x7f000002
! 134: #define CMO_NULL 1
! 135: #define CMO_INT32 2
! 136: #define CMO_DATUM 3
! 137: #define CMO_STRING 4
! 138: #define CMO_MATHCAP 5
! 139: #define CMO_LIST 17
! 140:
! 141: #define CMO_MONOMIAL32 19
! 142: #define CMO_ZZ 20
! 143: #define CMO_QQ 21
! 144: #define CMO_ZERO 22
! 145: #define CMO_DMS_GENERIC 24
! 146: #define CMO_DMS_OF_N_VARIABLES 25
! 147: #define CMO_RING_BY_NAME 26
! 148: #define CMO_RECURSIVE_POLYNOMIAL 27
! 149: #define CMO_LIST_R 28
! 150: #define CMO_INT32COEFF 30
! 151: #define CMO_DISTRIBUTED_POLYNOMIAL 31
! 152: #define CMO_POLYNOMIAL_IN_ONE_VARIABLE 33
! 153: #define CMO_RATIONAL 34
! 154: #define CMO_64BIT_MACHINE_DOUBLE 40
! 155: #define CMO_ARRAY_OF_64BIT_MACHINE_DOUBLE 41
! 156: #define CMO_BIGFLOAT 50
! 157: #define CMO_IEEE_DOUBLE_FLOAT 51
! 158: #define CMO_INDETERMINATE 60
! 159: #define CMO_TREE 61
! 160: #define CMO_LAMBDA 62
! 161: \end{verbatim} }
! 162:
! 163: \fbox{SM COMMAND}
! 164: {\footnotesize
! 165: \begin{verbatim}
! 166: #define SM_popSerializedLocalObject 258
! 167: #define SM_popCMO 262
! 168: #define SM_popString 263
! 169: #define SM_mathcap 264
! 170: #define SM_pops 265
! 171: #define SM_setName 266
! 172: #define SM_evalName 267
! 173: #define SM_executeStringByLocalParser 268
! 174: #define SM_executeFunction 269
! 175: #define SM_beginBlock 270
! 176: #define SM_endBlock 271
! 177: #define SM_shutdown 272
! 178: #define SM_setMathCap 273
! 179: #define SM_executeStringByLocalParserInBatchMode 274
! 180: #define SM_getsp 275
! 181: #define SM_dupErrors 276
! 182: #define SM_control_kill 1024
! 183: #define SM_control_to_debug_mode 1025
! 184: #define SM_control_exit_debug_mode 1026
! 185: #define SM_control_reset_connection 1030
! 186: \end{verbatim} }
! 187: \newpage
! 188:
! 189: \fbox{Programming in asir client}
! 190:
! 191:
! 192: \begin{verbatim}
! 193: #define SM_executeFunction 269
! 194: def ex1() {
! 195: P = ox_launch();
! 196: ox_push_cmo(P,13);
! 197: ox_push_cmo(P,8);
! 198: ox_push_cmo(P,ntoint32(2));
! 199: ox_push_cmo(P,"igcd");
! 200: ox_push_cmd(P,SM_executeFunction);
! 201: return(ox_pop_cmo(P));
! 202: }
! 203: \end{verbatim}
! 204: {\footnotesize
! 205: \begin{verbatim}
! 206: igcd(I1,I2)
! 207: :: The integer greatest common divisor of I1 and I2.
! 208: \end{verbatim}
! 209: }
! 210:
! 211: \begin{verbatim}
! 212: ox_rpc(P,"igcd",13,8);
! 213: ox_pop_cmo(P);
! 214: \end{verbatim}
! 215:
! 216: A simple interface to servers by using strings:
! 217: \begin{verbatim}
! 218: ox_execute_string(P,"igcd(13,8);");
! 219: \end{verbatim}
! 220: \newpage
! 221:
! 222: Error packet of ox\_asir server:
! 223: \begin{verbatim}
! 224: [340] ox_launch();
! 225: 0
! 226: [341] ox_rpc(0,"hoge",0);
! 227: 0
! 228: [342] ox_pop_cmo(0);
! 229: error([8,executeFunction : the function hoge not found])
! 230: \end{verbatim}
! 231:
! 232: Error packet of ox\_sm1 server:
! 233: \begin{verbatim}
! 234: [340] ox_launch(0,getenv("OpenXM_HOME")+"/bin/ox_sm1");
! 235: 0
! 236: [341] ox_cmo_rpc(0,"hoge",0);
! 237: 0
! 238: [342] ox_pop_cmo(0);
! 239: error([7,4294967295,executeString:
! 240: Warning: identifier is not in the dictionaries])
! 241: \end{verbatim}
! 242:
! 243: \newpage
! 244: Generate a table of dilog by calling pari (server).
! 245: \begin{verbatim}
! 246: def ex2() {
! 247: P = ox_launch();
! 248: Ans = [ ];
! 249: for (I=0; I<1.0; I=I+0.1) {
! 250: /* ox_execute_string(P,"pari(dilog,0.3);"); */
! 251: ox_execute_string(P,"pari(dilog,"+rtostr(I)+");");
! 252: Ans = append(Ans,[ox_pop_local(P)]);
! 253: }
! 254: return(Ans);
! 255: }
! 256: \end{verbatim}
! 257: \begin{verbatim}
! 258: [345] ex2();
! 259: [0, 0.102617791099391136905, 0.21100377543970478482,
! 260: 0.32612951007547605591,0.44928297447128169231,0.58224052646501250462,0.72758630771633335369,0.88937762428603865937,1.074794600008248448403,1.29971472300495878170,1.64493406684822643609]
! 261: [346]
! 262: \end{verbatim}
! 263: \newpage
! 264:
! 265: Computing the dimensions of de Rham cohomology groups
! 266: of ${\bf C}^n \setminus V(f)$ by calling kan/sm1.
! 267: {\footnotesize
! 268: Oaku, Takayama, An algorithm for de Rham cohomology groups of the
! 269: complement of an affine variety via D-module computation,
! 270: Journal of pure and applied algebra 139 (1999), 201-233.}
! 271: \begin{verbatim}
! 272: [344] P = sm1_start();
! 273: [345] sm1_deRham([x^3-y^2*z^2,[x,y,z]]|proc=P);
! 274: [1,1,0,0]
! 275: [346]
! 276: \end{verbatim}
! 277: {\footnotesize
! 278: \begin{verbatim}
! 279: def sm1_deRham(A) {
! 280: SM1_FIND_PROC(P);
! 281: P = sm1_check_server(P);
! 282: sm1_push_int0(P,A);
! 283: sm1(P," deRham ");
! 284: B = sm1_pop(P);
! 285: ox_check_errors2(P);
! 286: return(B);
! 287: }
! 288: \end{verbatim}
! 289: }
! 290:
! 291: \begin{enumerate}
! 292: \item Free resolution in $D$ (ox\_sm1).
! 293: \item Annihilating ideal of $f^{-1}$ (ox\_sm1).
! 294: \item Factorization (ox\_asir).
! 295: \end{enumerate}
! 296:
! 297: \newpage
! 298:
! 299: \fbox{ Distributed computation by a job pool}
! 300: {\footnotesize \begin{verbatim}
! 301: #define SM_popCMO 262
! 302: def pool() {
! 303: P = [ox_launch(), ox_launch(), ox_launch()];
! 304: map(ox_push_cmo,P,0);
! 305: map(ox_push_cmd,P,SM_popCMO);
! 306: /* map(ox_get,P); mistake */
! 307:
! 308: I = 50;
! 309: Jobs = [x^(I)-y^(I), x^(I+1)-y^(I+1),
! 310: x^(I+2)-y^(I+2), x^(I+3)-y^(I+3),
! 311: x^(I+4)-y^(I+4), x^(I+5)-y^(I+5)];
! 312: N = length(Jobs);
! 313: Ans = [ ];
! 314: print("------ started -----");
! 315: /* while (length(Jobs) != 0) { mistake */
! 316: while (length(Ans) != N) {
! 317: Q = ox_select(P)[0];
! 318: F = ox_get(Q);
! 319: /* print([Q,F]); */
! 320: if (F != 0) {
! 321: Ans = append(Ans,[F]);
! 322: print(Q);
! 323: }
! 324: if (length(Jobs) > 0) {
! 325: Job = car(Jobs); Jobs=cdr(Jobs);
! 326: ox_rpc(Q,"fctr",Job); ox_push_cmd(Q,SM_popCMO);
! 327: }
! 328: }
! 329: return(Ans);
! 330: }
! 331:
! 332:
! 333: [345] pool();
! 334: ------ started -----
! 335: 1 2 1 0 1 2
! 336:
! 337: [[[-1,1],[y^16+x*y^15+x^2*y^14+x^3*y^13 ---- snip ----
! 338:
! 339: \end{verbatim}}
! 340: \newpage
! 341:
! 342: \fbox{Finding series solution} \\
! 343: \fbox{of holonomic system to the direction $w$}
! 344:
! 345: {\footnotesize
! 346: \begin{verbatim}
! 347: def dsolv_initial(F1,V1,W1) {
! 348: extern Dsolv_message_initial;
! 349: S=[F1,V1,W1];
! 350: F=S[0];
! 351: V=S[1];
! 352: DV=map(sm1_d,V);
! 353: W=S[2];
! 354: N = length(V);
! 355: G = sm1_gb([F,V,dsolv_consw(V,W)]);
! 356: In = G[1];
! 357: In = map(subst,In,h,1);
! 358: In = sm1_gb([In,V])[0]; /* Computing the reduced basis. */
! 359: Ans = [ ];
! 360: for (I=0; I<length(In); I++) {
! 361: D = sm1_distraction([In[I],V,V,DV,V]);
! 362: Ans = append(Ans,[D]);
! 363: }
! 364: return(Ans);
! 365: }
! 366: \end{verbatim}
! 367:
! 368: --- SNIP ---
! 369:
! 370: }
! 371:
! 372: \begin{enumerate}
! 373: \item Clean code
! 374: \item Two days for our implementation.
! 375: \end{enumerate}
! 376: \begin{enumerate}
! 377: \item Argument check.
! 378: \item Debug window for servers.
! 379: \item We have to write $n$-help messages.
! 380: \end{enumerate}
! 381:
! 382: \newpage
! 383: \fbox{ Product of univariate polynomials (Shoup)}
! 384:
! 385: \begin{tabbing}
! 386: Input :\= $f_1, f_2 \in {\bf Z}[x]$ such that $deg(f_1), deg(f_2) < 2^M$\\
! 387: Output : $f = f_1f_2$ \\
! 388: $P \leftarrow$ \= $\{m_1,\cdots,m_N\}$ where $m_i$ is an odd prime, \\
! 389: \> $2^{M+1}|m_i-1$ and $m=\prod m_i $ is sufficiently large. \\
! 390: Separate $P$ into disjoint subsets $P_1, \cdots, P_L$.\\
! 391: for \= $j=1$ to $L$ $M_j \leftarrow \prod_{m_i\in P_j} m_i$\\
! 392: Compute $F_j$ such that $F_j \equiv f_1f_2 \bmod M_j$\\
! 393: \> and $F_j \equiv 0 \bmod m/M_j$ in parallel.\\
! 394: \> (The product is computed by FFT.)\\
! 395: return $\phi_m(\sum F_j)$\\
! 396: (For $a \in {\bf Z}$, $\phi_m(a) \in (-m/2,m/2)$ \\
! 397: and $\phi_m(a)\equiv a \bmod m$)
! 398: \end{tabbing}
! 399:
! 400:
! 401: \epsfxsize=17cm
! 402: \begin{center}
! 403: \epsffile{../calc2000/speedup.ps}
! 404: \end{center}
! 405:
! 406: \newpage
! 407:
! 408: \fbox{Solving algebraic equations}
! 409:
! 410: \begin{verbatim}
! 411: [287] phc(katsura(7));
! 412: The detailed output is in the file tmp.output.*
! 413: The answer is in the variable Phc.
! 414: 0
! 415: [290] B=map(first,Phc)$
! 416: [291] gnuplot_plotDots([],0)$
! 417: [292] gnuplot_plotDots(B,0)$
! 418: \end{verbatim}
! 419:
! 420: \epsfxsize=17cm
! 421: \begin{center}
! 422: \epsffile{../calc2000/katsura7.ps}
! 423: \end{center}
! 424: The first components of the solutions to the system of algebraic equations Katsura 7.
! 425: \newpage
! 426:
! 427: \end{document}
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>