version 1.26, 2003/11/03 10:24:33 |
version 1.49, 2006/02/02 05:15:45 |
|
|
%%%%%%%%%%% $OpenXM: OpenXM/src/kan96xx/Doc/ox.sm1,v 1.25 2003/07/21 13:36:40 takayama Exp $ |
%%%%%%%%%%% $OpenXM: OpenXM/src/kan96xx/Doc/ox.sm1,v 1.48 2006/02/02 04:16:49 takayama Exp $ |
|
|
/ox.sm1.myname (ox-new.sm1) def |
/ox.sm1.myname (ox-new.sm1) def |
|
|
|
|
[(getenv) (OXSTART100)] extension tag 0 eq not { |
[(getenv) (OXSTART100)] extension tag 0 eq not { |
/oxstart100 [(getenv) (OXSTART100)] extension def |
/oxstart100 [(getenv) (OXSTART100)] extension def |
} { } ifelse |
} { } ifelse |
oxstart100 message |
oxstart100 message-quiet |
|
|
/ox.sm1.loaded 1 def |
/ox.sm1.loaded 1 def |
/oxasir.sm1.loaded 1 def |
/oxasir.sm1.loaded 1 def |
Line 48 ox.version [(Version)] system_variable gt |
|
Line 48 ox.version [(Version)] system_variable gt |
|
/@@@.Xm_noX Xm_noX def |
/@@@.Xm_noX Xm_noX def |
}{ } ifelse |
}{ } ifelse |
/Xm_noX @@@.Xm_noX def |
/Xm_noX @@@.Xm_noX def |
|
/Xm_engineLogToStdout 0 def |
|
|
/oxNoX { |
/oxNoX { |
/Xm_noX 1 def |
/Xm_noX 1 def |
Line 76 ox.version [(Version)] system_variable gt |
|
Line 77 ox.version [(Version)] system_variable gt |
|
/SM_getsp 275 def |
/SM_getsp 275 def |
/SM_dupErrors 276 def |
/SM_dupErrors 276 def |
|
|
|
/SM_pushCMOtag 277 def |
|
/SM_executeFunctionWithOptionalArgument 282 def |
|
|
/SM_control_kill 1024 def |
/SM_control_kill 1024 def |
/SM_control_reset_connection 1030 def |
/SM_control_reset_connection 1030 def |
/SM_control_spawn_server 1027 def |
/SM_control_spawn_server 1027 def |
Line 88 ox.version [(Version)] system_variable gt |
|
Line 92 ox.version [(Version)] system_variable gt |
|
(Example: oxsm1.ccc [1 2 3] oxpushcmo oxsm1.ccc oxpopcmo /ff set ff :: ) |
(Example: oxsm1.ccc [1 2 3] oxpushcmo oxsm1.ccc oxpopcmo /ff set ff :: ) |
( ) |
( ) |
(client ss oxexecutestring(oxsubmit) <<executeString>>, client ss oxexec <<executeFunction>>) |
(client ss oxexecutestring(oxsubmit) <<executeString>>, client ss oxexec <<executeFunction>>) |
|
(client ss oxexecWithOpt ) |
|
|
(Example: oxsm1.ccc (0 1 10 { pop $Hello$ message } for) oxexecutestring ) |
(Example: oxsm1.ccc (0 1 10 { pop $Hello$ message } for) oxexecutestring ) |
(Example: oxsm1.ccc (2).. oxpushcmo oxsm1.ccc (10).. oxpushcmo ) |
(Example: oxsm1.ccc (2).. oxpushcmo oxsm1.ccc (10).. oxpushcmo ) |
Line 96 ox.version [(Version)] system_variable gt |
|
Line 101 ox.version [(Version)] system_variable gt |
|
(client str oxevalname, client str oxsetname, client num oxpops, client oxget) |
(client str oxevalname, client str oxsetname, client num oxpops, client oxget) |
( ) |
( ) |
(client oxmathcap, client oxsetmathcap, oxgenportfile, oxremoveportfile) |
(client oxmathcap, client oxsetmathcap, oxgenportfile, oxremoveportfile) |
|
(client oxpushcmotag) |
( ) |
( ) |
(client oxgetsp --- get stack pointer, client oxgeterrors --- get all errors) |
(client oxgetsp --- get stack pointer, client oxgeterrors --- get all errors) |
|
(client oxclearstack --- clear the stack of the ox server.) |
(cleint oxisData, client oxreset, client oxshutdown) |
(cleint oxisData, client oxreset, client oxshutdown) |
(oxhelp for this message, [(oxWatch) client] extension to start a log.) |
(oxhelp for this message) |
|
([(oxWatch) client] extension to start a log.) |
|
$ ex 1. (ox.sm1) run sm1connectr [(oxWatch) oxsm1.ccc] extension $ |
|
$ oxsm1.ccc ( [(cmoLispLike) 0] extension ) oxsubmit $ |
|
$ oxsm1.ccc ( [(cmoLispLike) 1] extension ) oxsubmit $ |
([(oxSerial)] extension serial-number-of-out-going-ox-packet.) |
([(oxSerial)] extension serial-number-of-out-going-ox-packet.) |
(oxpopcmo1, oxpopcmo2, sm1connectr ox_launch, ox_launch_nox) |
(oxpopcmo1, oxpopcmo2, sm1connectr ox_launch, ox_launch_nox) |
(oxNoX : set an environment to invoke oxlog without xterm and to call oxlog with >& /dev/null) |
(oxNoX : set an environment to invoke oxlog without xterm and to call oxlog with >& /dev/null) |
$ ex 1. (ox.sm1) run oxNoX sm1connectr $ |
$ ex 1. (ox.sm1) run oxNoX sm1connectr $ |
$ ex 2. (ox.sm1) run oxNoX (x^2-1). fctr pmat ; $ |
$ ex 2. (ox.sm1) run oxNoX (x^2-1). fctr pmat ; $ |
|
$ $ |
|
$cf. extension-oxLog $ |
] |
] |
] putUsages |
] putUsages |
|
|
|
[(extension-oxLog) |
|
[ |
|
$Take the log of communication in files.$ |
|
$[(oxLog) client logfile_for_incomming_data logfile_for_outgoing_data] extension $ |
|
$Example:$ |
|
$ [(parse) (ox.sm1) pushfile] extension$ |
|
$ sm1connectr$ |
|
$ (i.t) (w) file /ii set$ |
|
$ (o.t) (w) file /oo set$ |
|
$ [(oxLog) oxsm1.ccc ii oo] extension $ |
|
$ [(oxWatch) oxsm1.ccc ] extension$ |
|
$ oxsm1.ccc 1 oxpushcmo ;$ |
|
$ oxsm1.ccc oxpopcmo ;$ |
|
$ [(oxLogStop) oxsm1.ccc] extension$ |
|
]] putUsages |
|
|
/oxconnect { |
/oxconnect { |
/arg1 set |
/arg1 set |
[(oxCreateClient) arg1 aload pop] extension |
[(oxCreateClient) arg1 aload pop] extension |
Line 124 ox.verbose { oxhelp } { } ifelse |
|
Line 153 ox.verbose { oxhelp } { } ifelse |
|
[(oxReq) arg2 SM_DUMMY_sendcmo arg1] extension pop |
[(oxReq) arg2 SM_DUMMY_sendcmo arg1] extension pop |
} def |
} def |
|
|
|
/oxpushcmotag { |
|
/arg2 set |
|
[(oxReq) arg2 SM_pushCMOtag ] extension pop |
|
} def |
|
|
/oxpopcmo { |
/oxpopcmo { |
/arg1 set |
/arg1 set |
[(oxReq) arg1 SM_popCMO ] extension pop |
[(oxReq) arg1 SM_popCMO ] extension pop |
Line 229 ox.verbose { oxhelp } { } ifelse |
|
Line 263 ox.verbose { oxhelp } { } ifelse |
|
} { } ifelse |
} { } ifelse |
[(oxReq) arg2 SM_executeFunction arg1] extension pop |
[(oxReq) arg2 SM_executeFunction arg1] extension pop |
} def |
} def |
|
/oxexecWithOpt { |
|
/arg1 set |
|
/arg2 set |
|
ox.takelog { ox.log [(oxSerial)] extension ox.mod arg1 put |
|
ox.log [(oxSerial)] extension 1 add ox.mod |
|
(executeFunctionWithOptionalArgument) put |
|
} { } ifelse |
|
[(oxReq) arg2 SM_executeFunctionWithOptionalArgument arg1] extension pop |
|
} def |
|
[(oxexecWithOpt) |
|
[ |
|
$Example: $ |
|
$oxsm1.ccc (/foo { message message message } def) oxsubmit ;$ |
|
$oxsm1.ccc (hello) oxpushcmo oxsm1.ccc 1 oxpushcmo oxsm1.ccc [[(opt) 0]] oxpushcmo ;$ |
|
$oxsm1.ccc (foo) oxexecWithOpt $ |
|
] |
|
] putUsages |
/oxsubmit2 { |
/oxsubmit2 { |
oxexec |
oxexec |
} def |
} def |
Line 299 ox.verbose { oxhelp } { } ifelse |
|
Line 350 ox.verbose { oxhelp } { } ifelse |
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
/ox_launch_nox { |
/ox_launch_nox { |
/@@@.ox_launch_nox 1 def |
Xm_noX /ox_launch_nox.save set |
|
oxNoX |
ox_launch_aux |
ox_launch_aux |
|
/Xm_noX ox_launch_nox.save def |
} def |
} def |
/ox_launch { |
/ox_launch { |
/@@@.ox_launch_nox 0 def |
|
ox_launch_aux |
ox_launch_aux |
} def |
} def |
|
|
Line 311 ox.verbose { oxhelp } { } ifelse |
|
Line 363 ox.verbose { oxhelp } { } ifelse |
|
/arg1 set |
/arg1 set |
[/in-launch_nox /pass /peer /data /control /name /machine |
[/in-launch_nox /pass /peer /data /control /name /machine |
/your-peer /comm /remoteOpenXMbin /remoteServer /myhost |
/your-peer /comm /remoteOpenXMbin /remoteServer /myhost |
/argNumber /aaa |
/argNumber /aaa /myssh |
] pushVariables |
] pushVariables |
[ |
[ |
/aaa arg1 def |
/aaa arg1 def |
Line 321 ox.verbose { oxhelp } { } ifelse |
|
Line 373 ox.verbose { oxhelp } { } ifelse |
|
aaa 1 get ox_launch_localhost /your-peer set |
aaa 1 get ox_launch_localhost /your-peer set |
/LLL.end goto |
/LLL.end goto |
} { |
} { |
/remoteOpenXMbin aaa 1 get def |
/remoteServer aaa 1 get def |
/remoteServer aaa 2 get def |
/name aaa 2 get def |
/name aaa 3 get def |
|
/myhost aaa 4 get def |
|
} ifelse |
} ifelse |
|
|
/pass [(oxGenPass)] extension def |
/myssh [(which) (ssh)] oxshell def |
|
myssh tag 0 eq { |
|
(ssh is not found.) error |
|
} { } ifelse |
|
|
|
[(gethostname)] extension /myhost set |
|
|
|
/pass ox_encrypt_104_genPass def |
/peer [(oxGetPort) myhost] extension def |
/peer [(oxGetPort) myhost] extension def |
/data peer 1 get toString def |
/data peer 1 get toString def |
/control peer 3 get toString def |
/control peer 3 get toString def |
peer message |
peer message |
[(ssh -f ) machine ( -l ) name ( ") |
peer 0 get -1 eq { |
|
(Error in oxGetPort) error |
@@@.ox_launch_nox { |
} { } ifelse |
} { |
[myssh ( -X -f ) machine ( -l ) name ( ) |
remoteOpenXMbin(/oxlog ) |
[ |
( /usr/X11R6/bin/xterm -icon -e ) |
(ox100start ) % it must be on a path of the remote host |
} ifelse |
@@@.quiet { ( -quiet ) } { } ifelse |
|
Xm_noX { ( -nox ) } { } ifelse |
( ) remoteOpenXMbin (/ox ) |
( -oxserver ) remoteServer ( -e ) |
( -reverse -ox ) remoteServer |
( -reverse ) |
( -host ) myhost |
( -host ) myhost |
( -data ) data ( -control ) control ( -pass ) pass |
( -data ) data ( -control ) control pass [1 2] get |
oxpath.null |
] cat |
( ") |
|
] cat /comm set |
] cat /comm set |
(Executing the command : ) messagen comm message message |
(Executing the command : ) messagen comm message |
comm system |
comm execve 0 lt { |
(sleep 5) system-csh |
(Fork exec failed) error |
[(oxCreateClient2) peer 1 pass] extension /your-peer set |
} { } ifelse |
|
% ipmask must be 1 to accept from a global address. |
|
[(oxCreateClient2) peer 1 , pass 0 get] extension /your-peer set |
/LLL.end |
/LLL.end |
/arg1 your-peer def |
/arg1 your-peer def |
] pop |
] pop |
Line 359 ox.verbose { oxhelp } { } ifelse |
|
Line 417 ox.verbose { oxhelp } { } ifelse |
|
} def |
} def |
|
|
[(ox_launch) |
[(ox_launch) |
[( [remote remote-OpenXM-bin remote-ox-server remote-login-name myhostname] ) |
[( [remote-machine remote-ox-server-name remote-login-name] ) |
( ox_launch client ) |
( ox_launch client ) |
$or $ |
$or $ |
$ [(localhost) ox-server-name] ox_launch client$ |
$ [(localhost) ox-server-name] ox_launch client$ |
|
(This command launches ox server via ssh.) |
|
(My hostname is set by the function gethostname.) |
(Example 1: ) |
(Example 1: ) |
$ [(tau.math.kobe-u.ac.jp) (/home/taka/OpenXM/bin) $ |
$ [(orange2-clone) $ |
$ (/home/taka/OpenXM/src/ox_math/ox_math) (taka) (dc4.math.kobe-u.ac.jp) $ |
$ (bin/ox_sm1) (taka)$ |
$ ] ox_launch /@@@.oxmath set $ |
$ ] ox_launch /@@@.oxsm1 set $ |
]] putUsages |
]] putUsages |
|
|
[(ox_launch_nox) |
[(ox_launch_nox) |
[( [remote remote-OpenXM-bin remote-ox-server remote-login-name myhostname] ) |
[( [remote-machine remote-ox-server-name remote-login-name] ) |
( ox_launch_nox client ) |
( ox_launch_nox client ) |
(Example 1: ) |
(Example 1: ) |
$ [(tau.math.kobe-u.ac.jp) (/home/taka/OpenXM/bin) $ |
$ [(tau.math.kobe-u.ac.jp) $ |
$ (/home/taka/OpenXM/src/ox_math/ox_math) (taka) (dc4.math.kobe-u.ac.jp) $ |
$ (bin/ox_math) (taka) $ |
$ ] ox_launch_nox /@@@.oxmath set $ |
$ ] ox_launch_nox /@@@.oxmath set $ |
]] putUsages |
]] putUsages |
|
|
Line 384 ox.verbose { oxhelp } { } ifelse |
|
Line 444 ox.verbose { oxhelp } { } ifelse |
|
/my-peer] pushVariables |
/my-peer] pushVariables |
[ |
[ |
/oxserver arg1 def |
/oxserver arg1 def |
/pass [(oxGenPass)] extension def |
/pass ox_encrypt_104_genPass def |
/peer [(oxGetPort) (localhost)] extension def |
/peer [(oxGetPort) (localhost)] extension def |
/data peer 1 get toString def |
/data peer 1 get toString def |
/control peer 3 get toString def |
/control peer 3 get toString def |
peer message |
peer message |
[oxpath.oxlog.xterm oxpath.ox ( -reverse -ox ) oxserver |
[ |
( -data ) data ( -control ) control ( -pass ) pass |
oxstart100 |
oxpath.null |
@@@.quiet { ( -quiet ) } { } ifelse |
( &)] cat system-csh |
Xm_noX { ( -nox ) } { } ifelse |
[(oxCreateClient2) peer 0 pass] extension /my-peer set |
( -oxserver ) oxserver ( -e ) |
|
( -reverse ) |
|
( -data ) data ( -control ) control pass [1 2] get |
|
] cat execve |
|
[(oxCreateClient2) peer 0 pass 0 get] extension /my-peer set |
%% 0 means connect from only localhost. |
%% 0 means connect from only localhost. |
/arg1 my-peer def |
/arg1 my-peer def |
] pop |
] pop |
Line 453 ox.verbose { oxhelp } { } ifelse |
|
Line 517 ox.verbose { oxhelp } { } ifelse |
|
/sm1StartControl101 { |
/sm1StartControl101 { |
[/in-sm1connectr /pass /peer /data /control ] pushVariables |
[/in-sm1connectr /pass /peer /data /control ] pushVariables |
[ |
[ |
/pass [(oxGenPass)] extension def |
/pass ox_encrypt_104_genPass def |
/peer [(oxGetPort1) (localhost)] extension def |
/peer [(oxGetPort1) (localhost)] extension def |
/data peer 1 get toString def |
/data peer 1 get toString def |
peer message |
peer message |
Line 465 ox.verbose { oxhelp } { } ifelse |
|
Line 529 ox.verbose { oxhelp } { } ifelse |
|
[(oxCreateControl_RFC_101) peer 0 pass] extension /oxsm1.ccc set |
[(oxCreateControl_RFC_101) peer 0 pass] extension /oxsm1.ccc set |
%% 0 means connect from only localhost. |
%% 0 means connect from only localhost. |
/ox.ccc oxsm1.ccc def |
/ox.ccc oxsm1.ccc def |
(The server is binded to the variable oxsm1.ccc) message |
(The server is binded to the variable oxsm1.ccc) message-quiet |
oxsm1.ccc |
oxsm1.ccc |
] pop |
] pop |
popVariables |
popVariables |
Line 483 ox.verbose { oxhelp } { } ifelse |
|
Line 547 ox.verbose { oxhelp } { } ifelse |
|
oxsm1.ccc oxpopcmo /engineID set |
oxsm1.ccc oxpopcmo /engineID set |
[(oxCreateEngine_RFC_101) peer 0 (Empty) engineID] extension |
[(oxCreateEngine_RFC_101) peer 0 (Empty) engineID] extension |
/ox.ddd set |
/ox.ddd set |
(The engine is binded to the variables ox.ddd) message |
(The engine is binded to the variables ox.ddd) message-quiet |
] pop |
] pop |
popVariables |
popVariables |
arg1 |
arg1 |
Line 510 ox.verbose { oxhelp } { } ifelse |
|
Line 574 ox.verbose { oxhelp } { } ifelse |
|
[ |
[ |
/L [(oxGetClientList)] extension def |
/L [(oxGetClientList)] extension def |
(In ox103_reset...) message |
(In ox103_reset...) message |
|
(killall in oxshell...) message [(killall)] oxshell pop |
/n L length def |
/n L length def |
0 1 n 1 sub { |
0 1 n 1 sub { |
/i set |
/i set |
Line 612 ox.verbose { oxhelp } { } ifelse |
|
Line 677 ox.verbose { oxhelp } { } ifelse |
|
[(getServerEnv) (bin/ox_sm1)] extension tag 0 eq { |
[(getServerEnv) (bin/ox_sm1)] extension tag 0 eq { |
(Server bin/ox_sm1 is not found.) error |
(Server bin/ox_sm1 is not found.) error |
}{ } ifelse |
}{ } ifelse |
/pass [(oxGenPass)] extension def |
/pass ox_encrypt_104_genPass def |
/peer [(oxGetPort) (localhost)] extension def |
/peer [(oxGetPort) (localhost)] extension def |
/data peer 1 get toString def |
/data peer 1 get toString def |
/control peer 3 get toString def |
/control peer 3 get toString def |
peer message |
peer message-quiet |
[ |
[ |
oxstart100 |
oxstart100 |
|
@@@.quiet { ( -quiet ) } { } ifelse |
Xm_noX { ( -nox ) } { } ifelse |
Xm_noX { ( -nox ) } { } ifelse |
|
Xm_engineLogToStdout { ( -nox -engineLogToStdout ) } { } ifelse %bug.onlyForsm1 |
( -oxserver bin/ox_sm1 -e ) ( -reverse ) |
( -oxserver bin/ox_sm1 -e ) ( -reverse ) |
( -data ) data ( -control ) control ( -pass ) pass |
( -data ) data ( -control ) control pass [1 2] get |
( )] cat execve |
( )] cat execve |
[(oxCreateClient2) peer 0 pass] extension /oxsm1.ccc set |
[(oxCreateClient2) peer 0 pass 0 get] extension /oxsm1.ccc set |
%% 0 means connect from only localhost. |
%% 0 means connect from only localhost. |
(The server is binded to the variable oxsm1.ccc) message |
(The server is binded to the variable oxsm1.ccc) message-quiet |
/ox.ccc oxsm1.ccc def |
/ox.ccc oxsm1.ccc def |
oxsm1.ccc.init |
oxsm1.ccc.init |
oxsm1.ccc |
oxsm1.ccc |
Line 652 ox.verbose { oxhelp } { } ifelse |
|
Line 719 ox.verbose { oxhelp } { } ifelse |
|
/machine arg1 0 get def |
/machine arg1 0 get def |
/name arg1 1 get def |
/name arg1 1 get def |
|
|
/pass [(oxGenPass)] extension def |
/pass ox_encrypt_104_genPass def |
/peer [(oxGetPort) myhostname-ssh] extension def |
/peer [(oxGetPort) myhostname-ssh] extension def |
/data peer 1 get toString def |
/data peer 1 get toString def |
/control peer 3 get toString def |
/control peer 3 get toString def |
peer message |
peer message-quiet |
[(ssh -f ) machine ( -l ) name ( ") |
[(ssh -f ) machine ( -l ) name ( ") |
oxpath.oxlog.xterm-ssh oxpath.ox-ssh ( -reverse -ox ) oxpath.oxsm1-ssh |
oxpath.oxlog.xterm-ssh oxpath.ox-ssh ( -reverse -ox ) oxpath.oxsm1-ssh |
( -host ) myhostname-ssh |
( -host ) myhostname-ssh |
( -data ) data ( -control ) control ( -pass ) pass |
( -data ) data ( -control ) control pass [1 2] get |
oxpath.null |
oxpath.null |
( ") |
( ") |
] cat /comm set |
] cat /comm set |
(Executing the command : ) messagen comm message message |
(Executing the command : ) messagen comm message message |
comm system |
comm system |
(sleep 5) system-csh |
(sleep 5) system-csh |
[(oxCreateClient2) peer 1 pass] extension /your-peer set |
[(oxCreateClient2) peer 1 pass 0 get] extension /your-peer set |
/arg1 your-peer def |
/arg1 your-peer def |
] pop |
] pop |
popVariables |
popVariables |
Line 706 ox.verbose { oxhelp } { } ifelse |
|
Line 773 ox.verbose { oxhelp } { } ifelse |
|
[(getServerEnv) (bin/ox_ntl)] extension tag 0 eq { |
[(getServerEnv) (bin/ox_ntl)] extension tag 0 eq { |
(Server bin/ox_ntl is not found.) error |
(Server bin/ox_ntl is not found.) error |
}{ } ifelse |
}{ } ifelse |
/pass [(oxGenPass)] extension def |
/pass ox_encrypt_104_genPass def |
/peer [(oxGetPort) (localhost)] extension def |
/peer [(oxGetPort) (localhost)] extension def |
/data peer 1 get toString def |
/data peer 1 get toString def |
/control peer 3 get toString def |
/control peer 3 get toString def |
peer message |
peer message-quiet |
[ |
[ |
oxstart100 |
oxstart100 |
Xm_noX { ( -nox ) } { } ifelse |
Xm_noX { ( -nox ) } { } ifelse |
( -oxserver bin/ox_ntl -e ) ( -reverse ) |
( -oxserver bin/ox_ntl -e ) ( -reverse ) |
( -data ) data ( -control ) control ( -pass ) pass |
( -data ) data ( -control ) control pass [1 2] get |
( )] cat execve |
( )] cat execve |
[(oxCreateClient2) peer 0 pass] extension /oxntl.ccc set |
[(oxCreateClient2) peer 0 pass 0 get] extension /oxntl.ccc set |
%% 0 means connect from only localhost. |
%% 0 means connect from only localhost. |
(The server is binded to the variable oxntl.ccc) message |
(The server is binded to the variable oxntl.ccc) message-quiet |
% oxntl.ccc.init |
% oxntl.ccc.init |
oxntl.ccc |
oxntl.ccc |
] pop |
] pop |
Line 818 oxasir.verbose { |
|
Line 885 oxasir.verbose { |
|
(If you interrupted the computation by typing ctrl-C, type in ) |
(If you interrupted the computation by typing ctrl-C, type in ) |
( oxasir.ccc oxreset ; ) |
( oxasir.ccc oxreset ; ) |
(to interrupt the ox_asir server.) |
(to interrupt the ox_asir server.) |
|
(NOTE: all asir-args must belong to the same ring. cf.oxasir.changeRing. ) |
(Example: oxasir.ccc [(fctr) (x^10-1).] asir ) |
(Example: oxasir.ccc [(fctr) (x^10-1).] asir ) |
( ) |
( ) |
(This function requires plugins cmo, socket and ox_asir server. cf. oxasir) |
(This function requires plugins cmo, socket and ox_asir server. cf. oxasir) |
(See, ftp://endeavor.fujitsu.co.jp/pub/isis/asir on asir) |
(See, http://www.math.kobe-u.ac.jp/Asir on asir) |
] |
] |
] putUsages |
] putUsages |
|
|
Line 870 oxasir.verbose { |
|
Line 938 oxasir.verbose { |
|
%%% Mathematical functions for asir |
%%% Mathematical functions for asir |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
/oxasir.changeRing { |
/oxasir.changeRing { |
|
/oxasir.changeRing.rr.prev 0 def |
|
oxasir.changeRing2 |
|
} def |
|
/oxasir.changeRing2 { |
/arg1 set |
/arg1 set |
[/in-oxasir.changeRing /f /rr] pushVariables |
[/in-oxasir.changeRing2 /f /rr ] pushVariables |
[ |
[ |
/f arg1 def |
/f arg1 def |
f isArray { |
f isArray { |
f {oxasir.changeRing} map |
f {oxasir.changeRing2} map |
}{ |
}{ |
f isPolynomial { |
f isPolynomial { |
f (0). eq { } |
f (0). eq { } |
{ f (ring) dc /rr set [(CurrentRingp) rr] system_variable } ifelse |
{ f (ring) dc /rr set [(CurrentRingp) rr] system_variable |
|
oxasir.changeRing.rr.prev tag 1 eq { } |
|
{ |
|
oxasir.changeRing.rr.prev rr eq { } |
|
{ (asir : arguments must belong to the same ring.) error } ifelse |
|
} ifelse |
|
/oxasir.changeRing.rr.prev rr def |
|
} ifelse |
} { } ifelse |
} { } ifelse |
} ifelse |
} ifelse |
] pop |
] pop |
Line 990 oxasir.verbose { |
|
Line 1069 oxasir.verbose { |
|
|
|
f 0 get isPolynomial { |
f 0 get isPolynomial { |
/r f 0 get (ring) dc def |
/r f 0 get (ring) dc def |
/vvv vvv { r ,, } map def |
/vvv vvv { r __ } map def |
} |
} |
{ |
{ |
[vvv from_records ring_of_polynomials 0] define_ring |
[vvv from_records ring_of_polynomials 0] define_ring |
Line 1032 oxasir.verbose { |
|
Line 1111 oxasir.verbose { |
|
arg1 |
arg1 |
} def |
} def |
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
/polygcd { |
|
/arg1 set |
|
[/pp /f /g /comm /vv] pushVariables |
|
[(CurrentRingp)] pushEnv |
|
[ |
|
/pp arg1 def |
|
oxasir.ccc [ ] eq { |
|
(Starting ox_asir server.) message |
|
ox_asirConnectMethod |
|
} { } ifelse |
|
|
|
pp isArray { |
|
/f pp 0 get def |
|
/g pp 1 get def |
|
pp length 3 eq { |
|
/vv pp 2 get def |
|
vv isArray { /vv vv from_records def } { } ifelse |
|
[vv ring_of_polynomials 0] define_ring |
|
f . /f set |
|
g . /g set |
|
} { } ifelse |
|
}{ (usage: [f g] polygcd) error } ifelse |
|
oxasir.ccc [(gcd) f g] asir /arg1 set |
|
] pop |
|
popEnv |
|
popVariables |
|
arg1 |
|
} def |
|
[(polygcd) |
|
[( [f g] polygcd r ) |
|
( [f g v] polygcd r) |
|
(Example: [(x^2-1) (x-1) [(x)]] polygcd ) |
|
] |
|
] putUsages |
|
/polylcm { |
|
/arg1 set |
|
[/pp /f /g /comm /vv] pushVariables |
|
[(CurrentRingp)] pushEnv |
|
[ |
|
/pp arg1 def |
|
oxasir.ccc [ ] eq { |
|
(Starting ox_asir server.) message |
|
ox_asirConnectMethod |
|
} { } ifelse |
|
|
|
pp isArray { |
|
/f pp 0 get def |
|
/g pp 1 get def |
|
pp length 3 eq { |
|
/vv pp 2 get def |
|
vv isArray { /vv vv from_records def } { } ifelse |
|
[vv ring_of_polynomials 0] define_ring |
|
f . /f set |
|
g . /g set |
|
} { } ifelse |
|
}{ (usage: [f g] polylcm) error } ifelse |
|
oxasir.ccc [(lcm) f g] asir /arg1 set |
|
] pop |
|
popEnv |
|
popVariables |
|
arg1 |
|
} def |
|
[(polylcm) |
|
[( [f g] polylcm r ) |
|
( [f g v] polylcm r) |
|
(Example: [(x^2-1) (x-1) [(x)]] polylcm ) |
|
] |
|
] putUsages |
|
|
|
/asir_red { |
|
/arg1 set |
|
[/pp /f /g /rr /vv] pushVariables |
|
[(CurrentRingp)] pushEnv |
|
[ |
|
/pp arg1 def |
|
oxasir.ccc [ ] eq { |
|
(Starting ox_asir server.) message |
|
ox_asirConnectMethod |
|
} { } ifelse |
|
{ |
|
pp isRational { |
|
/f pp numerator def |
|
/g pp denominator def |
|
[[f g]] reduceByAsir /rr set |
|
}{ } ifelse |
|
exit |
|
|
|
pp isArray { |
|
/vv pp 2 get def |
|
/f pp 0 get 0 get def |
|
/g pp 0 get 1 get def |
|
[[f toString g toString] vv] reduceByAsir /rr set |
|
} { } ifelse |
|
exit |
|
|
|
(asir_red: not implemented) error exit |
|
} loop |
|
|
|
rr 1 get isPolynomial { |
|
rr 0 get rr 1 get div /rr set |
|
}{ |
|
rr 1 get (1).. eq { |
|
rr 0 get /rr set |
|
}{ |
|
rr 0 get rr 1 get div /rr set |
|
} ifelse |
|
} ifelse |
|
|
|
/arg1 rr def |
|
] pop |
|
popEnv |
|
popVariables |
|
arg1 |
|
} def |
|
[(asir_red) |
|
[(Calling the function red of asir. It simplifies a rational function.) |
|
(cf. cancel) |
|
(Example: (x^2). (x). div asir_red ) |
|
]] putUsages |
|
|
|
/asir_fctr { fctr } def |
|
[(asir_fctr) |
|
[(Calling the factorizer of asir.) |
|
]] putUsages |
|
|
|
/asir_primadec { primadec } def |
|
[(asir_primadec) |
|
[(Calling the primadec of asir.) |
|
]] putUsages |
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
[(chattr) 0 /findIntegralRoots] extension pop |
[(chattr) 0 /findIntegralRoots] extension pop |
/findIntegralRoots { |
/findIntegralRoots { |
Line 1384 oxasir.verbose { |
|
Line 1594 oxasir.verbose { |
|
f { toString . } map /f set |
f { toString . } map /f set |
vvv { . } map /vvv set |
vvv { . } map /vvv set |
ddd { . } map /ddd set |
ddd { . } map /ddd set |
/wt wt generic_bfct.aux1 def |
/wt [vvv ddd wt] generic_bfct.aux1 def |
} ifelse |
} ifelse |
[f vvv ddd wt] message |
[f vvv ddd wt] message |
|
|
Line 1405 oxasir.verbose { |
|
Line 1615 oxasir.verbose { |
|
|
|
/generic_bfct.aux1 { |
/generic_bfct.aux1 { |
/arg1 set |
/arg1 set |
[/in-generic_bfct.aux1 /wt /wtx /wtd /n] pushVariables |
[/in-generic_bfct.aux1 /ii /jj /wt /wtx /wtd /vv /dd /n] pushVariables |
[ |
[ |
arg1 /wt set |
arg1 2 get /wt set |
/n [(N)] system_variable def |
arg1 0 get /vv set |
wt { dup tag PolyP eq { toString } { } ifelse } map /wt set |
arg1 1 get /dd set |
wt weightv /wt set |
/wtx [ 0 1 vv length 1 sub { pop (0).. } for ] def |
/wtx wt n carN rest reverse rest reverse def |
/n wt length def |
/wtd wt reverse n carN reverse |
0 2 n 1 sub { |
rest reverse rest reverse def |
/ii set |
wtx wtd join /wt set |
0 1 vv length 1 sub { |
|
/jj set |
|
wt ii get toString dd jj get toString eq { |
|
wtx jj << wt ii 1 add get >> put |
|
} { } ifelse |
|
} for |
|
} for |
|
|
|
wtx /wt set |
wt { dup tag IntegerP eq { (universalNumber) dc } { } ifelse } map /wt set |
wt { dup tag IntegerP eq { (universalNumber) dc } { } ifelse } map /wt set |
wt /arg1 set |
wt /arg1 set |
] pop |
] pop |
popVariables |
popVariables |
arg1 |
arg1 |
} def |
} def |
|
/verbose.wgr 1 def |
|
%[ ff vv ww ] asir.wgb [gb init] |
|
/asir.wgr { |
|
/arg1 set |
|
[/in-asir.gb /ff /vv /ww /vvx /vvd /avv /comm /wvec /i] pushVariables |
|
[ |
|
/ff arg1 0 get def |
|
/vv arg1 1 get def |
|
/ww arg1 2 get def |
|
|
|
oxasir.ccc [ ] eq { |
|
(Starting ox_asir server.) message |
|
ox_asirConnectMethod |
|
} { } ifelse |
|
|
|
vv isArray { |
|
vv from_records /vv set |
|
} { } ifelse |
|
oxasir.ccc [(dp_gr_print) (2)..] asir |
|
[vv to_records pop] /vvx set |
|
vvx { toString (D) 2 1 roll 2 cat_n } map /vvd set |
|
|
|
[ |
|
0 1 vvx length 1 sub { |
|
/i set |
|
vvx i get |
|
0 ww i get sub |
|
vvd i get |
|
ww i get |
|
} for |
|
] /wvec set |
|
|
|
[vv ring_of_differential_operators |
|
[wvec] weight_vector |
|
0] define_ring |
|
|
|
ff { toString . dehomogenize homogenize } map /ff set |
|
vvx { . } map /vvx set %%ex [x,y] |
|
vvd { . } map /vvd set %%ex [Dx,Dy] |
|
vvx vvd join [(h).] join /avv set |
|
|
|
verbose.wgr { |
|
(Asir (-w,w) gb in the Weyl algebra) message |
|
(wvec=) messagen wvec message |
|
(ff=) messagen ff message |
|
(avv=) messagen avv message |
|
} { } ifelse |
|
|
|
[$dp_weyl_set_weight(newvect($ ww length toString $,$ |
|
ww toString $));$ ] cat /comm set |
|
|
|
verbose.wgr { |
|
comm message |
|
} { } ifelse |
|
|
|
oxasir.ccc comm oxsubmit ; |
|
|
|
oxasir.ccc [(dp_weyl_gr_main) ff avv (0).. (1).. (11)..] asir |
|
/arg1 set |
|
] pop |
|
popVariables |
|
arg1 |
|
} def |
|
[(asir.wgr) |
|
[([ ff vv ww ] asir.wgr g) |
|
$It computes the (-ww,ww) Grobner basis of ff in the homogenized Weyl algebra.$ |
|
(Homogenization is automatically done.) |
|
$Example 1: $ |
|
$ [ [(x*Dx+y*Dy-1) (Dx*Dy)] $ |
|
$ (x,y) $ |
|
$ [1 2 ] ] asir.wgr $ |
|
]] putUsages |
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
%%% functions to start ox_asir |
%%% functions to start ox_asir |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
Line 1431 oxasir.verbose { |
|
Line 1722 oxasir.verbose { |
|
(Server bin/ox_sm1 is not found.) error |
(Server bin/ox_sm1 is not found.) error |
}{ } ifelse |
}{ } ifelse |
|
|
/pass [(oxGenPass)] extension def |
/pass ox_encrypt_104_genPass def |
/peer [(oxGetPort) (localhost)] extension def |
/peer [(oxGetPort) (localhost)] extension def |
/data peer 1 get toString def |
/data peer 1 get toString def |
/control peer 3 get toString def |
/control peer 3 get toString def |
peer message |
peer message-quiet |
[ |
[ |
oxstart100 |
oxstart100 |
|
@@@.quiet { ( -quiet ) } { } ifelse |
Xm_noX { ( -nox ) } { } ifelse |
Xm_noX { ( -nox ) } { } ifelse |
|
Xm_engineLogToStdout { ( -nox -engineLogToStdout ) } { } ifelse %bug.onlyForasir |
( -oxserver bin/ox_asir -e ) ( -reverse ) |
( -oxserver bin/ox_asir -e ) ( -reverse ) |
( -data ) data ( -control ) control ( -pass ) pass |
( -data ) data ( -control ) control pass [1 2] get |
( )] cat execve |
( )] cat execve |
[(oxCreateClient2) peer 0 pass] extension /oxasir.ccc set |
[(oxCreateClient2) peer 0 pass 0 get] extension /oxasir.ccc set |
%% 0 means connect from only localhost. |
%% 0 means connect from only localhost. |
oxasir.ccc asir.init |
oxasir.ccc asir.init |
/arg1 oxasir.ccc def |
/arg1 oxasir.ccc def |
Line 1477 oxasir.verbose { |
|
Line 1770 oxasir.verbose { |
|
(Server bin/ox_sm1 is not found.) error |
(Server bin/ox_sm1 is not found.) error |
}{ } ifelse |
}{ } ifelse |
|
|
/pass [(oxGenPass)] extension def |
/pass ox_encrypt_104_genPass def |
/peer [(oxGetPort) (localhost)] extension def |
/peer [(oxGetPort) (localhost)] extension def |
/data peer 1 get toString def |
/data peer 1 get toString def |
/control peer 3 get toString def |
/control peer 3 get toString def |
peer message |
peer message-quiet |
[ |
[ |
oxstart100 |
oxstart100 |
Xm_noX { ( -nox ) } { } ifelse |
Xm_noX { ( -nox ) } { } ifelse |
( -oxserver bin/ox_k0 -e ) ( -reverse ) |
( -oxserver bin/ox_k0 -e ) ( -reverse ) |
( -data ) data ( -control ) control ( -pass ) pass |
( -data ) data ( -control ) control pass [1 2] get |
( )] cat execve |
( )] cat execve |
[(oxCreateClient2) peer 0 pass] extension /oxk0.ccc set |
[(oxCreateClient2) peer 0 pass 0 get] extension /oxk0.ccc set |
%% 0 means connect from only localhost. |
%% 0 means connect from only localhost. |
(The server is binded to the variable oxk0.ccc) message |
(The server is binded to the variable oxk0.ccc) message-quiet |
ox.k0.init |
ox.k0.init |
/arg1 oxk0.ccc def |
/arg1 oxk0.ccc def |
] pop |
] pop |
popVariables |
popVariables |
arg1 |
arg1 |
|
} def |
|
/@@@polymake.k0.ccc [ ] def |
|
|
|
/ox_server_mode { |
|
/:: { } def % do nothing |
|
} def |
|
|
|
%% Encryption methods |
|
/ox_encrypt_104.NONE 0 def |
|
/ox_encrypt_104.FILE 1 def |
|
/ox_encrypt_104.RSA 2 def |
|
/@@@.ox_encrypt_104.method ox_encrypt_104.NONE def |
|
/ox_encrypt_104.1 { |
|
/arg1 set |
|
[/sss /rrr] pushVariables |
|
[ |
|
/sss arg1 def |
|
sss toString /sss set |
|
{ |
|
@@@.ox_encrypt_104.method ox_encrypt_104.NONE eq { |
|
/rrr [sss] def |
|
exit |
|
} { } ifelse |
|
(The encryption method has not yet been implemented.) error |
|
} loop |
|
/arg1 rrr def |
|
] pop |
|
popVariables |
|
arg1 |
|
} def |
|
|
|
%< |
|
% Usages: ox_encrypt_104_genPass |
|
% [[ c-pass d-pass ] [c-pass-encrypted d-pass-encrypted ox-command-str ] ...] |
|
%> |
|
/ox_encrypt_104_genPass { |
|
[/sss /p1 /p2 /e1 /e2 /rrr] pushVariables |
|
[ |
|
/r1 [(oxGenPass)] extension def |
|
/r2 [(oxGenPass)] extension def |
|
r1 ox_encrypt_104.1 /e1 set |
|
r2 ox_encrypt_104.1 /e2 set |
|
{ |
|
@@@.ox_encrypt_104.method ox_encrypt_104.NONE eq { |
|
[( -passControl ) e1 0 get ( -passData ) e2 0 get ( )] cat /sss set |
|
[[r1 r2] [e1 0 get , e2 0 get , sss]] /rrr set |
|
exit |
|
} { } ifelse |
|
(The encryption method has not been implemented.) error |
|
} loop |
|
rrr /arg1 set |
|
] pop |
|
popVariables |
|
arg1 |
|
} def |
|
|
|
[[(lines),[10,-1]], |
|
[(where),[(shell), (length)]], |
|
[(reason_of_error), (invalid argument)]] |
|
/i1 set |
|
%% /translateErrorForCfep.sampleInput set |
|
|
|
[(translateErrorForCfep) |
|
[ |
|
(translate the error packet defined in ox-rfc-103 into series of commands for cfep.) |
|
] |
|
] putUsages |
|
/translateErrorForCfep { |
|
/arg1 set |
|
[/ee /ans /tt /lf] pushVariables |
|
[ |
|
/ee arg1 def |
|
{ |
|
ee etag 257 eq { |
|
ee (body) dc 1 get /ee set |
|
ee length 3 gt { |
|
ee 3 get /ee set |
|
}{ /ee [ ] def } ifelse |
|
}{ } ifelse |
|
ee etag 6 eq not { /ans [ ] def exit } { } ifelse |
|
/ans [ ] def |
|
/lf 12 (string) dc def % line feed. it is not necessary. |
|
|
|
ee (lines) getNode /tt set |
|
tt tag 0 eq { |
|
ee (parse_error_at) getNode /tt set |
|
} { } ifelse |
|
tt isArray { |
|
tt length 0 gt { |
|
ans |
|
[(gotoLine, ) tt 0 get toString nl] join /ans set |
|
}{ } ifelse |
|
} { } ifelse |
|
tt isInteger { |
|
[(gotoLine, ) tt toString nl] join /ans set |
|
} { } ifelse |
|
|
|
ee (where) getNode /tt set |
|
tt isArray { |
|
tt length 0 gt { |
|
ans |
|
[(findAndSelect, ) tt 0 get (string) dc nl] join /ans set |
|
}{ } ifelse |
|
} { } ifelse |
|
|
|
ee (reason_of_error) getNode /tt set |
|
tt tag 0 eq { |
|
ee (reason_of_parse_error) getNode /tt set |
|
} { } ifelse |
|
tt tag 0 eq not { |
|
ans [(printErrorMessage, ) tt (string) dc nl] join /ans set |
|
%% translation and encoding is necessary. |
|
}{ } ifelse |
|
|
|
exit |
|
} loop |
|
ans cat /arg1 set |
|
] pop |
|
popVariables |
|
arg1 |
|
} def |
|
|
|
/oxclearstack { |
|
/arg1 set |
|
[/cl /n] pushVariables |
|
[ |
|
/cl arg1 def |
|
cl oxgetsp /n set |
|
n tag 0 eq { /n 0 def } { } ifelse |
|
n tag 15 eq { n (integer) dc /n set } { } ifelse |
|
cl n oxpops pop |
|
] pop |
|
popVariables |
} def |
} def |