[BACK]Return to oxasir_old.sm1 CVS log [TXT][DIR] Up to [local] / OpenXM / src / kan96xx / Doc

File: [local] / OpenXM / src / kan96xx / Doc / oxasir_old.sm1 (download)

Revision 1.2, Fri Sep 10 13:20:22 2004 UTC (19 years, 8 months ago) by takayama
Branch: MAIN
CVS Tags: R_1_3_1-2, RELEASE_1_3_1_13b, RELEASE_1_2_3_12, RELEASE_1_2_3, KNOPPIX_2006, HEAD, DEB_REL_1_2_3-9
Changes since 1.1: +2 -2 lines

, is treated as a space.
,, (parse in a given ring) is changed to __
,,, (reparse a polynomial) is changed to ___

% $OpenXM: OpenXM/src/kan96xx/Doc/oxasir_old.sm1,v 1.2 2004/09/10 13:20:22 takayama Exp $
%% kxx/oxasir.sm1   1998, 2/12 (this version is at Old/oxasir.sm1.19980212
%%   3/1, 1995, 11/5, 11/21
%% This file is error clean.
%%%%%%% How to install.
%%%  Set ASIR_LIBDIR if necessary. Ex. /u/nobuki/lib/asir
%%%  write  ~/.asirrc  :    load("gr")$ load("primdec")$ load("bfct")$ end$
%%%  or it is written in OpenXM/rc/asirrc in OpenXM env, it's fine. 
%%%  oxasir.asir  must be in 
%%%  LOAD_SM1_PATH or oxasirpath.asirlib
%%%  Edit below
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% /usr/local/lib/sm1, SM1_LOAD_PATH, /usr/local/lib/asir, ASIR_LOAD_PATH
/oxasirpath.oxasir (ox_asir) def     %% loadmethod is 1
/oxasirpath.asirlib (oxasir.asir) def

/ox_asirConnectMethod { asirconnectr /oxasir.ccc set } def
%/ox_asirConnectMethod { asirconnect2  } def

%% Old path
%/oxasirpath.oxasir (/home/nobuki/kxx/ox_asir) def     %% loadmethod is 1
%/oxasirpath.asirlib (/home/nobuki/kxx/oxasir.asir) def
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/oxasir.loadmethod 1 def   %% "..." oxsendcmo (load) ox...
%/oxasir.loadmethod 0 def  %% load("...");  %% at MSRI
%%%%%%%%%%%%%%%% end of configuration.
/initializePathNamesForOxAsir  {
   [oxasirpath.oxasir] getPathNameAsir /oxasirpath.oxasir set
   [oxasirpath.asirlib] getPathNameSm1 /oxasirpath.asirlib set
} def


/oxasir.verbose 0   def
/oxasir.version (2.981105) def
oxasir.version [(Version)] system_variable gt 
{ [(This package requires the latest version of kan/sm1) nl
   (Please get it from http://www.math.kobe-u.ac.jp/KAN) ] cat
  error
} { } ifelse
(oxasir.sm1, --- open asir protocol module 3/1 1998, 6/5 1999) message-quiet
(   asirconnect, asir, fctr, primadec, (C) M.Noro, N.Takayama ) message-quiet

/oxasir.ccc load isArray 
{ }
{ /oxasir.ccc [ ] def } ifelse

[(parse) (ox.sm1) pushfile] extension pop
oxasir.verbose {
  (type in  asirconnect to connect,  asir is used to execute asir command. ) 
   message
  (type in  asirconnect2 to open a new window for ox_asir, connect,  asir is used to execute asir command [you need to edit asirconnect2 to tell the path to load ox_asir] ) 
   message
} { } ifelse

/loadAsirFile {
  /arg1 set
  [/in-loadAsirFile /peer /fname] pushVariables
  [
    /peer arg1 0 get def
    /fname arg1 1 get def
    oxasir.loadmethod  {
      peer  fname oxsendcmo peer 1 oxsendcmo
      peer (load) oxexec
    }{
      peer  [$load("$ fname $");$] cat oxsubmit
    }ifelse
  ] pop
  popVariables
} def
[(loadAsirFile)
[$[client fname] loadAsirFile   (ox_asir function)$
 $Load a file into the client$
]] putUsages

/asirinit {
 %% gr and primdec are loaded by .asirrc
 /asirinit.peer set
 [(ostype)] extension  0 get (windows) eq {
  [(getenv) (OSTYPE)] extension tag 0 eq {
    [asirinit.peer (oxasir-win.rr)] oxasirParseFile
  }{
   [(getenv) (OSTYPE)] extension (cygwin) eq {
     [asirinit.peer  oxasirpath.asirlib] loadAsirFile
   }{
     [asirinit.peer  (oxasir-win.rr)] oxasirParseFile
   } ifelse
  } ifelse
 }{
   [asirinit.peer  oxasirpath.asirlib] loadAsirFile
 } ifelse
 asirinit.peer oxmathcap
 asirinit.peer oxsetmathcap 
 (Ox103_loaded) boundp 
 {
   asirinit.peer ox103_asir_init
 }{  } ifelse
} def
/asirconnect {
 [(localhost) 1300 1200] oxconnect /oxasir.ccc set
 /ccc oxasir.ccc def   %% for compatibility.
 oxasir.ccc asirinit
} def
/asirconnect2 {
[oxpath.oxlog.xterm oxpath.ox ( -ox ) oxasirpath.oxasir
 oxpath.null
 ( & )] cat system-csh
% (xterm -e /home/nobuki/kxx/ox -ox /home/nobuki/kxx/ox_asir &) system-csh
% (kterm -iconic -e /home/nobuki/kxx/ox -ox /home/nobuki/kxx/ox_asir &) system-csh
% For MSRI
% Eterm is also nice (including kanji). rxvt is also nice.
%(xterm -icon -e /u/nobuki/tmp/kxx/ox -ox /u/nobuki/tmp/Ox/ox_asir2 &) system-csh
%(kterm2 -e /u/nobuki/tmp/kxx/ox -ox /u/nobuki/tmp/Ox/ox_asir2 &) system-csh
% (If you start the server automatically, you may have a trouble to) message
% (oxreset. In order to avoid this trouble, start the server by hand.) message
 (sleep 5) system-csh
 [(localhost) 1300 1200] oxconnect /oxasir.ccc set
 /ccc oxasir.ccc def   %% for compatibility.
 oxasir.ccc asirinit
} def

[(asirconnect2)
 [(asirconnect2 starts ox_asir server.  (ox_asir function))
  (Open xxx protocol is used for the communication between sm1 and ox_asir.)
  (cf. oxhelp,  asir.)
  (You need to install ox_asir server to use this function. cf. oxasir)
]] putUsages

/asirconnect3 {
[oxpath.oxlog.xterm oxpath.ox ( -ox ) oxasirpath.oxasir
 ( -data 2300 -control 2200) oxpath.null
 ( & )] cat system-csh
% (If you start the server automatically, you may have a trouble to) message
% (oxreset. In order to avoid this trouble, start the server by hand.) message
 (sleep 5) system-csh
 [(localhost) 2300 2200] oxconnect /oxasir.ccc2 set
 /ccc2 oxasir.ccc2 def   %% for compatibility.
 oxasir.ccc2  asirinit
 (The client is stored in oxasir.ccc2.) message
} def

[(asir)
 [(pid [asir-command, asir-arg1, asir-arg2, ...] asir result  (ox_asir function)) 
  (Call open asir server. You need to install ox_asir on your system)
  (to use this function. cf. primadec, fctr, asirconnect2, asirconnectr.)
  (If you interrupted the computation by typing ctrl-C, type in )
  (   oxasir.ccc oxreset  ; )
  (to interrupt the ox_asir server.)
  (Example: oxasir.ccc [(fctr) (x^10-1).] asir )
  (  )
  (This function requires plugins cmo, socket and ox_asir server. cf. oxasir)
  (See, ftp://endeavor.fujitsu.co.jp/pub/isis/asir on asir)
 ]
] putUsages

/asir {
  /arg2 set
  /arg1 set
  [/pid  /asir-comm /comm /n /i /rr] pushVariables
  [(CurrentRingp)] pushEnv
  [
     /pid arg1 def
     /asir-comm arg2 def
     pid tag 6 eq {  } { (Invalid pid. See asir.) error } ifelse
     pid 0 get (client) eq { } { (Invalid pid. See asir.) error } ifelse
     asir-comm tag 6 eq {  } { (Invalid argument asir-comm. See asir) error } ifelse

    [ %% Change the current ring if necessary to send a correct OxVlist.
      asir-comm oxasir.changeRing
    ] pop
    %%% Setting OxVlist to tell asir a way to change dist-poly <==> poly.
    (OxVlist=) getVlist2 toString (;) 3 cat_n /comm set
     %% comm message
     pid comm oxsubmit 
     pid (print(OxVlist);) oxsubmit


     /n asir-comm length def
     n 1 sub -1 1 {
       /i set
       pid asir-comm i get oxsendcmo
       pid 1 oxsendcmo pid (ox_dtop) oxexec
     } for
     pid n 1 sub oxsendcmo
     pid asir-comm 0 get oxexec

     pid 1 oxsendcmo pid (ox_ptod) oxexec
     pid oxpopcmo /arg1 set


  ] pop
  popEnv
  popVariables
  arg1
} def

/oxasir.changeRing {
  /arg1 set
  [/in-oxasir.changeRing /f /rr] pushVariables
  [
     /f arg1 def
     f isArray {
       f {oxasir.changeRing} map 
     }{
       f isPolynomial {
         f (0). eq { } 
         { f (ring) dc /rr set [(CurrentRingp) rr] system_variable } ifelse
       } {  } ifelse
     } ifelse
  ] pop
  popVariables
} def

/fctr {
  /arg1 set
  [/f /comm /vv] pushVariables
  [(CurrentRingp)] pushEnv
  [
    /f arg1 def
    oxasir.ccc [ ] eq {
       (Starting ox_asir server.) message
        ox_asirConnectMethod
    } {  } ifelse

    f isPolynomial not {
      /vv f 1 get def
      vv isArray { /vv vv from_records  def } {  } ifelse
      /f f 0 get def
      [vv ring_of_polynomials 0] define_ring
      f . /f set
    }{ } ifelse
    oxasir.ccc [(fctr) f] asir /arg1 set
  ] pop
  popEnv
  popVariables
  arg1
} def

[(fctr)
 [(You need to install ox_asir server to use this function. (ox_asir function))
  (f fctr g)
  (poly f; array g;)
  ([f v] fctr g ;  string f, string or array of string v)
  (This function factors the polynomial f over Q.)
  ( )
  (Example 1:  [(x^10-y^10) (x,y)] fctr ::)
  (Example 2:  (x^10-1). fctr ::)
  ( )
  (If you interrupted the computation by typing ctrl-C, type in )
  (   oxasir.ccc oxreset  ; )
  (to interrupt the ox_asir server.)
  (  )
  (This function requires plugins cmo, socket and ox_asir server. cf.oxasir)
]] putUsages


[(primadec)
 [(You need to install ox_asir server to use this function. (ox_asir function))
  ([ ii ] primadec [[q1 p1] [q2 p2] ... ] )
  ( array of poly ii; array of poly q1, p1, q2, p2 ...;)
  ( q1, q2, ... are primary components of the primary ideal decomposition)
  ( of the ideal generated by << ii >>.)
  (  )
  ([ ii v ] primadec [[q1 p1] [q2 p2] ... ] )
  ( array of poly or string ii; array of string v; array of poly q1, p1, q2, p2 ...;)
  (<< v >> is an array of independent variables.)
  (  )
  ([ ii v ] primadec [[q1 p1] [q2 p2] ... ] )
  ( array of poly or string ii; array of string v; array of poly q1, p1, q2, p2 ...;)
  ( v  is a string of variables separated by , )
  (  )
  (Example:  [(x,y) ring_of_polynomials 0] define_ring)
  (          [ [(x^2-1). (x y).] ] primadec pmat ;)
  (  )
  (Example:  [ [(x^2-1) (x y)] [(x) (y)]] primadec pmat ;)
  (  )
  (If you interrupted the computation by typing ctrl-C, type in )
  (   oxasir.ccc oxreset  ; )
  (to interrupt the ox_asir server.)
  (  )
  (This function requires plugins cmo, socket and ox_asir server. cf.oxasir)
]] putUsages

/primadec {
  /arg1 set
  [/in-primadec /aa /f  /comm /vvv /r /setarg] pushVariables
  [(CurrentRingp)] pushEnv
  [
    /aa arg1 def
    aa isArray { } { (<<array>> primadec) error } ifelse
    /setarg 0 def
    oxasir.ccc [ ] eq {
       (Starting ox_asir server.) message
        ox_asirConnectMethod
    } {  } ifelse
    aa { tag } map /typev set
    typev [ ArrayP ] eq
    {  /f aa 0 get def
       f 0 get (ring) dc /r set
       [(CurrentRingp) r] system_variable
       /vvv getVariableNames def
       /setarg 1 def
    } { } ifelse
    typev [ArrayP StringP] eq
    {  /f aa 0 get def
       /vvv [ aa 1 get to_records pop ] def
       /setarg 1 def
    } { } ifelse
    typev [ArrayP ArrayP] eq
    {  /f aa 0 get def
       /vvv aa 1 get {toString} map def
       /setarg 1 def
    } { } ifelse
    setarg { } { (primadec : Argument mismatch) error } ifelse

    f 0 get isPolynomial {
      /r f 0 get (ring) dc def
      /vvv vvv { r __ } map def
    }
    {
      [vvv from_records ring_of_polynomials 0] define_ring
      f { toString . } map /f set
      vvv { . } map /vvv set
    } ifelse
    oxasir.ccc [(primadec) f vvv] asir /arg1 set
  ] pop
  popEnv
  popVariables
  arg1
} def


/getVlist2 {
  [/n  /i ] pushVariables
  [
    /n [(N)] system_variable def
    [
      0 1 n 1 sub { /i set (x) i (dollar) dc 2 cat_n } for
      0 1 n 1 sub { /i set (d) i (dollar) dc 2 cat_n } for
    ] /arg1 set
  ] pop
  popVariables
  arg1
} def

%%%%%%%%%%%%%%%%%%%   
/getVlist {
  [/n  /i ] pushVariables
  [
    /n [(N)] system_variable def
    [
      0 1 n 1 sub { /i set [(x) (var) i] system_variable } for
      0 1 n 1 sub { /i set [(D) (var) i] system_variable } for
    ] /arg1 set
  ] pop
  popVariables
  arg1
} def

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[(chattr) 0 /findIntegralRoots] extension pop
oxasir.verbose {
  (Overloaded on findIntegralRoots.) message
} { } ifelse
/findIntegralRoots {
  /arg1 set 
  [/in-findIntegralRoots /pp ] pushVariables
  [
    /pp arg1 def
    oxasir.ccc [ ] eq {
      (Starting ox_asir server.) message
       ox_asirConnectMethod
    } {  } ifelse
    oxasir.ccc oxIsServerReady
    { pp findIntegralRoots.oxasir /arg1 set}
    { pp findIntegralRoots.slow /arg1 set} ifelse
  ] pop
  popVariables
  arg1
} def

/findIntegralRoots.oxasir {
  /arg1 set
  [/in-findIntegralRoots /f /r /g /aa /rlist] pushVariables
  [(CurrentRingp) (KanGBmessage)] pushEnv
  [
    /f arg1 def
    [(s) ring_of_polynomials 0] define_ring
    f toString . /f set
    f fctr rest /g set
    g { 
         0 get /aa set 
         aa (s). degree 1 eq {
           aa (s). coeff 1 get /aa set
           aa length 1 eq { 0 }
           {  aa 0 get (1). eq {
                 0 << aa 1 get (integer) dc >> sub
              } { } ifelse
           } ifelse
         }{ } ifelse
     } map
    /rlist set
    %% rlist ::
    [-1000000] rlist join shell rest /arg1 set
  ] pop
  popEnv
  popVariables
  arg1
} def


%%%%%%%%%%%%%%%%%%%%%%%%%%

/asirconnectr {
 [/in-asirconnectr /pass /peer /data /control /oxasir] pushVariables
 [
 /pass [(oxGenPass)] extension def
 /peer [(oxGetPort) (localhost)] extension def
 /data peer 1 get toString def
 /control peer 3 get toString def
 peer message
 [oxpath.oxlog.xterm  oxpath.ox ( -reverse -ox ) oxasirpath.oxasir
  ( -data ) data ( -control ) control  ( -pass ) pass 
  oxpath.null
  ( &)] cat system-csh
 [(oxCreateClient2) peer 0 pass] extension /oxasir set
                     %% 0 means connect from only localhost. 
 oxasir asirinit
 /arg1 oxasir def
 ] pop
 popVariables
 arg1
} def
[(asirconnectr)
 [(asirconnectr server  (ox_asir function))
  (array server;)
  (Example: asirconnectr /oxasir.ccc set)
]] putUsages


%%%%%%%%%%%%%   From gbhg3/Int/intw.sm1
%% This function needs solv1.asir and ox_asir.
%% See solv1.asir for the usage of this function.
/rationalRoots2 {
  /arg1 set
  [/in-rationalRoots2 /aa /f  /comm /vvv /r /setarg
   /w /ans
  ] pushVariables
  [(CurrentRingp) (KanGBmessage)] pushEnv
  [
    /aa arg1 def
    aa isArray { } { (<<array>> rationalRoots2) error } ifelse
    /setarg 0 def
    oxasir.ccc [ ] eq {
       (Starting ox_asir server.) message
        ox_asirConnectMethod
    } {  } ifelse
    aa { tag } map /typev set
    typev [ArrayP StringP ArrayP] eq
    {  /f aa 0 get def
       /vvv [ aa 1 get to_records pop ] def
       /w aa 2 get def
       /setarg 1 def
    } { } ifelse
    typev [ArrayP ArrayP ArrayP] eq
    {  /f aa 0 get def
       /vvv aa 1 get {toString} map def
       /setarg 1 def
       /w aa 2 get def
    } { } ifelse
    setarg { } { (rationalRoots2 : Argument mismatch) error } ifelse


    [vvv from_records ring_of_polynomials 0] define_ring
    f { toString . } map /f set
    vvv { . } map /vvv set
    w { toString . } map /w set
    
    (rationalRoots2 -- f = ) messagen f messagen 
    ( , vvv= ) messagen vvv messagen ( , w = ) messagen w message

    vvv length 1 eq w 0 get (1). eq and
    {
       [(KanGBmessage) 0] system_variable
       [f] groebner_sugar 0 get /f set
       vvv 0 get toString (s) eq {
       }{ [[vvv 0 get toString (s)] from_records ring_of_polynomials 0] define_ring}
       ifelse
       f 0 get toString . [[vvv 0 get toString . (s).]] replace
       findIntegralRoots /ans set
    }
    {
      oxasir.ccc [(sm1_rationalRoots2) f vvv w] asir 
      {(integer) dc} map
      /ans set
    } ifelse

    /arg1 ans def
  ] pop
  popEnv
  popVariables
  arg1
} def
[(rationalRoots2)
[(rationalRoots2  (ox_asir function) called from intw.sm1 to analyze integral)
 (roots.)
]] putUsages

/ptozp_subst  {
  /arg1 set
  [/in-ptozp_subst /aaa /fff /xxx /vvv /vlist] pushVariables
  [(CurrentRingp)] pushEnv
  [
     /aaa arg1 def
     /fff aaa 0 get def
     /xxx aaa 1 get toString def
     /vvv aaa 2 get {toString ..} map def
     aaa length 4 eq {
       /vlist aaa 3 get def
     } {  
       /vlist 0 def
     } ifelse
     oxasir.ccc [ ] eq {
        (Starting ox_asir server.) message
        ox_asirConnectMethod
     } {  } ifelse
     fff isPolynomial {
       fff (ring) dc ring_def
       fff toString /fff set
     } 
     { vlist isInteger { (ptozp_subst: need variable names.) error } {  } ifelse
       [vlist ring_of_differential_operators 0] define_ring
     } ifelse
     oxasir.ccc [(sm1_ptozp_subst) fff . xxx .  vvv] asir
     /arg1 set
  ] pop
  popEnv
  popVariables
  arg1
} def

[(ptozp_subst)
 [$[f  s  [p q] v] ptozp_subst g   (ox_asir function)$
  $It returns ptozp(subst(f,s,p/q))$
  $Example 1:  [ (x Dx - s) (s) [2 3] (x,s)] ptozp_subst $
  $   ===>     3 x Dx - 2 $
]] putUsages

/reduceByAsir  {
  /arg1 set
  [/in-reduceByAsir /aaa /fff /fff0 /fff1 /vlist] pushVariables
  [(CurrentRingp)] pushEnv
  [
     /aaa arg1 def
     /fff aaa 0 get def
     aaa length 2 eq {
       /vlist aaa 1 get def
     } {  
       /vlist 0 def
     } ifelse
     oxasir.ccc [ ] eq {
        (Starting ox_asir server.) message
        ox_asirConnectMethod
     } {  } ifelse
     fff isArray {
       fff length 2 eq {
         /fff0 fff 0 get def
         /fff1 fff 1 get def
       } {
         ([ << [f g] >> vlist ] reduceByAsir ) error
       } ifelse
     } {
       ([ << [f g] >> vlist ] reduceByAsir ) error
     } ifelse
     fff0 isPolynomial fff1 isPolynomial and {
       fff0 (ring) dc ring_def
       fff0 toString . /fff0 set
       fff1 (ring) dc ring_def
       fff1 toString . /fff1 set
     } 
     { vlist isInteger { (reduceByAsir: need variable names.) error } {  } ifelse
       [vlist ring_of_differential_operators 0] define_ring
       fff0 toString . /fff0 set
       fff1 toString . /fff1 set
     } ifelse
     oxasir.ccc [(sm1_rat2plist2) [fff0 fff1]] asir
     /arg1 set
  ] pop
  popEnv
  popVariables
  arg1
} def

[(reduceByAsir)
[$ [[f g] v] reduceByAsir [ff gg]   (ox_asir function)$
 $ [[f g]] reduceByAsir [ff gg]  $
 $Example 1: [[(2 x -2) (4 x - 8)] (x)] reduceByAsir $
 (Note that there may be a gcd that is more than 1 among the coefficients.)
]] putUsages

%% File should be preprocessed by OpenXM/misc/packages/Windows/oxpp 
%% and ./oxapp --removeSharp 
[(oxasirParseFile)
[$[peer filename] oxasirParseFile $
 $File should be preprocessed by OpenXM/misc/packages/Windows/oxpp$ 
 $and ./oxapp --removeSharp $
]] putUsages

/oxasirParseFile {
  /arg1 set
  [/in-oxasirParseFile /fname /sss] pushVariables
  [
    /fname arg1 1 get def
    /peer  arg1 0 get def 
    fname pushfile /sss set
    peer
    [$if (1) { ; $ sss (}$)] cat
    oxsubmit
  ] pop
  popVariables
} def

[(bfct)
 [
  ( f bfct b )
  ( poly f; poly b)
  ([f v] bfct b)
  ( string f )
  ( b is the global b-function of the polynomial f.)
  (Example: [(x^3-y^2) (x,y)] bfct fctr :: )
  (Algorithm: M.Noro, Mathematical Software, icms 2002, pp.147--157.)
  (  )
  (If you interrupted the computation by typing ctrl-C, type in )
  (   oxasir.ccc oxreset  ; )
  (to interrupt the ox_asir server.)
  (  )
  (This function requires plugins cmo, socket and ox_asir server. cf.oxasir)
  (You need to install ox_asir server to use this function. (ox_asir function))
]] putUsages

/bfct {
  /arg1 set
  [/in-bfct /f /comm /vv] pushVariables
  [(CurrentRingp)] pushEnv
  [
    /f arg1 def
    oxasir.ccc [ ] eq {
       (Starting ox_asir server.) message
        ox_asirConnectMethod
    } {  } ifelse

    f isPolynomial not {
      /vv f 1 get def
      vv isArray { /vv vv from_records  def } {  } ifelse
      /f f 0 get def
      [vv ring_of_polynomials 0] define_ring
      f . /f set
    }{ } ifelse
    oxasir.ccc [(oxasir_bfct) f] asir /f set
    [(s) ring_of_polynomials 0] define_ring
    f . /f set
    [f f fctr] /arg1 set 
  ] pop
  popEnv
  popVariables
  arg1
} def

[(generic_bfct)
 [
  ( [ii weight] generic_bfct b )
  ( list of poly ii; list weight)
  ([ii weight variables] generic_bfct b)
  ( list of string ii; list weight; list variables)
  ( b is the general b-function of the ideal ii w.r.t the weight.)
  (Example: [[(Dx^2) (Dy^2)] [(x) -1 (Dx) 1] [(x) (y)]] generic_bfct :: )
  (Notion: Saito, Sturmfels, Takayama, Grobner deformations of hypergeometric differential equaitons)
  (Algorithm:  M.Noro, Mathematical Software, icms 2002, pp.147--157.)
  (  )
  (If you interrupted the computation by typing ctrl-C, type in )
  (   oxasir.ccc oxreset  ; )
  (to interrupt the ox_asir server.)
  (  )
  (This function requires plugins cmo, socket and ox_asir server. cf.oxasir)
  (You need to install ox_asir server to use this function. (ox_asir function))
]] putUsages

/generic_bfct {
  /arg1 set
  [/in-generic_bfct /aa /f  /comm /vvv0 /n /vvv /ddd /r /setarg 
   /bf /wt ] pushVariables
  [(CurrentRingp)] pushEnv
  [
    /aa arg1 def
    aa isArray { } { (<<array>> generic_bfct) error } ifelse
    /setarg 0 def
    aa { tag } map /typev set
    typev [ ArrayP ArrayP] eq
    {  /f aa 0 get def
       f 0 tag PolyP { } {  (The first argument must be a list of differential operators. Give the third variable: a list of variables) error } ifelse
       f 0 get (ring) dc /r set
       [(CurrentRingp) r] system_variable
       /wt aa 1 get def

       /vvv0 getVariableNames def
       /n [(N)] system_variable def
       /vvv vvv0 n carN rest reverse rest reverse def
       /ddd vvv0 reverse n carN reverse 
                   rest reverse rest reverse def

       /wt wt generic_bfct.aux1 def

       /setarg 1 def
    } { } ifelse
    typev [ArrayP ArrayP StringP] eq
    {  /f aa 0 get def
       /vvv [ aa 2 get to_records pop ] def
       /wt aa 1 get def

       /n vvv length def
       /ddd vvv { (D) 2 1 roll 2 cat_n } map def

       /setarg 1 def
    } { } ifelse
    typev [ArrayP ArrayP ArrayP] eq
    {  /f aa 0 get def
       /vvv aa 2 get {toString} map def
       /wt aa 1 get def
 
       /n vvv length def
       /ddd vvv { (D) 2 1 roll 2 cat_n } map def

       /setarg 1 def
    } { } ifelse
    setarg { } { (generic_bfct : Argument mismatch) error } ifelse

    f 0 get isPolynomial {

    }
    {
      [vvv from_records ring_of_differential_operators 0] define_ring
      f { toString . } map /f set
      vvv { . } map /vvv set
      ddd { . } map /ddd set
      /wt wt generic_bfct.aux1 def  
    } ifelse
    [f vvv ddd wt] message

    oxasir.ccc [ ] eq {
       (Starting ox_asir server.) message
        ox_asirConnectMethod
    } {  } ifelse

    oxasir.ccc [(oxasir_generic_bfct) f vvv ddd wt] asir /bf set
    [(s) ring_of_polynomials 0] define_ring
    bf . /bf set
    [bf bf fctr] /arg1 set 
  ] pop
  popEnv
  popVariables
  arg1
} def

/generic_bfct.aux1 {
  /arg1 set
  [/in-generic_bfct.aux1 /wt /wtx /wtd /n]  pushVariables
  [
    arg1 /wt set
    /n [(N)] system_variable def
    wt { dup tag PolyP eq { toString } {    } ifelse } map /wt set
    wt weightv /wt set
    /wtx wt n carN rest reverse rest reverse def
    /wtd wt reverse n carN reverse 
                   rest reverse rest reverse def
    wtx wtd join /wt set
    wt { dup tag IntegerP eq { (universalNumber) dc } {    } ifelse } map /wt set
    wt /arg1 set
  ] pop
  popVariables
  arg1 
} def

/oxasir.sm1.loaded 1 def
[(ostype)] extension  0 get (windows) eq {
  [(parse) (oxasir-win.sm1) pushfile ] extension 
}{
  initializePathNamesForOxAsir   %% This should be the last.
} ifelse