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

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

Revision 1.3, Thu May 13 05:33:10 2004 UTC (20 years 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.2: +3 -1 lines

(H) is refined by @@@.Hsymbol.

%% $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