$SPAD/src/input algaggr.input

Ralf Hemmecke

December 3, 2016

Abstract

When entering a function on the command line you will most probably get Expression(Integer) as the result type.

This is a path to convert an Expression(Integer) to InputForm and back.

Contents

2

— * —

)set break resume
)spool i2e.output
)set message test on
)set message auto off
)clear all
--S 1 of 6
ex:=sin(cos(x+2)+3)+exp(x+2)+sqrt(x)
--R
--R                               +-+     x + 2
--R   (1)  sin(cos(x + 2) + 3) + \|x  + %e
--R                                                    Type: Expression(Integer)
--E 1
--S 2 of 6
exi:=ex::InputForm
--R
--R   (2)  (+ (sin (+ (cos (+ x 2)) 3)) (+ (** x (/ 1 2)) (exp (+ x 2))))
--R                                                              Type: InputForm
--E 2
--S 3 of 6
d1:=destruct exi
--R
--R   (3)  [+,(sin (+ (cos (+ x 2)) 3)),(+ (** x (/ 1 2)) (exp (+ x 2)))]
--R                                                        Type: List(InputForm)
--E 3
--S 4 of 6
l2:=[first d1, first rest d1, first rest destruct first rest rest d1]
--R
--R   (4)  [+,(sin (+ (cos (+ x 2)) 3)),(** x (/ 1 2))]
--R                                                        Type: List(InputForm)
--E 4
--S 5 of 6
inf:=convert l2
--R
--R   (5)  (+ (sin (+ (cos (+ x 2)) 3)) (** x (/ 1 2)))
--R                                                              Type: InputForm
--E 5
--S 6 of 6
interpret inf
--R
--R                               +-+
--R   (6)  sin(cos(x + 2) + 3) + \|x

--R                                                    Type: Expression(Integer)
--E 6
)spool
)lisp (bye)

———-

References^{[1] nothing}

5