algebraic-solving / msolve

Library for Polynomial System Solving through Algebraic Methods
https://msolve.lip6.fr
GNU General Public License v2.0
90 stars 22 forks source link

Fails on simple overdetermined systems #72

Closed remyoudompheng closed 1 year ago

remyoudompheng commented 1 year ago

msolve (both 0.5.0 and latest commit ddfb9e18e831) says that the following system has no solution (it has a solution 92, since the equations have a nontrivial GCD)

x
251
-68*x^2+34*x-107,
104*x^2+122*x+72

This system was obtained by minifying an issue happening when trying to solve an exercise on larger systems of multivariate quadratic equations generated to have known solutions.

See below various examples of pseudo-random systems with known solutions where msolve fails:

mq_2_1.txt => known solution 92 mq_5_2.txt => known solution (158, 196) mq_8_3.txt => solution (217, 70, 166) mq_20_5.txt => solution (200, 5, 86, 211, 203) mq_38_10.txt => solution (12, 59, 44, 208, 12, 210, 212, 116, 106, 148) mq_41_18.txt => solution (10, 66, 180, 181, 165, 74, 94, 139, 29, 170, 141, 11, 111, 19, 47, 34, 209, 189) mq_44_21.txt => known solution, non-unique (0, 0, 0, 170, 117, 195, 29, 32, 172, 99, 207, 55, 171, 182, 113, 208, 104, 90, 137, 175, 22)

Also, removing a few random equations from mq_8_3 makes msolve crash:

x0,x1,x2
251
54*x0^2-106*x0*x1+47*x1^2-92*x0*x2+35*x1*x2-118*x2^2-125*x0-73*x1+14*x2+104,
35*x0^2-35*x0*x1-28*x1^2+121*x0*x2+122*x1*x2-90*x2^2+110*x0+58*x1-85*x2-8,
71*x0^2-x0*x1-41*x1^2+82*x0*x2+90*x1*x2-87*x2^2-100*x0+67*x1+36*x2+122,
21*x0^2-71*x0*x1+55*x0*x2+19*x1*x2-81*x2^2+89*x0+67*x1-12*x2+17

zsh: segmentation fault (core dumped)  msolve -f zzz

Same with mq_20_5:

x0,x1,x2,x3,x4
251
-91*x0^2-21*x0*x1+86*x1^2-57*x0*x2+87*x1*x2+5*x2^2-93*x0*x3-98*x1*x3-75*x2*x3+44*x3^2-68*x0*x4-34*x1*x4-111*x2*x4-76*x3*x4+88*x4^2-101*x0+90*x1-26*x2+101*x3-111*x4+75,
12*x0^2+122*x0*x1-57*x1^2-96*x0*x2+125*x1*x2+94*x2^2+37*x0*x3+100*x1*x3+20*x2*x3+119*x3^2+73*x0*x4+87*x1*x4-79*x2*x4-52*x3*x4+11*x4^2-83*x0-52*x1-34*x2+55*x3+39*x4-37,
121*x0^2-33*x0*x1-11*x1^2+120*x0*x2-29*x1*x2-83*x2^2+8*x0*x3+109*x1*x3+9*x2*x3+28*x3^2+19*x0*x4+59*x1*x4+104*x2*x4-33*x3*x4-25*x4^2+23*x0+16*x1-69*x2-77*x3+49*x4+45, 
28*x0^2-102*x0*x1-86*x1^2-34*x0*x2-23*x1*x2+37*x2^2+99*x0*x3-121*x1*x3+31*x2*x3+22*x3^2-40*x0*x4+37*x1*x4-52*x2*x4+29*x3*x4-28*x4^2-47*x0+13*x1-91*x2-23*x3-52*x4-87, 
60*x0^2-108*x0*x1-25*x1^2-7*x0*x2+89*x1*x2-58*x2^2+18*x0*x3+32*x1*x3-113*x2*x3-55*x3^2+111*x0*x4-63*x1*x4-35*x2*x4+50*x3*x4+95*x4^2-57*x0+113*x1-15*x2+77*x3-49*x4-89,   
-120*x0^2-106*x0*x1+74*x1^2-33*x0*x2+103*x1*x2+87*x2^2-86*x0*x3-69*x1*x3+39*x2*x3-29*x3^2+86*x0*x4-63*x1*x4+103*x2*x4+85*x3*x4+70*x4^2+82*x0-68*x1+36*x2-15*x3+x4-41