function outative for some atoms



On 2013-12-04, Litvinov Sergey <slitvinov at gmail.com> wrote:

> Thank you. It seems your solution does not treat functions of E(x) as
> constants (although I think it was ambiguous in my message). How extend
> it to deal with the following?
>
> (%i8) E(f(E(x)));
> (%o8)                             E(f(E(x)))
> (%i9) ''%;
> (%o9)                             E(f(E(x)))  <---- should be f(E(x))

Good point. There are two cases in the predicate in matchdeclare(cc,
 ...), one for expressions which are free of the designated variables,
and one for E expressions. Let's name that predicate P1. So there should
be another case, for expressions which have operator other than E and
for which all arguments are "free enough" of the designated variables.
Something like this maybe:

  matchdeclare (cc, P);
  P(e) := P1(e) or (not atom(e) and op(e) # 'E and every (P, args(e)));
  P1(e) := <stuff which is now the body of lambda in matchdeclare>;

I think it will work, but I didn't try it. 

best

Robert Dodier