msolve icon indicating copy to clipboard operation
msolve copied to clipboard

parsing error when repeating monomial

Open coproc opened this issue 9 months ago • 1 comments

With a file parse_error.txt like this:

x,y 0 2x+3y-x

the command

msolve -g 2 -f parse_error.txt

gives the following output:

#Reduced Groebner basis data #--- #field characteristic: 0 #variable order: x, y #monomial order: graded reverse lexicographical #length of basis: 1 element #--- [x-3*y ]:

But the expected output would be: [x + 3*y]

The problem seems to be that when the same monomial is repeated within a polynomial, the previous monomial is overwritten - instead of adding the coefficients.

Ok, this problem only occurs if manually manipulating the polynomials. This problem will not occur with polynomials expanded by a CAS.

coproc avatar Apr 01 '25 21:04 coproc

I do not think that the design of the parser has (or will soon have) any support for this kind of simplifications, or more generally any algebraic manipulations, of the input polynomials. This is implicit in the msolve tutorial which states that the polynomials should be in "expanded form": I added an explicit remark to make it clear the polynomials are expected to be expanded and also without repeated monomials.

vneiger avatar Apr 01 '25 21:04 vneiger