|
From: Andrei Z. <zo...@ui...> - 2002-08-13 16:08:15
|
Hi Serge,
>
> note that this problem might be unsolvable because you may want to
> substitute "t2*t4+1" and there is probably no way to algorithmically
> find whether this expression exists as a mathematical subexpression.
>
Maple:
algsubs(t2*t4=t5,S1+t1*t2*t3*t4+S2);
==> S1 + t1 t3 t5 + S2
Mathematica:
In[1]:= S1+t1 t2 t3 t4 +S2 /.{t2 t4 -> t5}
Out[1]= S1+S2+t1 t3 t5
EMACS:
(+ 1 2 3 4)
==> 10
The problem with Yacas is that arithmetic operators are considered
binary here, while other CASes and LISP allow for multiple arguments.
These CASes place all factors at the same level and it is not that hard
to remove a number of terms in a product and insert others.
Maple:
op(a*b*c)
==> a,b,c
Mathematica:
In[3]:=a b c//FullForm
Out[3]//FullForm=Times[a,b,c]
So, how can I do this sort of substitution in Yacas?
--
Andrei Zorine
|