vermaseren / form

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

Sign match #380

Closed rharland closed 3 years ago

rharland commented 3 years ago

Hi all, we've noticed an inconsistent behavior when matching symbols or vectors with signs. Running

S a; V p; CF fun;

L expr11 = fun(a); L expr12 = fun(-a); L expr21 = fun(p); L expr22 = fun(-p);

id fun(-a?)=fun(a); id fun(-p?)=fun(p);

print; .end

in FORM-4.2, I get expr11 = fun(a); expr12 = fun(a); expr21 = fun(-p); expr22 = fun(p);

so symbols and vectors are matched differently. In FORM-4.1, I consistently get expr11 = fun(a); expr12 = fun(a); expr21 = fun(p); expr22 = fun(p);

How could I replace all fun(-p) by fun(p), without replacing fun(p) by fun(-p) in FORM-4.2?

Best, Robert

benruijl commented 3 years ago

You can use id fun(-p?vector_) = fun(p);

rharland commented 3 years ago

You can use id fun(-p?vector_) = fun(p);

perfect, thanks!