vermaseren / form

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

Check for bad terms in fast notation in get_variables #570

Closed jodavies closed 2 weeks ago

jodavies commented 2 weeks ago

These created numerators of 0. Fixes #567

coveralls commented 2 weeks ago

Coverage Status

coverage: 50.107%. remained the same when pulling 362336df3ebcadcdc21c8fddac0612d468045d76 on jodavies:issue-567 into 8599601cdb49d3e15dd7062eeafa6e43a2e9db68 on vermaseren:master.

tueda commented 2 weeks ago

Should this check (*e < 0) be in poly::argument_to_poly() or poly::get_variables()?

jodavies commented 2 weeks ago

You are right, this check could equally go in get_variables and makes more sense there. I will move it.

jodavies commented 2 weeks ago

While here it would probably be fine, other areas of the code have been cumbersome to debug because you have to determine which of many goto have actually caused a termination. In my opinion it could be beneficial to actually remove this pattern from the code entirely, but that requires some effort also...

vermaseren commented 2 weeks ago

How about giving Terminate a second parameter that indicates which call it was? Then one can change things easily, using grep.

On 8 Nov 2024, at 10:07, jodavies @.***> wrote:

While here it would probably be fine, other areas of the code have been cumbersome to debug because you have to determine which of many goto have actually caused a termination. In my opinion it could be beneficial to actually remove this pattern from the code entirely, but that requires some effort also...

— Reply to this email directly, view it on GitHub https://github.com/vermaseren/form/pull/570#issuecomment-2464185242, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJPCEU344ZMQ7VLOMIODO3Z7R5O7AVCNFSM6AAAAABRIMFKASVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRUGE4DKMRUGI. You are receiving this because you are subscribed to this thread.

jodavies commented 2 weeks ago

When this PR is done https://github.com/vermaseren/form/pull/526 , Terminate is replaced with a macro which prints the file and line information of every terminate call.

But still if you have several goto which land at a Terminate, you can't know which goto caused the crash without stepping through in a debugger (hard if the crash is in a long running script with no useful way to set a breakpoint) or putting print statements at each of the goto.