vermaseren / form

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

groups of multipliers #382

Open FeelUsM opened 3 years ago

FeelUsM commented 3 years ago

Is there a way to process groups of multipliers like process groups of function arguments? I try to match this but form doesn't:

cfun Id,cx,cy,cz,f;
Symbols a;
L L = f(cx(1)*cx(2)*cx(3)*5);
id f(cx(1)*a?) = 1;
Print;
.end
vermaseren commented 3 years ago

One way to do this is use Factarg: FactArg f; id f(?a,cx(1),?b) = 1;

To undo the factArg on the functions that did not match you can use: Transform f,MulArgs(1,last);

Another way of doing this is Argument f; id cx(1) = 0; EndArgument; id f(0) = 1; This assumes of course that f(0) does not have some meaning already.

and there are many other ways. What is most efficient depends on what else you are doing with f and its argument(s).

I hope this helps you out.

Jos

On 20 Apr 2021, at 20:14, Feel @.***> wrote:

Is there a way to process groups of multipliers like process groups of function arguments? I try to match this but form doesn't:

cfun Id,cx,cy,cz,f; Symbols a; L L = f(cx(1)cx(2)cx(3)5); id f(cx(1)a?) = 1; Print; .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/382, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJPCESQHWVXKZQCEYERM4DTJXAATANCNFSM43IWO3XA.