Some time ago I wrote some problems with "itensor.lisp".
Namely the problem was that procedure "components(tensor,comps) does not work
So I have, e.g.
(C1) load("itensor.lisp");
Loading itensor.lisp
Finished loading itensor.lisp
(D1) itensor.lisp
(C2) show(f([],[i]))$
i
(D2) f
(C3) (remcomps(f), components(f([],[j]),density([],[])*velocity([],[j])))$
(C4) show(f([],[i]))$
i
(D4) f
(C5)
Instead
i
(D4) density velocity
By chance, I have an access to commercial macsyma here (far outside of my home),
and there everything's fine! Exelent, I would say.
There is now CAS with the same abilities.
I tried to search what is going on in "itensor.lisp". I'm a newbie in lisp and please
excuse me a stupid question. I did not find in textbooks definitions for
ZL-GET, ZL-ASSOC and ML-TYPEP
The procedure is following
DEFMFUN $COMPONENTS (TENSOR COMP)
((LAMBDA (LEN1 LEN2 NAME PROP)
(COND ((OR (NOT (RPOBJ TENSOR))(CDDDR TENSOR))
(merror "Improper 1st arg to COMPONENTS: ~M"
TENSOR
)))
(SETQ LEN1 (LENGTH (CDADR TENSOR)) LEN2 (LENGTH (CDADDR TENSOR)))
(AND (NOT (ATOM COMP))(EQ (CAAR COMP) '$MATRIX)
(COND ((= (f+ LEN1 LEN2) 2)(SETQ NAME (GENSYM))
(SET NAME COMP)(SETQ COMP NAME))
(T
(merror "Needs two indices for COMPONENTS from matrix:~%~M"
TENSOR))))
(COND ((AND (EQ (ML-TYPEP COMP) 'SYMBOL) (> (f+ LEN1 LEN2) 0))
(SETQ PROP 'CARRAYS))
((SAMELISTS (SETQ NAME (APPEND (CDADR TENSOR) (CDADDR TENSOR)))
(CDADR ($INDICES COMP)))
(SETQ PROP 'TEXPRS COMP (CONS COMP NAME)))
(T (merror "Args to COMPONENTS do not have the same free indices")))
(SETQ TENSOR (CAAR TENSOR) LEN1 (CONS LEN1 LEN2))
(COND ((AND (SETQ NAME (ZL-GET TENSOR PROP))
(SETQ LEN2 (ZL-ASSOC LEN1 NAME))) (RPLACD LEN2 COMP))
(T (PUTPROP TENSOR (CONS (CONS LEN1 COMP) NAME) PROP)))
(OR (ZL-GET TENSOR 'INDEXED) ($INDEXED TENSOR))
'$DONE) NIL NIL NIL NIL))
Thank you in advance,
Valerij
--
Dr Valerij V. Pipin
Institute Solar-Terrestrial Physics
Irkutsk, Russia
e-mail:pip@iszf.irk.ru