%% $OpenXM: OpenXM/src/kan96xx/Doc/callsm1.sm1,v 1.3 2004/05/13 05:33:10 takayama Exp $ %% Library for ox_sm1 to be called from asir cf. xm (callsm1.asir) %% This file is automatically loaded when ox_sm1 is called %% with the name ox_sm1_forAsir. See kxx/oxserver00.c. /whoami { ( SSkan/lib/callsm1.sm1, 1999/11/9. ) message } def /@@@.Dsymbol (d) def /@@@.esymbol (e0) def /@@@.Esymbol (ee0) def /@@@.Hsymbol (hh) def /toAsirVar { /arg1 set [/in-toAsirVar /s /i /ans] pushVariables [ /s arg1 def s isArray { s {toAsirVar} map /ans set} { s (array) dc /s set s { /i set i 64 gt i 91 lt and %% 64 = @, 90 = Z, 96=`, { i 68 eq { %% 68 = D, 32 = space. i 32 add } { i 32 add i } ifelse } { i } ifelse } map {(string) dc} map cat /ans set } ifelse /arg1 ans def ] pop popVariables arg1 } def %%[[(x) (Dx) (E) (T) (Dx0)] toAsirVar ] :: %%(_xy) toAsirVar :: /toAsirForm { /arg1 set [/in-toAsirForm /aa /ans] pushVariables [ /aa arg1 def %% (toAsirForm : ) messagen aa message aa isArray { aa {toAsirForm} map /ans set /toAsirForm.LLL goto } { } ifelse aa isPolynomial { aa (0). eq { /ans (0). def } { /ans [(sm1_dp) aa getvNamesCR toAsirVar aa] def } ifelse /toAsirForm.LLL goto } { } ifelse aa isInteger { aa 0 eq { /ans null def %% You cannot send universalNumber 0 to the current %% asir 1999, 6/10. Try sm1(" 0 "); sm1_pop(); } { /ans aa (universalNumber) dc def } ifelse /toAsirForm.LLL goto } { } ifelse aa isUniversalNumber { aa (0).. eq { /ans null def %% You cannot send universalNumber 0 to the current %% asir } { /ans aa def } ifelse /toAsirForm.LLL goto } { } ifelse /ans aa def /toAsirForm.LLL /arg1 ans def ] pop popVariables arg1 } def /foo {[(x) ring_of_polynomials 0] define_ring (x^2-1). /ff set [(x) ring_of_differential_operators 0] define_ring (x^2-1). /gg set [ff gg 0 1 (123).. [(Hello)]] toAsirForm :: } def