Closed vsht closed 4 years ago
It is mentioned in the Form course (and possibly also the manual) that the only safe way to do this is f(p1?!{p2},p2?!{p1}) because the order in which Form does this is noy specified and can change between versions.
Jos
On 15 Nov 2019, at 19:18, Vladyslav Shtabovenko notifications@github.com wrote:
Hi,
suppose that I want to have an id statement that works only when the arguments are distinct, e.g. f(p1,p2) should become g(p1,p2), but f(p1,p1) must remain as it is. The following code works as expected:
V p1,p2,q1,q2; CF f,g; L ex = f(p1,p1); id f(q1?,q2?!{q1?}) = g(q1,q2); .sort print; .end However, if I apply the set check to the first argument instead of the second one, the restriction doen't work anymore and I obtain g(p1,p1):
V p1,p2,q1,q2; CF f,g; L ex = f(p1,p1); id f(q1?!{q2?},q2?) = g(q1,q2); .sort print; .end I understand that this is probably due to the way how FORM orders suitable matches, but I'm somewhat worried that if f would be a symmetric or an antisymmetric function, it might not be possible to guess which pattern FORM chooses first.
Perhaps there is also a safer way to achieve what I'm after.
Cheers, Vladyslav
— 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/333?email_source=notifications&email_token=ABJPCERJMZID25LMSOKZ33LQT3RXRA5CNFSM4JN6Q4LKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HZVY4NQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJPCEQEGG343BFA46UQ223QT3RXRANCNFSM4JN6Q4LA.
Thanks a lot for the very fast reply!
Hi,
suppose that I want to have an id statement that works only when the arguments are distinct, e.g. f(p1,p2) should become g(p1,p2), but f(p1,p1) must remain as it is. The following code works as expected:
However, if I apply the set check to the first argument instead of the second one, the restriction doen't work anymore and I obtain g(p1,p1):
I understand that this is probably due to the way how FORM orders suitable matches, but I'm somewhat worried that if f would be a symmetric or an antisymmetric function, it might not be possible to guess which pattern FORM chooses first.
Perhaps there is also a safer way to achieve what I'm after.
Cheers, Vladyslav