msolve icon indicating copy to clipboard operation
msolve copied to clipboard

Make trailing commas optional

Open wegank opened this issue 8 months ago • 2 comments

In msolve v0.7.5, both input files

x, y
0
x,
y

and

x, y
0
x,
y,

are accepted and lead to correct results, while both

x, y
0
x
y
x, y
0
x
y,

give you segmentation fault.

By the documentation, only the first input should be accepted; so to fix the non-conformance issue, you have to break the backward compatibility in v0.7.6, right?

Well, why not make the world a better place if, instead, all four entries are accepted?

wegank avatar Apr 03 '25 14:04 wegank

How do you handle polynomials that include line breaks? Or one line, multiple polynomial situations?

ederc avatar Apr 03 '25 15:04 ederc

Good point. If we stick to the specification, such cases are probably to be allowed; In practice, they are not correctly handled, for example in msolve v0.7.5:

x
0
x
+1

Gives a segmentation fault, while

x
0
x, x+1

Gives

[0, [1,
[[[0, 0]]]
]]:

But indeed, if we're heading to fix the multi-line situation, this PR should be closed; I will check if I can solve the above issue in another PR. (EDIT: done in #206.)

wegank avatar Apr 03 '25 15:04 wegank

This PR is superseded by PR206

mohabsafey avatar May 13 '25 08:05 mohabsafey