vermaseren / form

The FORM project for symbolic manipulation of very big expressions
GNU General Public License v3.0
1.14k stars 136 forks source link

Matching symbol power inside function argument #63

Open jodavies opened 8 years ago

jodavies commented 8 years ago

There is a difference in behaviour in pattern matching powers of a symbol, depending whether it is inside a function argument or not. For eg,

Symbol y,z,n;
CFunction f;

Local test = z + z^2 + f(z) + f(z^2);
Identify z^n? = y^n;
Identify f(z^n?) = y^n;

gives

   test =
       + y
       + 2*y^2
       + f(z)
      ;

Is this intended? It seems rather inconsistent.

Thanks, Josh.

benruijl commented 7 years ago

This is surely a bug. Perhaps the argument without the power is in a short-hand notation in a function argument, which causes the match to fail.

S z,n;
CF f;

L F = f(z);
id f(z^n?) = 1;

Print +s;
.end
vermaseren commented 7 years ago

Exactly. That is not easy to repair.

Jos

On 17 mrt. 2017, at 10:52, Ben Ruijl notifications@github.com wrote:

This is surely a bug. Perhaps the argument without the power is in a short-hand notation in a function argument, which causes the match to fail.

S z,n; CF f;

L F = f(z); id f(z^n?) = 1;

Print +s; .end — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vermaseren/form/issues/63#issuecomment-287311930, or mute the thread https://github.com/notifications/unsubscribe-auth/AFLxEvu1DRxrHFU9Cpum5Ws5SIvR7Ztcks5rmlfkgaJpZM4Hnc-v.