Simplification



On 8/2/10, mok-kong shen <mok-kong.shen at t-online.de> wrote:
>
> (1) subst(t,x+y,y+c+x) gives y+x+c, not t+c. On the
> other hand, subst(u,x+y,y+x) does give u.
>
> (2) subst(x,y^2,y^4+y^2) gives y^4+x instead of x^2+x.

subst is strictly a formal replacement; it doesn't try to find
equivalent expressions. subst just looks for arguments of
the expression to be modified which are identical to its
second argument.

In (1), x + y is not an argument of "+" (there are 3 arguments,
x, y, and c).

In (2), y^2 is not an argument of y^4; subst doesn't try to
find (y^2)^2.

I know this doesn't get you closer to a solution, but anyway
that's why subst doesn't have the expected effect.

best

Robert Dodier