%% $OpenXM: OpenXM/doc/ascm2001p/ohp-ja.tex,v 1.1 2001/10/03 07:31:36 takayama Exp $
\documentclass{slides}
%%\documentclass[12pt]{article}
\usepackage{color}
\usepackage{epsfig}
\newcommand{\htmladdnormallink}[2]{#1}
\begin{document}
\noindent
{\color{green} OpenXM-RFC 100 and 101 $B$N@_7W$H<BAu(B}

\noindent
M.Maekawa ($BA0(B $B@n(B $B!!(B $B>-(B $B=((B), \\ M.Noro ($BLn(B $BO$(B $B!!(B $B@5(B $B9T(B), \\
K.Ohara ($B>.(B $B86(B $B!!(B $B8y(B $BG$(B), \\ N.Takayama ($B9b(B $B;3(B $B!!(B $B?.(B $B5#(B), \\
Y.Tamura ($BED(B $BB<(B $B!!(B $B63(B $B;N(B)\\
\htmladdnormallink{{\color{red}http://www.openxm.org}}{{\color{red}http://www.openxm.org}}


\newpage
\noindent
{\color{red} 1. Architecture} \\
($B8=:_$"$k(B)$B?t3X%=%U%H%&%(%"%7%9%F%`$NE}9g2=(B.

$B$3$N%W%m%8%'%/%H$NFs$D$N<g$?$k1~MQ(B \\
\begin{enumerate}
\item $BBPOCE*$KMxMQ2DG=$JJ,;6JBNs7W;;4D6-$N9=C[(B
{\color{blue} Risa/Asir}
(computer algebra system for general purpose, 
 open source (c) Fujitsu, \\
 http://www.openxm.org, \\
 http://risa.cs.ehime-u.ac.jp, \\
 http://www.math.kobe-u.ac.jp/Asir/asir.html)
\item e-Bateman $B7W2h(B
(21 $B@$5*$NEE;RG^BN$K$h$kD61[4X?tO@=8(B)\\
$BBh0lCJ3,(B: $BD64v2?4X?t$N8x<0$N@8@.$H8!>Z(B.
\end{enumerate}
\newpage

\noindent
OpenXM-RFC 100 \\
{\color{green} Control}: \\
\begin{enumerate}
\item $B%/%i%$%"%s%H%5!<%P%b%G%k(B.  $BLZ9=B$$N%W%m%;%9(B.
\item $B8=:_$"$k?t3X%=%U%H%&%(%"$r(B OpenXM {\color{red} $B%9%?%C%/%^%7%s(B}
$B$GJq$`(B.
\item execute\_string
\begin{verbatim}
  Pid = ox_launch(0,"ox_asir");
  ox_execute_string(Pid," poly_factor(x^10-1);");
\end{verbatim}
\end{enumerate}
\newpage

\noindent
{\color{green} Data}: \\
\begin{tabular}{|c|c|}
\hline
{\color{red} TAG}& {\color{blue} BODY} \\ 
\hline
\end{tabular} \\
$BFs$D$NAX(B: {\color{green} OX message} $BAX(B.
$B%3%^%s%I(B, CMO, $B$=$NB>$N7A<0$K$h$k%G!<%?$NAX(B.

\noindent
{\color{blue} $BNc(B 1}: \\
\begin{verbatim}
P = ox_launch(0,"ox_sm1");
ox_push_cmo(P,1);
ox_push_cmo(P,1);
ox_execute_string(P,"add");
ox_pop_cmo(P);
\end{verbatim}

{\color{green} CMO} $B$O(B OpenMath $B$H$*$J$8$h$&$K(B XML $B$rMQ$$$?(B
$B?t3X%G!<%?$N%(%s%3!<%G%#%s%0K!(B.

\begin{tabular}{|c|c|c|}
\hline
{\tt OX\_DATA} & {\it CMO\_ZZ} & 1 \\ 
\hline
\end{tabular} \\
\begin{tabular}{|c|c|c|}
\hline
{\tt OX\_DATA} & {\it CMO\_ZZ} & 1 \\ 
\hline
\end{tabular} \\
\begin{tabular}{|c|c|c|}
\hline
{\tt OX\_DATA} & {\it CMO\_STRING} & add \\ 
\hline
\end{tabular} \\
\begin{tabular}{|c|c|}
\hline
{\tt OX\_COMMAND} & {\it SM\_executeString} \\ 
\hline
\end{tabular} \\
\begin{tabular}{|c|c|}
\hline
{\tt OX\_COMMAND} & {\it SM\_popCMO} \\ 
\hline
\end{tabular} \\
\htmladdnormallink{http://www.openxm.org}{http://www.openxm.org}
\newpage

\noindent
{\color{red} 2. $B%(%i!<$N07$$$H7W;;$NCfCG(B} \\
\begin{verbatim}
P = ox_launch(0,"ox_asir");
ox_rpc(P,"fctr",1.2*x^2-1.21);
ox_dup_errors(P);
ox_pop_cmo(P);
\end{verbatim}
{\color{green}
\verb# [error([8,fctr: invalid argument])] #
}\\
{\color{blue}
$B%5!<%P$OJ9$+$l$J$$$+$.$j2?$b8@$o$J$$(B.
}
\newpage

\begin{verbatim}
P=ox_launch(0,"ox_asir");
ox_rpc(P,"fctr",x^1000-y^1000);
ox_reset(P);
\end{verbatim}

\setlength{\unitlength}{1cm}
\begin{picture}(20,7)(0,0)
\thicklines
\put(5,1.7){\line(1,0){7}}
\put(5,4.7){\line(3,-1){7}}
\put(12,1){\framebox(5,2.5){client}}
\put(1,4){\framebox(4,1.5){\color{blue} controller}}
\put(1,1){\framebox(4,1.5){\color{red} engine}}
\thinlines
\put(0,0.3){\framebox(6,6){}}
\put(1.5,-0.7){server}
\end{picture}
\newpage

\noindent
{\color{red} 4. e-Bateman $B7W2h(B} ($BEE;RE*$J?t3X8x<0=8(B)\\
$BBh0lCJ3,(B: \\
$B%,%&%9$ND64v2?5i?t(B
$$ {\color{blue} F(a,b,c;x)} = \sum_{n=1}^\infty
  \frac{(a)_n (b)_n}{(1)_n (c)_n} x^n
$$
$B$3$3$G(B
$$ (a)_n = a(a+1) \cdots (a+n-1). $$
{\color{green}
$$ \log (1+x) = x F(1,1,2;-x) $$
$$ \arcsin x = x F(1/2,1/2,3/2;x^2) $$
}

\noindent
Appell's $F_1$:
$$ {\color{blue} F_1(a,b,b',c;x,y)} = \sum_{m,n=1}^\infty
  \frac{(a)_{m+n} (b)_m (b')_n}{(c)_{m+n}(1)_m (1)_n} x^m y^n.
$$
\newpage
$B?t3X8x<0=8(B, $B$?$H$($P(B
Erdelyi: {\color{green} Higher Transcendental Functions} \\
{\color{blue} $B8x<0(B (type A)}\\
$B<!$N>oHyJ,J}Dx<0$N2r6u4V$O(B
$$ x(1-x) \frac{d^2f}{dx^2} -\left( c-(a+b+1)x \right) \frac{df}{dx} - a b f = 0$$
$B<!$N4X?t$GD%$i$l$k(B
$$ F(a,b,c;x) = {\color{red}1} + O(x), \  
   x^{1-c} F(a,b,c;x) = {\color{red}x^{1-c}}+O(x^{2-c}))$$

$B$3$3$G(B $c \not\in {\bf Z}$. \\
{\color{blue} $B8x<0(B (type B)}\\
\begin{eqnarray*}
&\ & F(a_1, a_2, b_2;z) \, F(-a_1,-a_2,2-b_2;z)  \\
&+& \frac{z}{e_2}\, F'(a_1, a_2, b_2;z) \, F(-a_1,-a_2,2-b_2;z)  \\
&-& \frac{z}{e_2}\, F(a_1, a_2, b_2;z) \, F'(-a_1,-a_2,2-b_2;z)  \\
&-& \frac{a_1+a_2-e_2}{a_1 a_2 e_2}z^2\,
  F'(a_1, a_2, b_2;z)\,F'(-a_1,-a_2,2-b_2;z) \\
&=& 1
\end{eqnarray*}
$B$3$3$G(B $e_2 = b_2-1$,  $a_1, a_2, e_2, e_2-a_2 \not\in {\bf Z}$.  \\
($B$3$N8x<0$O(B $\sin^2 x + \cos^2 x =1$ $B$N0lHL2=(B.)

\noindent
$B8=:_$d$C$F$k%W%m%8%'%/%H(B: \\
type A $B$*$h$S(B type B $B$N8x<0$r(B
{\color{blue} GKZ hypergeometric systems}
$B$KBP$7$F@8@.(B, $B8!>Z$7$h$&$H$7$F$$$k(B.

\begin{tabular}{|c|c|c|}
\hline
  & type A & type B \\ \hline
$B%"%k%4%j%:%`(B &  {\color{red} OK} (SST book) &  $B$d$C$F$k(B \\ \hline
$B<BAu(B & $BItJ,E*$K$G$-$?(B & $B$^$@(B \\ \hline
\end{tabular}

\noindent
$B8=:_$"$k(B ox $B%5!<%P(B
{\tt ox\_asir}, {\tt ox\_sm1}, {\tt ox\_tigers}, {\tt ox\_gnuplot},
{\tt ox\_mathematica}, {\tt OpenMathproxy} (JavaClasses), {\tt ox\_m2}
$B$O(B, GKZ $BD64v2?7O$KBP$7$F(B type A $B$N8x<0$r@8@.(B, $B8!>Z(B, $B%W%l%<%s$9$k$?$a$K(B
$B=8$a$F$"$k(B.

\newpage

\noindent{\color{red} 5. $BJ,;6%"%k%4%j%:%`$r4JC1$K$?$a$7$?$jI>2A$7$?$j$9$k(B.} \\

\noindent
{\color{green} $BNc(B 1} \\
$BDjM}(B (Cantor-Zassenhaus) \\
$f_1$ $B$H(B $f_2$ $B$r<!?t$,(B $d$ $B$G$"$k$h$&$J(B $F_q[x]$ $B$N4{LsB?9`<0$H$9$k(B.
$B<!?t(B $2d-1$ $B$N%i%s%@%`$J78?t$r$b$DB?9`<0(B $g \in F_q[x]$
$B$KBP$7$F(B
$$ GCD(g^{(q^d-1)/2}-1,f_1 f_2) = f_1 \,\mbox{or}\, f_2 $$
$B$H$J$k3NN($O(B 
$$ \frac{1}{2}-\frac{1}{(2q)^d}. $$

\begin{picture}(20,14)(0,0)
\put(7,12){\framebox(4,1.5){client}}
\put(2,6){\framebox(4,1.5){server}}
%%\put(7,6){\framebox(4,1.5){server}}
\put(12,6){\framebox(4,1.5){server}}
\put(0,0){\framebox(4,1.5){server}}
\put(5,0){\framebox(4,1.5){server}}
\put(13.5,0){\framebox(4,1.5){server}}

\put(9,12){\vector(-1,-1){4.3}}
%%\put(9,12){\vector(0,-1){4.3}}
\put(9,12){\vector(1,-1){4.3}}
\put(4,6){\vector(-1,-2){2.2}}
\put(4,6){\vector(1,-2){2.2}}
\put(14,6){\vector(1,-3){1.4}}
\end{picture}

\begin{verbatim}
/* F $B$N0x?tJ,2r$r$9$k(B. */
/* E =  F $B$N4{Ls0x;R$N<!?t(B */
def c_z(F,E,Level)
{
  V = var(F); N = deg(F,V);
  if ( N == E ) return [F];
  M = field_order_ff(); K = idiv(N,E); L = [F];
  while ( 1 ) {
    /* $B%i%s%@%`$J78?t$NB?9`<0$r:n$k(B */
    W = monic_randpoly_ff(2*E,V);
    /* $B%i%s%@%`$J78?t$NB?9`<0$N6R$r7W;;(B */
    T = generic_pwrmod_ff(W,F,idiv(M^E-1,2));
    if ( !(W = T-1) ) continue;
    /* G = GCD(F,W^((M^E-1)/2)) mod F) */
    G = ugcd(F,W);
    if ( deg(G,V) && deg(G,V) < N ) {
      /* G $B$O(B F $B$N0x;R(B */
      if ( Level >= LevelMax ) {
        /* $B$3$3$GA4$F$d$k>l9g(B */
        L1 = c_z(G,E,Level+1);
        L2 = c_z(sdiv(F,G),E,Level+1);
      } else {
        /* $B$^$@N)$A>e$2$$$J$+$C$?$i%5!<%P$rN)$A>e$2$k(B. */
        if ( Proc1 < 0 ) Proc1 = ox_launch();
        /* $B%5!<%P$KMj$`(B. Level = Level+1 */
        /* ox_c_z is a wrapper of c_z on the server */
        ox_cmo_rpc(Proc1,"ox_c_z",lmptop(G),E,
            setmod_ff(),Level+1);
        /* $B$N$3$j$N;E;v$O<+J,$G$d$k(B. */
        L2 = c_z(sdiv(F,G),E,Level+1);
        /* $B%5!<%P$+$i$N7k2L$r$b$i$&(B. */
        L1 = map(simp_ff,ox_pop_cmo(Proc1));
      }
      return append(L1,L2);
    }
  }
}
\end{verbatim}
\newpage

\epsfxsize=17cm
\epsffile{cz.ps}

\noindent
{\color{blue} $BJBNs(B CZ $B%"%k%4%j%:%`$NI>2A(B} \\
$d=1$, $k=200$ : $200$ $B8D$N(B 1 $B<!<0$N@Q(B. \\
$d=2$, $k=50$ : $50$ $B8D$N4{Ls$J(B $2$ $B<!<0$N@Q(B. \\

\newpage
{\color{green} $BNc(B 2} \\
$BB?9`<0$r3]$1$k$?$a$N(B Shoup $B$N%"%k%4%j%:%`(B.  \\
{\color{green} $BNc(B 3} \\
$B6%AhE*4D6-$K$*$1$k%0%l%V%J4pDl7W;;(B. \\
\newpage

\noindent
{\color{green} $BNc(B 3. $B6%AhE*4D6-$K$*$1$k%0%l%V%J4pDl7W;;(B}
\begin{verbatim}
extern Proc1,Proc2$
Proc1 = -1$ Proc2 = -1$
/* G:set of polys; V:list of variables */
/* Mod: the Ground field GF(Mod); O:type of order */
def dgr(G,V,Mod,O)
{
  /* invoke servers if necessary */
  if ( Proc1 == -1 ) Proc1 = ox_launch();
  if ( Proc2 == -1 ) Proc2 = ox_launch();
  P = [Proc1,Proc2];
  map(ox_reset,P); /* reset servers */
  /* P0 $B$O(B Buchberger algorithm over GF(Mod) $B$G7W;;(B. */
  ox_cmo_rpc(P[0],"dp_gr_mod_main",G,V,0,Mod,O);
  /* P1 $B$O(B F4 algorithm over GF(Mod) $B$G7W;;(B */
  ox_cmo_rpc(P[1],"dp_f4_mod_main",G,V,Mod,O);
  map(ox_push_cmd,P,262); /* 262 = OX_popCMO */
  F = ox_select(P); /* wait for data */
  /* F[0] is a server's id which is ready */
  R = ox_get(F[0]);
  if ( F[0] == P[0] ) { Win = "Buchberger"; Lose = P[1]; }
  else { Win = "F4"; Lose = P[0]; }
  ox_reset(Lose); /* $BCY$$J}$N%5!<%P$O;_$a$k(B. */
  return [Win,R];
} 
\end{verbatim}
\newpage

\end{document}