vermaseren / form

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

LHS "1" accepted by the FORM compiler #304

Open tueda opened 5 years ago

tueda commented 5 years ago

A student wrote code where the LHS is unity:

id 1 = cosb^2 + sinb^2;

which doesn't make any sense to me in FORM, so I think it must be a compile error and FORM should reject it. Or, is there any case where this is meaningful?

vermaseren commented 5 years ago

Typically one of these cases that one never even considers during the development of the program. Should probably give an error message, although: id x^n? = cosb^2+sinb^2; would give the same result when n is zero. The main difference is that the x^n? will match only once and it is totally undefined how many times the 1 matches. In addition there might be confusion whether the id 1 = … requests the coefficient to be one, which cannot be in Form. I guess it does need an error message after all.

Jos

On 9 Jan 2019, at 10:08, Takahiro Ueda notifications@github.com wrote:

A student wrote code where the LHS is unity:

id 1 = cosb^2 + sinb^2; which doesn't make any sense to me in FORM, so I think it must be a compile error and FORM should reject it. Or, is there any case where this is meaningful?

— 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/304, or mute the thread https://github.com/notifications/unsubscribe-auth/AFLxEvV2VQFLa3CBfcCY8qF27t6e-Pfgks5vBbGRgaJpZM4Z3DRD.