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

Annotation of OpenXM/src/kan96xx/Doc/oxasir.sm1, Revision 1.12

1.12    ! takayama    1: % $OpenXM: OpenXM/src/kan96xx/Doc/oxasir.sm1,v 1.11 2002/11/09 01:24:08 takayama Exp $
1.1       maekawa     2: %% kxx/oxasir.sm1   1998, 2/12 (this version is at Old/oxasir.sm1.19980212
                      3: %%   3/1, 1995, 11/5, 11/21
                      4: %% This file is error clean.
                      5: %%%%%%% How to install.
                      6: %%%  Set ASIR_LIBDIR if necessary. Ex. /u/nobuki/lib/asir
1.7       takayama    7: %%%  write  ~/.asirrc  :    load("gr")$ load("primdec")$ load("bfct")$ end$
                      8: %%%  or it is written in OpenXM/rc/asirrc in OpenXM env, it's fine.
1.1       maekawa     9: %%%  oxasir.asir  must be in
                     10: %%%  LOAD_SM1_PATH or oxasirpath.asirlib
                     11: %%%  Edit below
                     12: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                     13: %%% /usr/local/lib/sm1, SM1_LOAD_PATH, /usr/local/lib/asir, ASIR_LOAD_PATH
                     14: /oxasirpath.oxasir (ox_asir) def     %% loadmethod is 1
                     15: /oxasirpath.asirlib (oxasir.asir) def
                     16:
                     17: /ox_asirConnectMethod { asirconnectr /oxasir.ccc set } def
                     18: %/ox_asirConnectMethod { asirconnect2  } def
                     19:
                     20: %% Old path
                     21: %/oxasirpath.oxasir (/home/nobuki/kxx/ox_asir) def     %% loadmethod is 1
                     22: %/oxasirpath.asirlib (/home/nobuki/kxx/oxasir.asir) def
                     23: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                     24: /oxasir.loadmethod 1 def   %% "..." oxsendcmo (load) ox...
                     25: %/oxasir.loadmethod 0 def  %% load("...");  %% at MSRI
                     26: %%%%%%%%%%%%%%%% end of configuration.
                     27: /initializePathNamesForOxAsir  {
                     28:    [oxasirpath.oxasir] getPathNameAsir /oxasirpath.oxasir set
                     29:    [oxasirpath.asirlib] getPathNameSm1 /oxasirpath.asirlib set
                     30: } def
                     31:
                     32:
                     33: /oxasir.verbose 0   def
                     34: /oxasir.version (2.981105) def
                     35: oxasir.version [(Version)] system_variable gt
                     36: { [(This package requires the latest version of kan/sm1) nl
                     37:    (Please get it from http://www.math.kobe-u.ac.jp/KAN) ] cat
                     38:   error
                     39: } { } ifelse
                     40: (oxasir.sm1, --- open asir protocol module 3/1 1998, 6/5 1999) message-quiet
                     41: (   asirconnect, asir, fctr, primadec, (C) M.Noro, N.Takayama ) message-quiet
                     42:
                     43: /oxasir.ccc load isArray
                     44: { }
                     45: { /oxasir.ccc [ ] def } ifelse
                     46:
                     47: [(parse) (ox.sm1) pushfile] extension pop
                     48: oxasir.verbose {
                     49:   (type in  asirconnect to connect,  asir is used to execute asir command. )
                     50:    message
                     51:   (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] )
                     52:    message
                     53: } { } ifelse
                     54:
                     55: /loadAsirFile {
                     56:   /arg1 set
                     57:   [/in-loadAsirFile /peer /fname] pushVariables
                     58:   [
                     59:     /peer arg1 0 get def
                     60:     /fname arg1 1 get def
                     61:     oxasir.loadmethod  {
                     62:       peer  fname oxsendcmo peer 1 oxsendcmo
                     63:       peer (load) oxexec
                     64:     }{
                     65:       peer  [$load("$ fname $");$] cat oxsubmit
                     66:     }ifelse
                     67:   ] pop
                     68:   popVariables
                     69: } def
                     70: [(loadAsirFile)
                     71: [$[client fname] loadAsirFile   (ox_asir function)$
                     72:  $Load a file into the client$
                     73: ]] putUsages
                     74:
                     75: /asirinit {
                     76:  %% gr and primdec are loaded by .asirrc
                     77:  /asirinit.peer set
1.4       takayama   78:  [(ostype)] extension  0 get (windows) eq {
1.6       takayama   79:   [(getenv) (OSTYPE)] extension tag 0 eq {
                     80:     [asirinit.peer (oxasir-win.rr)] oxasirParseFile
                     81:   }{
1.5       takayama   82:    [(getenv) (OSTYPE)] extension (cygwin) eq {
                     83:      [asirinit.peer  oxasirpath.asirlib] loadAsirFile
                     84:    }{
                     85:      [asirinit.peer  (oxasir-win.rr)] oxasirParseFile
                     86:    } ifelse
1.6       takayama   87:   } ifelse
1.4       takayama   88:  }{
                     89:    [asirinit.peer  oxasirpath.asirlib] loadAsirFile
1.11      takayama   90:  } ifelse
                     91:  asirinit.peer oxmathcap
                     92:  asirinit.peer oxsetmathcap
1.12    ! takayama   93:  (Ox103_loaded) boundp
        !            94:  {
        !            95:    asirinit.peer ox103_asir_init
        !            96:  }{  } ifelse
1.1       maekawa    97: } def
                     98: /asirconnect {
                     99:  [(localhost) 1300 1200] oxconnect /oxasir.ccc set
                    100:  /ccc oxasir.ccc def   %% for compatibility.
                    101:  oxasir.ccc asirinit
                    102: } def
                    103: /asirconnect2 {
                    104: [oxpath.oxlog.xterm oxpath.ox ( -ox ) oxasirpath.oxasir
                    105:  oxpath.null
1.2       takayama  106:  ( & )] cat system-csh
                    107: % (xterm -e /home/nobuki/kxx/ox -ox /home/nobuki/kxx/ox_asir &) system-csh
                    108: % (kterm -iconic -e /home/nobuki/kxx/ox -ox /home/nobuki/kxx/ox_asir &) system-csh
1.1       maekawa   109: % For MSRI
                    110: % Eterm is also nice (including kanji). rxvt is also nice.
1.2       takayama  111: %(xterm -icon -e /u/nobuki/tmp/kxx/ox -ox /u/nobuki/tmp/Ox/ox_asir2 &) system-csh
                    112: %(kterm2 -e /u/nobuki/tmp/kxx/ox -ox /u/nobuki/tmp/Ox/ox_asir2 &) system-csh
1.1       maekawa   113: % (If you start the server automatically, you may have a trouble to) message
                    114: % (oxreset. In order to avoid this trouble, start the server by hand.) message
1.2       takayama  115:  (sleep 5) system-csh
1.1       maekawa   116:  [(localhost) 1300 1200] oxconnect /oxasir.ccc set
                    117:  /ccc oxasir.ccc def   %% for compatibility.
                    118:  oxasir.ccc asirinit
                    119: } def
                    120:
                    121: [(asirconnect2)
                    122:  [(asirconnect2 starts ox_asir server.  (ox_asir function))
                    123:   (Open xxx protocol is used for the communication between sm1 and ox_asir.)
                    124:   (cf. oxhelp,  asir.)
                    125:   (You need to install ox_asir server to use this function. cf. oxasir)
                    126: ]] putUsages
                    127:
                    128: /asirconnect3 {
                    129: [oxpath.oxlog.xterm oxpath.ox ( -ox ) oxasirpath.oxasir
                    130:  ( -data 2300 -control 2200) oxpath.null
1.2       takayama  131:  ( & )] cat system-csh
1.1       maekawa   132: % (If you start the server automatically, you may have a trouble to) message
                    133: % (oxreset. In order to avoid this trouble, start the server by hand.) message
1.2       takayama  134:  (sleep 5) system-csh
1.1       maekawa   135:  [(localhost) 2300 2200] oxconnect /oxasir.ccc2 set
                    136:  /ccc2 oxasir.ccc2 def   %% for compatibility.
                    137:  oxasir.ccc2  asirinit
                    138:  (The client is stored in oxasir.ccc2.) message
                    139: } def
                    140:
                    141: [(asir)
                    142:  [(pid [asir-command, asir-arg1, asir-arg2, ...] asir result  (ox_asir function))
                    143:   (Call open asir server. You need to install ox_asir on your system)
                    144:   (to use this function. cf. primadec, fctr, asirconnect2, asirconnectr.)
                    145:   (If you interrupted the computation by typing ctrl-C, type in )
                    146:   (   oxasir.ccc oxreset  ; )
                    147:   (to interrupt the ox_asir server.)
                    148:   (Example: oxasir.ccc [(fctr) (x^10-1).] asir )
                    149:   (  )
                    150:   (This function requires plugins cmo, socket and ox_asir server. cf. oxasir)
                    151:   (See, ftp://endeavor.fujitsu.co.jp/pub/isis/asir on asir)
                    152:  ]
                    153: ] putUsages
                    154:
                    155: /asir {
                    156:   /arg2 set
                    157:   /arg1 set
                    158:   [/pid  /asir-comm /comm /n /i /rr] pushVariables
                    159:   [(CurrentRingp)] pushEnv
                    160:   [
                    161:      /pid arg1 def
                    162:      /asir-comm arg2 def
                    163:      pid tag 6 eq {  } { (Invalid pid. See asir.) error } ifelse
                    164:      pid 0 get (client) eq { } { (Invalid pid. See asir.) error } ifelse
                    165:      asir-comm tag 6 eq {  } { (Invalid argument asir-comm. See asir) error } ifelse
                    166:
                    167:     [ %% Change the current ring if necessary to send a correct OxVlist.
                    168:       asir-comm oxasir.changeRing
                    169:     ] pop
                    170:     %%% Setting OxVlist to tell asir a way to change dist-poly <==> poly.
                    171:     (OxVlist=) getVlist2 toString (;) 3 cat_n /comm set
                    172:      %% comm message
                    173:      pid comm oxsubmit
                    174:      pid (print(OxVlist);) oxsubmit
                    175:
                    176:
                    177:      /n asir-comm length def
                    178:      n 1 sub -1 1 {
                    179:        /i set
                    180:        pid asir-comm i get oxsendcmo
                    181:        pid 1 oxsendcmo pid (ox_dtop) oxexec
                    182:      } for
                    183:      pid n 1 sub oxsendcmo
                    184:      pid asir-comm 0 get oxexec
                    185:
                    186:      pid 1 oxsendcmo pid (ox_ptod) oxexec
                    187:      pid oxpopcmo /arg1 set
                    188:
                    189:
                    190:   ] pop
                    191:   popEnv
                    192:   popVariables
                    193:   arg1
                    194: } def
                    195:
                    196: /oxasir.changeRing {
                    197:   /arg1 set
                    198:   [/in-oxasir.changeRing /f /rr] pushVariables
                    199:   [
                    200:      /f arg1 def
                    201:      f isArray {
                    202:        f {oxasir.changeRing} map
                    203:      }{
                    204:        f isPolynomial {
                    205:          f (0). eq { }
                    206:          { f (ring) dc /rr set [(CurrentRingp) rr] system_variable } ifelse
                    207:        } {  } ifelse
                    208:      } ifelse
                    209:   ] pop
                    210:   popVariables
                    211: } def
                    212:
                    213: /fctr {
                    214:   /arg1 set
                    215:   [/f /comm /vv] pushVariables
                    216:   [(CurrentRingp)] pushEnv
                    217:   [
                    218:     /f arg1 def
                    219:     oxasir.ccc [ ] eq {
                    220:        (Starting ox_asir server.) message
                    221:         ox_asirConnectMethod
                    222:     } {  } ifelse
                    223:
                    224:     f isPolynomial not {
                    225:       /vv f 1 get def
                    226:       vv isArray { /vv vv from_records  def } {  } ifelse
                    227:       /f f 0 get def
                    228:       [vv ring_of_polynomials 0] define_ring
                    229:       f . /f set
                    230:     }{ } ifelse
                    231:     oxasir.ccc [(fctr) f] asir /arg1 set
                    232:   ] pop
                    233:   popEnv
                    234:   popVariables
                    235:   arg1
                    236: } def
                    237:
                    238: [(fctr)
                    239:  [(You need to install ox_asir server to use this function. (ox_asir function))
                    240:   (f fctr g)
                    241:   (poly f; array g;)
                    242:   ([f v] fctr g ;  string f, string or array of string v)
                    243:   (This function factors the polynomial f over Q.)
                    244:   ( )
                    245:   (Example 1:  [(x^10-y^10) (x,y)] fctr ::)
                    246:   (Example 2:  (x^10-1). fctr ::)
                    247:   ( )
                    248:   (If you interrupted the computation by typing ctrl-C, type in )
                    249:   (   oxasir.ccc oxreset  ; )
                    250:   (to interrupt the ox_asir server.)
                    251:   (  )
                    252:   (This function requires plugins cmo, socket and ox_asir server. cf.oxasir)
                    253: ]] putUsages
                    254:
                    255:
                    256: [(primadec)
                    257:  [(You need to install ox_asir server to use this function. (ox_asir function))
                    258:   ([ ii ] primadec [[q1 p1] [q2 p2] ... ] )
                    259:   ( array of poly ii; array of poly q1, p1, q2, p2 ...;)
                    260:   ( q1, q2, ... are primary components of the primary ideal decomposition)
                    261:   ( of the ideal generated by << ii >>.)
                    262:   (  )
                    263:   ([ ii v ] primadec [[q1 p1] [q2 p2] ... ] )
                    264:   ( array of poly or string ii; array of string v; array of poly q1, p1, q2, p2 ...;)
                    265:   (<< v >> is an array of independent variables.)
                    266:   (  )
                    267:   ([ ii v ] primadec [[q1 p1] [q2 p2] ... ] )
                    268:   ( array of poly or string ii; array of string v; array of poly q1, p1, q2, p2 ...;)
                    269:   ( v  is a string of variables separated by , )
                    270:   (  )
                    271:   (Example:  [(x,y) ring_of_polynomials 0] define_ring)
                    272:   (          [ [(x^2-1). (x y).] ] primadec pmat ;)
                    273:   (  )
                    274:   (Example:  [ [(x^2-1) (x y)] [(x) (y)]] primadec pmat ;)
                    275:   (  )
                    276:   (If you interrupted the computation by typing ctrl-C, type in )
                    277:   (   oxasir.ccc oxreset  ; )
                    278:   (to interrupt the ox_asir server.)
                    279:   (  )
                    280:   (This function requires plugins cmo, socket and ox_asir server. cf.oxasir)
                    281: ]] putUsages
                    282:
                    283: /primadec {
                    284:   /arg1 set
                    285:   [/in-primadec /aa /f  /comm /vvv /r /setarg] pushVariables
                    286:   [(CurrentRingp)] pushEnv
                    287:   [
                    288:     /aa arg1 def
                    289:     aa isArray { } { (<<array>> primadec) error } ifelse
                    290:     /setarg 0 def
                    291:     oxasir.ccc [ ] eq {
                    292:        (Starting ox_asir server.) message
                    293:         ox_asirConnectMethod
                    294:     } {  } ifelse
                    295:     aa { tag } map /typev set
                    296:     typev [ ArrayP ] eq
                    297:     {  /f aa 0 get def
                    298:        f 0 get (ring) dc /r set
                    299:        [(CurrentRingp) r] system_variable
                    300:        /vvv getVariableNames def
                    301:        /setarg 1 def
                    302:     } { } ifelse
                    303:     typev [ArrayP StringP] eq
                    304:     {  /f aa 0 get def
                    305:        /vvv [ aa 1 get to_records pop ] def
                    306:        /setarg 1 def
                    307:     } { } ifelse
                    308:     typev [ArrayP ArrayP] eq
                    309:     {  /f aa 0 get def
                    310:        /vvv aa 1 get {toString} map def
                    311:        /setarg 1 def
                    312:     } { } ifelse
                    313:     setarg { } { (primadec : Argument mismatch) error } ifelse
                    314:
                    315:     f 0 get isPolynomial {
                    316:       /r f 0 get (ring) dc def
                    317:       /vvv vvv { r ,, } map def
                    318:     }
                    319:     {
                    320:       [vvv from_records ring_of_polynomials 0] define_ring
                    321:       f { toString . } map /f set
                    322:       vvv { . } map /vvv set
                    323:     } ifelse
                    324:     oxasir.ccc [(primadec) f vvv] asir /arg1 set
                    325:   ] pop
                    326:   popEnv
                    327:   popVariables
                    328:   arg1
                    329: } def
                    330:
                    331:
                    332: /getVlist2 {
                    333:   [/n  /i ] pushVariables
                    334:   [
                    335:     /n [(N)] system_variable def
                    336:     [
                    337:       0 1 n 1 sub { /i set (x) i (dollar) dc 2 cat_n } for
                    338:       0 1 n 1 sub { /i set (d) i (dollar) dc 2 cat_n } for
                    339:     ] /arg1 set
                    340:   ] pop
                    341:   popVariables
                    342:   arg1
                    343: } def
                    344:
                    345: %%%%%%%%%%%%%%%%%%%
                    346: /getVlist {
                    347:   [/n  /i ] pushVariables
                    348:   [
                    349:     /n [(N)] system_variable def
                    350:     [
                    351:       0 1 n 1 sub { /i set [(x) (var) i] system_variable } for
                    352:       0 1 n 1 sub { /i set [(D) (var) i] system_variable } for
                    353:     ] /arg1 set
                    354:   ] pop
                    355:   popVariables
                    356:   arg1
                    357: } def
                    358:
                    359: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                    360: [(chattr) 0 /findIntegralRoots] extension pop
                    361: oxasir.verbose {
                    362:   (Overloaded on findIntegralRoots.) message
                    363: } { } ifelse
                    364: /findIntegralRoots {
                    365:   /arg1 set
                    366:   [/in-findIntegralRoots /pp ] pushVariables
                    367:   [
                    368:     /pp arg1 def
                    369:     oxasir.ccc [ ] eq {
                    370:       (Starting ox_asir server.) message
                    371:        ox_asirConnectMethod
                    372:     } {  } ifelse
                    373:     oxasir.ccc oxIsServerReady
                    374:     { pp findIntegralRoots.oxasir /arg1 set}
                    375:     { pp findIntegralRoots.slow /arg1 set} ifelse
                    376:   ] pop
                    377:   popVariables
                    378:   arg1
                    379: } def
                    380:
                    381: /findIntegralRoots.oxasir {
                    382:   /arg1 set
                    383:   [/in-findIntegralRoots /f /r /g /aa /rlist] pushVariables
                    384:   [(CurrentRingp) (KanGBmessage)] pushEnv
                    385:   [
                    386:     /f arg1 def
                    387:     [(s) ring_of_polynomials 0] define_ring
                    388:     f toString . /f set
                    389:     f fctr rest /g set
                    390:     g {
                    391:          0 get /aa set
                    392:          aa (s). degree 1 eq {
                    393:            aa (s). coeff 1 get /aa set
                    394:            aa length 1 eq { 0 }
                    395:            {  aa 0 get (1). eq {
                    396:                  0 << aa 1 get (integer) dc >> sub
                    397:               } { } ifelse
                    398:            } ifelse
                    399:          }{ } ifelse
                    400:      } map
                    401:     /rlist set
                    402:     %% rlist ::
                    403:     [-1000000] rlist join shell rest /arg1 set
                    404:   ] pop
                    405:   popEnv
                    406:   popVariables
                    407:   arg1
                    408: } def
                    409:
                    410:
                    411: %%%%%%%%%%%%%%%%%%%%%%%%%%
                    412:
                    413: /asirconnectr {
                    414:  [/in-asirconnectr /pass /peer /data /control /oxasir] pushVariables
                    415:  [
                    416:  /pass [(oxGenPass)] extension def
                    417:  /peer [(oxGetPort) (localhost)] extension def
                    418:  /data peer 1 get toString def
                    419:  /control peer 3 get toString def
                    420:  peer message
                    421:  [oxpath.oxlog.xterm  oxpath.ox ( -reverse -ox ) oxasirpath.oxasir
                    422:   ( -data ) data ( -control ) control  ( -pass ) pass
                    423:   oxpath.null
1.2       takayama  424:   ( &)] cat system-csh
1.1       maekawa   425:  [(oxCreateClient2) peer 0 pass] extension /oxasir set
                    426:                      %% 0 means connect from only localhost.
                    427:  oxasir asirinit
                    428:  /arg1 oxasir def
                    429:  ] pop
                    430:  popVariables
                    431:  arg1
                    432: } def
                    433: [(asirconnectr)
                    434:  [(asirconnectr server  (ox_asir function))
                    435:   (array server;)
                    436:   (Example: asirconnectr /oxasir.ccc set)
                    437: ]] putUsages
                    438:
                    439:
                    440: %%%%%%%%%%%%%   From gbhg3/Int/intw.sm1
                    441: %% This function needs solv1.asir and ox_asir.
                    442: %% See solv1.asir for the usage of this function.
                    443: /rationalRoots2 {
                    444:   /arg1 set
                    445:   [/in-rationalRoots2 /aa /f  /comm /vvv /r /setarg
                    446:    /w /ans
                    447:   ] pushVariables
                    448:   [(CurrentRingp) (KanGBmessage)] pushEnv
                    449:   [
                    450:     /aa arg1 def
                    451:     aa isArray { } { (<<array>> rationalRoots2) error } ifelse
                    452:     /setarg 0 def
                    453:     oxasir.ccc [ ] eq {
                    454:        (Starting ox_asir server.) message
                    455:         ox_asirConnectMethod
                    456:     } {  } ifelse
                    457:     aa { tag } map /typev set
                    458:     typev [ArrayP StringP ArrayP] eq
                    459:     {  /f aa 0 get def
                    460:        /vvv [ aa 1 get to_records pop ] def
                    461:        /w aa 2 get def
                    462:        /setarg 1 def
                    463:     } { } ifelse
                    464:     typev [ArrayP ArrayP ArrayP] eq
                    465:     {  /f aa 0 get def
                    466:        /vvv aa 1 get {toString} map def
                    467:        /setarg 1 def
                    468:        /w aa 2 get def
                    469:     } { } ifelse
                    470:     setarg { } { (rationalRoots2 : Argument mismatch) error } ifelse
                    471:
                    472:
                    473:     [vvv from_records ring_of_polynomials 0] define_ring
                    474:     f { toString . } map /f set
                    475:     vvv { . } map /vvv set
                    476:     w { toString . } map /w set
                    477:
                    478:     (rationalRoots2 -- f = ) messagen f messagen
                    479:     ( , vvv= ) messagen vvv messagen ( , w = ) messagen w message
                    480:
                    481:     vvv length 1 eq w 0 get (1). eq and
                    482:     {
                    483:        [(KanGBmessage) 0] system_variable
                    484:        [f] groebner_sugar 0 get /f set
                    485:        vvv 0 get toString (s) eq {
                    486:        }{ [[vvv 0 get toString (s)] from_records ring_of_polynomials 0] define_ring}
                    487:        ifelse
                    488:        f 0 get toString . [[vvv 0 get toString . (s).]] replace
                    489:        findIntegralRoots /ans set
                    490:     }
                    491:     {
                    492:       oxasir.ccc [(sm1_rationalRoots2) f vvv w] asir
                    493:       {(integer) dc} map
                    494:       /ans set
                    495:     } ifelse
                    496:
                    497:     /arg1 ans def
                    498:   ] pop
                    499:   popEnv
                    500:   popVariables
                    501:   arg1
                    502: } def
                    503: [(rationalRoots2)
                    504: [(rationalRoots2  (ox_asir function) called from intw.sm1 to analyze integral)
                    505:  (roots.)
                    506: ]] putUsages
                    507:
                    508: /ptozp_subst  {
                    509:   /arg1 set
                    510:   [/in-ptozp_subst /aaa /fff /xxx /vvv /vlist] pushVariables
                    511:   [(CurrentRingp)] pushEnv
                    512:   [
                    513:      /aaa arg1 def
                    514:      /fff aaa 0 get def
                    515:      /xxx aaa 1 get toString def
                    516:      /vvv aaa 2 get {toString ..} map def
                    517:      aaa length 4 eq {
                    518:        /vlist aaa 3 get def
                    519:      } {
                    520:        /vlist 0 def
                    521:      } ifelse
                    522:      oxasir.ccc [ ] eq {
                    523:         (Starting ox_asir server.) message
                    524:         ox_asirConnectMethod
                    525:      } {  } ifelse
                    526:      fff isPolynomial {
                    527:        fff (ring) dc ring_def
                    528:        fff toString /fff set
                    529:      }
                    530:      { vlist isInteger { (ptozp_subst: need variable names.) error } {  } ifelse
                    531:        [vlist ring_of_differential_operators 0] define_ring
                    532:      } ifelse
                    533:      oxasir.ccc [(sm1_ptozp_subst) fff . xxx .  vvv] asir
                    534:      /arg1 set
                    535:   ] pop
                    536:   popEnv
                    537:   popVariables
                    538:   arg1
                    539: } def
                    540:
                    541: [(ptozp_subst)
                    542:  [$[f  s  [p q] v] ptozp_subst g   (ox_asir function)$
                    543:   $It returns ptozp(subst(f,s,p/q))$
                    544:   $Example 1:  [ (x Dx - s) (s) [2 3] (x,s)] ptozp_subst $
                    545:   $   ===>     3 x Dx - 2 $
                    546: ]] putUsages
                    547:
                    548: /reduceByAsir  {
                    549:   /arg1 set
                    550:   [/in-reduceByAsir /aaa /fff /fff0 /fff1 /vlist] pushVariables
                    551:   [(CurrentRingp)] pushEnv
                    552:   [
                    553:      /aaa arg1 def
                    554:      /fff aaa 0 get def
                    555:      aaa length 2 eq {
                    556:        /vlist aaa 1 get def
                    557:      } {
                    558:        /vlist 0 def
                    559:      } ifelse
                    560:      oxasir.ccc [ ] eq {
                    561:         (Starting ox_asir server.) message
                    562:         ox_asirConnectMethod
                    563:      } {  } ifelse
                    564:      fff isArray {
                    565:        fff length 2 eq {
                    566:          /fff0 fff 0 get def
                    567:          /fff1 fff 1 get def
                    568:        } {
                    569:          ([ << [f g] >> vlist ] reduceByAsir ) error
                    570:        } ifelse
                    571:      } {
                    572:        ([ << [f g] >> vlist ] reduceByAsir ) error
                    573:      } ifelse
                    574:      fff0 isPolynomial fff1 isPolynomial and {
                    575:        fff0 (ring) dc ring_def
                    576:        fff0 toString . /fff0 set
                    577:        fff1 (ring) dc ring_def
                    578:        fff1 toString . /fff1 set
                    579:      }
                    580:      { vlist isInteger { (reduceByAsir: need variable names.) error } {  } ifelse
                    581:        [vlist ring_of_differential_operators 0] define_ring
                    582:        fff0 toString . /fff0 set
                    583:        fff1 toString . /fff1 set
                    584:      } ifelse
                    585:      oxasir.ccc [(sm1_rat2plist2) [fff0 fff1]] asir
                    586:      /arg1 set
                    587:   ] pop
                    588:   popEnv
                    589:   popVariables
                    590:   arg1
                    591: } def
                    592:
                    593: [(reduceByAsir)
                    594: [$ [[f g] v] reduceByAsir [ff gg]   (ox_asir function)$
                    595:  $ [[f g]] reduceByAsir [ff gg]  $
                    596:  $Example 1: [[(2 x -2) (4 x - 8)] (x)] reduceByAsir $
                    597:  (Note that there may be a gcd that is more than 1 among the coefficients.)
                    598: ]] putUsages
1.4       takayama  599:
                    600: %% File should be preprocessed by OpenXM/misc/packages/Windows/oxpp
                    601: %% and ./oxapp --removeSharp
                    602: [(oxasirParseFile)
                    603: [$[peer filename] oxasirParseFile $
                    604:  $File should be preprocessed by OpenXM/misc/packages/Windows/oxpp$
                    605:  $and ./oxapp --removeSharp $
                    606: ]] putUsages
                    607:
                    608: /oxasirParseFile {
                    609:   /arg1 set
                    610:   [/in-oxasirParseFile /fname /sss] pushVariables
                    611:   [
                    612:     /fname arg1 1 get def
                    613:     /peer  arg1 0 get def
                    614:     fname pushfile /sss set
                    615:     peer
                    616:     [$if (1) { ; $ sss (}$)] cat
                    617:     oxsubmit
                    618:   ] pop
                    619:   popVariables
1.7       takayama  620: } def
                    621:
                    622: [(bfct)
1.8       takayama  623:  [
1.7       takayama  624:   ( f bfct b )
                    625:   ( poly f; poly b)
                    626:   ([f v] bfct b)
                    627:   ( string f )
                    628:   ( b is the global b-function of the polynomial f.)
1.10      takayama  629:   (Example: [(x^3-y^2) (x,y)] bfct fctr :: )
1.9       takayama  630:   (Algorithm: M.Noro, Mathematical Software, icms 2002, pp.147--157.)
1.7       takayama  631:   (  )
                    632:   (If you interrupted the computation by typing ctrl-C, type in )
                    633:   (   oxasir.ccc oxreset  ; )
                    634:   (to interrupt the ox_asir server.)
                    635:   (  )
                    636:   (This function requires plugins cmo, socket and ox_asir server. cf.oxasir)
1.8       takayama  637:   (You need to install ox_asir server to use this function. (ox_asir function))
1.7       takayama  638: ]] putUsages
                    639:
                    640: /bfct {
                    641:   /arg1 set
                    642:   [/in-bfct /f /comm /vv] pushVariables
                    643:   [(CurrentRingp)] pushEnv
                    644:   [
                    645:     /f arg1 def
                    646:     oxasir.ccc [ ] eq {
                    647:        (Starting ox_asir server.) message
                    648:         ox_asirConnectMethod
                    649:     } {  } ifelse
                    650:
                    651:     f isPolynomial not {
                    652:       /vv f 1 get def
                    653:       vv isArray { /vv vv from_records  def } {  } ifelse
                    654:       /f f 0 get def
                    655:       [vv ring_of_polynomials 0] define_ring
                    656:       f . /f set
                    657:     }{ } ifelse
                    658:     oxasir.ccc [(oxasir_bfct) f] asir /f set
                    659:     [(s) ring_of_polynomials 0] define_ring
                    660:     f . /f set
                    661:     [f f fctr] /arg1 set
                    662:   ] pop
                    663:   popEnv
                    664:   popVariables
                    665:   arg1
1.4       takayama  666: } def
                    667:
1.8       takayama  668: [(generic_bfct)
                    669:  [
                    670:   ( [ii weight] generic_bfct b )
                    671:   ( list of poly ii; list weight)
                    672:   ([ii weight variables] generic_bfct b)
                    673:   ( list of string ii; list weight; list variables)
                    674:   ( b is the general b-function of the ideal ii w.r.t the weight.)
                    675:   (Example: [[(Dx^2) (Dy^2)] [(x) -1 (Dx) 1] [(x) (y)]] generic_bfct :: )
                    676:   (Notion: Saito, Sturmfels, Takayama, Grobner deformations of hypergeometric differential equaitons)
1.9       takayama  677:   (Algorithm:  M.Noro, Mathematical Software, icms 2002, pp.147--157.)
1.8       takayama  678:   (  )
                    679:   (If you interrupted the computation by typing ctrl-C, type in )
                    680:   (   oxasir.ccc oxreset  ; )
                    681:   (to interrupt the ox_asir server.)
                    682:   (  )
                    683:   (This function requires plugins cmo, socket and ox_asir server. cf.oxasir)
                    684:   (You need to install ox_asir server to use this function. (ox_asir function))
                    685: ]] putUsages
                    686:
                    687: /generic_bfct {
                    688:   /arg1 set
                    689:   [/in-generic_bfct /aa /f  /comm /vvv0 /n /vvv /ddd /r /setarg
                    690:    /bf /wt ] pushVariables
                    691:   [(CurrentRingp)] pushEnv
                    692:   [
                    693:     /aa arg1 def
                    694:     aa isArray { } { (<<array>> generic_bfct) error } ifelse
                    695:     /setarg 0 def
                    696:     aa { tag } map /typev set
                    697:     typev [ ArrayP ArrayP] eq
                    698:     {  /f aa 0 get def
                    699:        f 0 tag PolyP { } {  (The first argument must be a list of differential operators. Give the third variable: a list of variables) error } ifelse
                    700:        f 0 get (ring) dc /r set
                    701:        [(CurrentRingp) r] system_variable
                    702:        /wt aa 1 get def
                    703:
                    704:        /vvv0 getVariableNames def
                    705:        /n [(N)] system_variable def
                    706:        /vvv vvv0 n carN rest reverse rest reverse def
                    707:        /ddd vvv0 reverse n carN reverse
                    708:                    rest reverse rest reverse def
                    709:
                    710:        /wt wt generic_bfct.aux1 def
                    711:
                    712:        /setarg 1 def
                    713:     } { } ifelse
                    714:     typev [ArrayP ArrayP StringP] eq
                    715:     {  /f aa 0 get def
                    716:        /vvv [ aa 2 get to_records pop ] def
                    717:        /wt aa 1 get def
                    718:
                    719:        /n vvv length def
                    720:        /ddd vvv { (D) 2 1 roll 2 cat_n } map def
                    721:
                    722:        /setarg 1 def
                    723:     } { } ifelse
                    724:     typev [ArrayP ArrayP ArrayP] eq
                    725:     {  /f aa 0 get def
                    726:        /vvv aa 2 get {toString} map def
                    727:        /wt aa 1 get def
                    728:
                    729:        /n vvv length def
                    730:        /ddd vvv { (D) 2 1 roll 2 cat_n } map def
                    731:
                    732:        /setarg 1 def
                    733:     } { } ifelse
                    734:     setarg { } { (generic_bfct : Argument mismatch) error } ifelse
                    735:
                    736:     f 0 get isPolynomial {
                    737:
                    738:     }
                    739:     {
                    740:       [vvv from_records ring_of_differential_operators 0] define_ring
                    741:       f { toString . } map /f set
                    742:       vvv { . } map /vvv set
                    743:       ddd { . } map /ddd set
                    744:       /wt wt generic_bfct.aux1 def
                    745:     } ifelse
                    746:     [f vvv ddd wt] message
                    747:
                    748:     oxasir.ccc [ ] eq {
                    749:        (Starting ox_asir server.) message
                    750:         ox_asirConnectMethod
                    751:     } {  } ifelse
                    752:
                    753:     oxasir.ccc [(oxasir_generic_bfct) f vvv ddd wt] asir /bf set
                    754:     [(s) ring_of_polynomials 0] define_ring
                    755:     bf . /bf set
                    756:     [bf bf fctr] /arg1 set
                    757:   ] pop
                    758:   popEnv
                    759:   popVariables
                    760:   arg1
                    761: } def
                    762:
                    763: /generic_bfct.aux1 {
                    764:   /arg1 set
                    765:   [/in-generic_bfct.aux1 /wt /wtx /wtd /n]  pushVariables
                    766:   [
                    767:     arg1 /wt set
                    768:     /n [(N)] system_variable def
                    769:     wt { dup tag PolyP eq { toString } {    } ifelse } map /wt set
                    770:     wt weightv /wt set
                    771:     /wtx wt n carN rest reverse rest reverse def
                    772:     /wtd wt reverse n carN reverse
                    773:                    rest reverse rest reverse def
                    774:     wtx wtd join /wt set
                    775:     wt { dup tag IntegerP eq { (universalNumber) dc } {    } ifelse } map /wt set
                    776:     wt /arg1 set
                    777:   ] pop
                    778:   popVariables
                    779:   arg1
                    780: } def
1.1       maekawa   781:
                    782: /oxasir.sm1.loaded 1 def
1.3       takayama  783: [(ostype)] extension  0 get (windows) eq {
                    784:   [(parse) (oxasir-win.sm1) pushfile ] extension
                    785: }{
                    786:   initializePathNamesForOxAsir   %% This should be the last.
                    787: } ifelse
1.12    ! takayama  788:

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>