All +
All -
maxima-to-ir
- atom
- $%i
- $%pi
- (num (symbol "math.pi") 0)
- $%e
- (num (symbol "math.e") 0)
- (stringp form)
- DEFAULT
- (consp form)
- (consp (car form))
- ((atom ~) ~)
- + -
(atom (caar form))
- ((mtimes ~) exp1 exp2 ~)
- (op * simp-exp1 simp-exp2 ~)
- ((mplus ~) exp1 exp2 ~)
- (op + simp-exp1 simp-exp2 ~)
- ((mexpt ~) exp1 exp2)
- (funcall (symbol "pow") simp-exp1 simp-exp2)
- ((mfactorial ~) exp1)
- (funcall math.factorial simp-exp1)
- ((rat ~) exp1 exp2)
- (op / simp-exp1 simp-exp2)
- ((mlist ~) exp1 exp2 ~)
- (struct-list simp-exp1 simp-exp2 ~)
- ((msetq ~) exp1 exp2)
- (assign simp-exp1 simp-exp2)
- ((mdefine simp) ((atom) atom1 atom2 ((mlist) atom3)) exp1)
- (func-def (symbol atom) ((symbol atom1) (symbol atom2) (symbol *atom3)) (body-indented (simp-exp1) ~))
- ((mprog/mprogn) exp1 exp2 ~)
- Creation of a function :-
(func-def (symbol "random") () (body-indented ))
(funcall (symbol "random") )
- ((%array ~) name num1 num2 ~)
- (asign (SYMBOL )
(OP *
(STRUCT-LIST
(OP *
(STRUCT-LIST ...~... (SYMBOL "None"))
num2))
num1))
- ((%array ~) name type num1 num2 ~)
- (assign (SYMBOL )
(OP *
(STRUCT-LIST
(OP *
(STRUCT-LIST ...~... (SYMBOL "None"))
num2))
num1))
- ((%array ~) ((mlist ~) name1 name2 ~) num1 num2 ~)
-
- (body
(assign (SYMBOL )
(OP *
(STRUCT-LIST
(OP *
(STRUCT-LIST
(OP * ..~.. (STRUCT-LIST (SYMBOL "None")) 3))
2))
1))
(assign (SYMBOL )
(OP *
(STRUCT-LIST
(OP *
(STRUCT-LIST
(OP * ..~.. (STRUCT-LIST (SYMBOL "None")) 3))
2))
1))
....
(assign (SYMBOL )
(OP *
(STRUCT-LIST
(OP *
(STRUCT-LIST
(OP * ..~.. (STRUCT-LIST (SYMBOL "None")) 3))
2))
1)))
- (assign (SYMBOL "REF")
- (OP *
- (STRUCT-LIST
- (OP *
- (STRUCT-LIST
- (OP * (STRUCT-LIST (SYMBOL "None")) 3))
- 2))
- 1))
- (assign (SYMBOL "SVSV")
- (OP *
- (STRUCT-LIST
- (OP *
- (STRUCT-LIST
- (OP * (STRUCT-LIST (SYMBOL "None")) 3))
- 2))
- 1))
- (assign (SYMBOL "SDVSDV")
- (OP *
- (STRUCT-LIST
- (OP *
- (STRUCT-LIST
- (OP * (STRUCT-LIST (SYMBOL "None")) 3))
- 2))
- 1)))
- ((array-name simp array) index1 index2 ~_
- (element-array (element-array (element-array (symbol ) index-1) index-2) .. index-n)
- DEFAULT CASE
- (funcall (symbol <(caar form)>) simp-exp1 simp-exp2 ~)
- ((mcond) cond1 exp1 cond2 exp2 ... condn expn t expnn)
- (conditional cond1 exp1 (conditional cond2 exp2 expnn))
- ((mnot ~) exp)
- (funcall (symbol "not") simp-exp)
- ((mand ~) exp-1 exp-2 ~)
- (boolop and simp-exp-1 simp-exp-2)
- ((mor ~) exp-1 exp-2 ~)
- (boolop or simp-exp-1 simp-exp-2)
- ((mgreaterp ~) exp exp)
- ((mequal ~) exp exp)
- ((mnotequal ~) exp exp)
- ((mlessp ~) exp exp)
- ((mgeqp ~) exp exp)
- ((mleqp ~) exp exp)
- + -
((lambda ~) ((mlist) s1 s2 ~) exp-1)
- (lambda (simp-s1 simp-s2) simp-exp-1)
- ((lambda ~) ((mlist) s1 s2 ~) exp-1 exp-2 ~)
- (BODY (FUNC-DEF (SYMBOL "func19167") NIL
(BODY-INDENTED simp-exp1
simp-exp2
(FUNCALL (SYMBOL "return")
(OP / (SYMBOL "a") (SYMBOL "b")))))
(LAMBDA () (FUNCALL (SYMBOL "func19167")))
- + -
((MDOIN SIMP) $I ((MLIST SIMP)) NIL NIL NIL NIL (($PRINT SIMP) $I)
- (for-list (symbol "i") (struct-list) (body-indented exps)
- ((MDO SIMP) $I 10 5 NIL NIL ((MLEQP SIMP) ((MTIMES SIMP) 5 $I) 30)
((MPROGN SIMP) (($PRINT SIMP) $I)
(($PRINT SIMP) ((MTIMES SIMP) 5 $I))))
- (BODY (BODY (ASSIGN (SYMBOL "i") (NUM 10 0))
(WHILE-LOOP
(FUNCALL (SYMBOL "not")
(COMP-OP <= (OP * (NUM 5 0) (SYMBOL "i"))
(NUM 30 0)))
(BODY-INDENTED (FUNCALL (SYMBOL "print") (SYMBOL "i"))
(FUNCALL (SYMBOL "print")
(OP * (NUM 5 0) (SYMBOL "i")))
(ASSIGN (SYMBOL "i") (OP + (SYMBOL "i") (NUM 5 0)))))
(DEL (SYMBOL "i"))))