Skip to content

Add option to return full Groebner basis under elimination order over QQ - #374

Open
wegank wants to merge 2 commits into
algebraic-solving:masterfrom
wegank:elim-full-basis
Open

wegank wants to merge 2 commits into
algebraic-solving:masterfrom
wegank:elim-full-basis

Conversation

@wegank

@wegank wegank commented Oct 1, 2026

Copy link
Copy Markdown
Member

Closes #339.

Over the rationals, -e k used to return only the basis of the elimination ideal: the multi-modular lifting kept only the elements of the modular Gröbner basis free of the eliminated variables. Algorithms such as Suzuki–Sato's for comprehensive Gröbner systems need the full basis with respect to the elimination order.

This PR adds a --elim-full-basis command line option. Combined with -e k, it returns the full reduced Gröbner basis for the elimination order over QQ. Without the flag, behaviour is unchanged.

./msolve -e 1 --elim-full-basis -g 2 -f input_files/elim-qq.ms

returns the same 7 polynomials as the characteristic-p run in the tutorial, ending with t*z-1.

Changes

  • Lifting (src/msolve/lifting-gb.c, src/msolve/duplicate.c): two helpers, lift_elim_ideal_only and lifted_nvars, decide which elements are lifted and how many variables the stored leading monomials have. They are used in the learning phase, the application phase (filtering and bad-prime staircase check), the lifting setup and the buffer duplication. A new elim_full_basis field in md_t enables the full-basis mode.
  • CLI and output (src/msolve/main.c, src/msolve/msolve-data.h): new long-only option with help text. With the flag, no variables are dropped from the output (gens->elim = 0), and the header prints the elimination monomial order like the characteristic-p output.
  • Robustness: in the application phase, bs == NULL is now checked before bs is dereferenced. A prime whose basis has fewer elements than expected is rejected before its element lengths are read.
  • Docs: tutorial (the passage quoted in [Feature request] Full basis under elimination order in characteristic 0 #339, plus an example) and README.md.
  • Test: test/diff/diff_elim-full-qq.sh runs a parametric system with rational coefficients with -e 1/2, -t 1/2 and -l 2/44.

The Julia/library entry point export_groebner_qq is untouched so its ABI stays stable. Exposing the option there can be done in a follow-up.

Testing

  • make check: 69/69 pass.
  • Compared against Singular (via Sage, block order dp(k),dp(n-k)) on 14 random and parametric systems, with coefficients up to 544 bits, for all four -t/-l combinations. All results agree, up to normalisation, since msolve prints with denominators cleared. The default mode still returns exactly the elimination-ideal part.

AI disclosure

This change was written with the assistance of generative AI (Claude Code, Claude Opus 5.5), reviewed and tested by me.

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com

🤖 Generated with Claude Code

@wegank
wegank marked this pull request as draft October 1, 2026 20:23
@mohabsafey

Copy link
Copy Markdown
Contributor

Hi, I have an on-going PR under preparation that fixes the issue you probably met with [msolve CI / build-fixed-seed (macos-latest, bash). It should be ready for review end of this week at the latest.
Note also my last PR on the lifting of grevlex GBs over QQ which was recently merged.
Many thanks for handling this!

@wegank
wegank marked this pull request as ready for review November 4, 2026 15:20
@wegank
wegank force-pushed the elim-full-basis branch 3 times, most recently from 325fbc3 to b87f2d7 Compare November 12, 2026 19:14
@wegank

wegank commented Nov 19, 2026

Copy link
Copy Markdown
Member Author

I stress-tested --elim-full-basis against Maple 2026.1. Every case that finished agrees with Maple.

Method. For each input and block size k, I ran msolve twice:

  • -e k -g 2 --elim-full-basis
  • -e k -g 2 (default output)

I compared both with Groebner:-Basis(F, lexdeg([x1..xk], [x(k+1)..xn])), up to scaling each element to leading coefficient 1, and checked three things:

  1. the full basis equals Maple's reduced basis;
  2. the full basis is sorted by increasing leading monomials;
  3. the default output still equals the elements of Maple's basis that are free of the eliminated variables, so there is no regression.

A deliberately corrupted basis was flagged, so the checker does catch differences.

Results

Test set Cases Agree with Maple Timed out
Random systems 500 499 1 (Maple, 120 s)
Char-0 files in input_files/, all k = 1..n-1 80 75 5 (msolve, 300 s)
  • Random systems: 2–5 variables, every k. The mix covers zero-dimensional, positive-dimensional, overdetermined/unit-ideal, sparse, implicitization and non-radical systems (squared generators). Coefficients range from small integers to 256-bit integers and rationals with 80-bit numerators and denominators. Runs used -t 1/-t 4 and -l 2/-l 44. Among the passing cases, 94 had a zero elimination ideal and 46 were the unit ideal. Outputs reached about 2.3 MB, so the lifting used many primes.
  • Benchmark files: these include cyclic5, kat7, eco6, henrion5, sum-squares-system and the existing lifting/elimination regression inputs. Full bases have up to 44 elements.

Timeouts. Of the five msolve timeouts:

  • Three also time out without --elim-full-basis, so the inputs are just hard for those k: cp-d3-n4-p2 with k=3, henrion5 with k=4, and univariate-assign-left with k=3.

  • cp-d3-n4-p2 with k=2 takes 155 s without the flag, and more than 300 s with it.

  • reals-dim0-chgvar with k=3 takes 2 s without the flag, and more than 300 s with it. A similar timed-out run (henrion5, k=4) was still adding primes after a minute, which suggests large coefficients rather than a hang, but I haven't confirmed that for this case. To reproduce:

    ./msolve -f input_files/reals-dim0-chgvar.ms -e 3 -g 2 --elim-full-basis
    

    The full basis may simply be much larger than the elimination ideal here, but it might be worth a look.

I didn't find any wrong results.

The testing harness was written and run with the help of Claude Code (generative AI); I reviewed the results.

@wegank

wegank commented Nov 19, 2026 •

Copy link
Copy Markdown
Member Author

I re-ran the cases that timed out in my earlier stress test on a server: 2× Xeon Gold 6246R, 1.5 TB RAM. Each case ran with a 6 h limit, msolve at 03fe820 used -t 8, and Maple 2026.1 used its default settings. All six cases have now finished. Four agree with Maple on the full basis. The other two finished in only one solver within the time limit, and partial checks on them pass (see below). For the four fully compared cases I checked that:

  • the --elim-full-basis output equals Groebner:-Basis(F, lexdeg(...));
  • that output is sorted by increasing leading monomials;
  • the default -e output equals the elements of Maple's basis that are free of the eliminated variables.

Results

Case n k Basis size (full / elim) msolve -e k msolve -e k --elim-full-basis Maple Agree?
rand128 (random, below) 5 3 9 / 6 2.0 s (15.2 s) 2.6 s (18.8 s) 17.7 s (19.6 s) ✅
cp-d3-n4-p2 4 2 17 / 15 13.2 s (102.9 s) 12.3 s (95.4 s) 50.2 s (53.5 s) ✅
henrion5-qq 5 4 5 / 1 9.7 s (74.7 s) 2 min 01 s (964 s) 1 min 51 s (118 s) ✅
univariate-assign-left 4 3 4 / 1 35.5 s (217 s) 4 min 09 s (1864 s) 3.6 s (3.6 s) ✅

Times are wall clock, with CPU time in parentheses. msolve's peak memory was 0.01–0.8 GB and Maple's about 0.13 GB. The msolve output files are:

Case -e k --elim-full-basis
rand128 1.1 MB 1.6 MB
cp-d3-n4-p2 5.7 MB 6.5 MB
henrion5-qq 21 KB 2.2 MB
univariate-assign-left 2.5 KB 144 KB

Observations

  • Wrong results: none.
  • Earlier timeouts: these came from my laptop, which was running six cases in parallel. On the server, cp-d3-n4-p2 (k=2) and henrion5 (k=4) finish in seconds to minutes.
  • Cost of the full basis: when the elimination ideal is small, the full basis can cost much more. For henrion5 and univariate-assign-left, it takes 7–12× the time of the default mode, and the output is 60–100× larger. That's expected: the eliminated part of the basis has much bigger coefficients.
  • univariate-assign-left, k=3: Maple takes 3.6 s, while msolve takes 35 s even without --elim-full-basis. So the slowdown isn't caused by this PR, but it might be worth a separate look.
  • cp-d3-n4-p2, k=3: this is the largest performance gap. msolve takes about 14× longer than Maple without the flag, and with --elim-full-basis it doesn't finish in 6 h (details below).

Cases finished in only one solver

These two finished in only one solver within the 6 h limit, so I couldn't compare full bases over ℚ. I ran partial checks instead.

Case n k msolve -e k msolve -e k --elim-full-basis Maple Partial check
cp-d3-n4-p2 4 3 2 h 31 min (55 GB) timeout 6 h (55 GB, no output) 10 min 46 s (0.2 GB) ✅ msolve's -e 3 output equals the elimination part of Maple's basis
reals-dim0-chgvar 4 3 0.6 s 24 s timeout 6 h ✅ msolve's full basis equals Maple's basis mod 3 primes
  • cp-d3-n4-p2, k=3: Maple's full basis is in shape position: x4^108, x3 - …, x2 - …, x1 - …. The elimination ideal is a single degree-108 polynomial in x4 with coefficients of up to 1374 bits, and msolve's -e 3 output matches it. msolve's full basis couldn't be checked because the run produced no output.

  • reals-dim0-chgvar, k=3: msolve's full basis is [x4^66, x3 - …, x2 - …, x1 - …]. Its coefficients reach about 24 500 bits in the eliminated part, versus 450 bits for the x4 polynomial, which explains why Maple over ℚ doesn't finish. I checked that:

    • the basis is sorted by increasing leading monomials;
    • the default -e 3 output equals its elements that are free of the eliminated variables;
    • reduced modulo 2147483647, 1000000007 and 300000007, it equals Maple's Groebner:-Basis(F, lexdeg([x1,x2,x3],[x4]), characteristic=p). Maple computes each of those in 0.2 s.

    Agreement modulo primes isn't a proof over ℚ, but it's strong evidence.

To reproduce

msolve -f <case>.ms -o out.res -e <k> -g 2 -t 8 [--elim-full-basis]

In Maple: Groebner:-Basis(F, lexdeg([first k vars], [remaining vars])).

Inputs

These are the exact files I tested. The input_files/ ones are the same polynomials as in the repository, expanded by Maple.

rand128.ms — random non-radical system, 5 variables, big integer coefficients
x0,x1,x2,x3,x4
0
99390385903692220199902533550533412849*x0^2-127959467272517949038012941475293446204*x0*x1+2040153260229289578734490594816242594679053443523585854486412119772241197558692612676804211636670*x0*x2+1910436904776340579124092775006090421143016162684723448719826009372431298725036297435546585097930*x0*x3-3519642711651588375838622056649376474865965221035070684396*x0*x4+41185133541317535421584690033394016196*x1^2-1313290626450483769204155921477422170708324925914305105453344559241040379429607730768910228630660*x1*x2-1229789412578673442648690354955011995329646284805421471576988117919464106305538711955401661420140*x1*x3+2265669874795239361504117783584305404769585994799362426408*x1*x4+10469386166931006570290612362825466243703171202622548186863968414758275717818073660508784739710076569408251791758414067738687733853562186665556758005299025*x2^2+19607450178926279977482554277955918282685078591183644523284052022452536675705226346375178311711319544853529585251790347161324539548306808080743140758660950*x2*x3-36123265282298774655790424945468478100362413252236632758420278231112571824868797938512173748033975269236148953968340*x2*x4+9180387856296220868988685213237739427556531806670466385101230291649896446456656263059799298783113549606202238124781010028689507429657542935088948375250025*x3^2-33826487676996115789844687331274244183488475640075296102008389973544099222040596822372637642724065269612500103600860*x3*x4+31159665759034830066142136387270312695366746405018191970392460520764447967396*x4^2+1440755604029035667738262059031174930232466948279102451804*x0-927445435920183670889487802102772307452773846083648741192*x1+14786954573260506441794583652409635370508408524437276862440389594078376862826301186927720226561156805594427284354660*x2+13846775277477553190693539870240632168252540126663734132105295668725865979165817642566143890736200886931012340816140*x3-25510238816788809682025258358196298125938569406962058010171697977283448037608*x4+5221271382708151562139112609744945246705229873756156731009419176957902884996,
107006237888628909383558414295101411619*x0^2+3965375739747963963*x0*x2-242918276730869078066809331024042702891*x0*x3+183223571698267990877213954922249738976*x0*x4-26895670850679807029162828509165308960*x1*x2+8474819494349999830*x2^2-108161008372872223862852763485241240461559107515585580341416083299049547479188*x2*x3+7363708837931302352*x3*x4-5810523941465924196*x0-56367661314560847175432350623971988066351161410811790295222574599225122416422*x1,
53982040833228076313542329894038390191*x0*x1-206551489376811879023310424331028613648991394426586712694618987675893992095*x1*x2-26120280211037854858801940885916053807038834982603721433826269277681999470710*x1*x3+4029356288040653273*x1*x4-274275731056117514378948248775804627809*x2^2+22880842073886427126391720980638715993971675571004139935718379107975553283716*x2*x4+461481989805777033*x3^2-225743842478155246298775150859523761854*x0-266787522478509501312233443434650042453*x3,
-1463270252407249501848856616174573575-241678775160159524397560021022956852656*x3+59945260780406811284729520711606350260768451825351284689214830814859034643851*x2-270091331352683447*x1+75362784622031054111147260083291338239534467429503885918798983872972427918931*x0,
-10441610625894195060*x0*x1-1114495566143508545*x0*x2-65112118923471095150502818681050565636656819228549850254576286886899711979247*x0*x4-9528406777100061390*x1^2+101660950184542667686969379230972979274813553811159050751745415147502239802454*x2*x4-54791306350180011648186216607762343903892129826702671725099823502161591551559*x3^2-193034129440816415726978725099070240186*x4^2+11261262311508858602*x0-237424967543089067406514151923330414441*x1-87131577909261515365004527854176718970724315904242405832627910573130499869488*x2+261945737532525492433089247079747708673
cp-d3-n4-p2.ms (used for both k=2 and k=3)
x1,x2,x3,x4
0
-7*x1^3+22*x1^2*x2-55*x1^2*x3-94*x1^2*x4-56*x1*x2^2-62*x1*x2*x4-73*x1*x3^2-4*x1*x3*x4-10*x1*x4^2+80*x2^3-44*x2^2*x3+71*x2^2*x4-75*x2*x3^2-10*x2*x3*x4-40*x2*x4^2+23*x3^3+75*x3^2*x4+6*x3*x4^2+37*x4^3+87*x1^2+97*x1*x2-83*x1*x3+62*x1*x4-17*x2^2-7*x2*x3+42*x2*x4-92*x3^2+74*x3*x4-23*x4^2-82*x1-50*x2+72*x3+87*x4+44,
29*x1^3+98*x1^2*x2-23*x1^2*x3+10*x1^2*x4-8*x1*x2^2-29*x1*x2*x3+95*x1*x2*x4-49*x1*x3^2-47*x1*x3*x4-81*x1*x4^2-10*x2^3+31*x2^2*x3-51*x2^2*x4+95*x2*x3^2+x2*x3*x4+55*x2*x4^2+30*x3^3-27*x3^2*x4-59*x3*x4^2-87*x4^3-61*x1^2+11*x1*x2+40*x1*x3+91*x1*x4+77*x2^2+x2*x3-28*x2*x4-15*x3^2-96*x3*x4+47*x4^2+68*x1+16*x2+72*x3-90*x4+43,
4884*x1^4+1058*x1^3*x2+10557*x1^3*x3+6009*x1^3*x4+1072*x1^2*x2^2+32954*x1^2*x2*x3-876*x1^2*x2*x4-2066*x1^2*x3^2+4227*x1^2*x3*x4+5353*x1^2*x4^2-11136*x1*x2^3-50304*x1*x2^2*x3-13532*x1*x2^2*x4+6525*x1*x2*x3^2-13506*x1*x2*x3*x4+1670*x1*x2*x4^2+23221*x1*x3^3-2754*x1*x3^2*x4+1696*x1*x3*x4^2+5188*x1*x4^3+6120*x2^4+41100*x2^3*x3-146*x2^3*x4+18105*x2^2*x3^2+3486*x2^2*x3*x4-13678*x2^2*x4^2-12198*x2*x3^3+14395*x2*x3^2*x4+13102*x2*x3*x4^2-7256*x2*x4^3-13305*x3^4-11169*x3^3*x4-3150*x3^2*x4^2-5506*x3*x4^3+2030*x4^4+7388*x1^3+1339*x1^2*x2+7281*x1^2*x3-10980*x1^2*x4+11363*x1*x2^2+47938*x1*x2*x3+10956*x1*x2*x4+8352*x1*x3^2+6410*x1*x3*x4-5988*x1*x4^2+5752*x2^3+4093*x2^2*x3-19816*x2^2*x4-228*x2*x3^2-36652*x2*x3*x4-4895*x2*x4^2+19031*x3^3+6594*x3^2*x4+14545*x3*x4^2-2540*x4^3+1351*x1^2+6134*x1*x2+8241*x1*x3-19660*x1*x4+19638*x2^2+11456*x2*x3+9392*x2*x4-17450*x3^2-6306*x3*x4-5946*x4^2+5520*x1-13474*x2+3868*x3+8656*x4-4752,
9432*x1^4+5542*x1^3*x2-3368*x1^3*x3+6706*x1^3*x4-20132*x1^2*x2^2+9352*x1^2*x2*x3+19916*x1^2*x2*x4+120*x1^2*x3^2-1064*x1^2*x3*x4+94*x1^2*x4^2+27788*x1*x2^3-14129*x1*x2^2*x3-49497*x1*x2^2*x4+7083*x1*x2*x3^2+19502*x1*x2*x3*x4+6354*x1*x2*x4^2+6080*x1*x3^3+9421*x1*x3^2*x4+13135*x1*x3*x4^2+13217*x1*x4^3-10110*x2^4+26*x2^3*x3+24000*x2^3*x4-6618*x2^2*x3^2-33119*x2^2*x3*x4-53715*x2^2*x4^2-1399*x2*x3^3+12806*x2*x3^2*x4+44*x2*x3*x4^2-25740*x2*x4^3-5100*x3^4+7905*x3^3*x4+7153*x3^2*x4^2+6559*x3*x4^3+4335*x4^4-2070*x1^3+10101*x1^2*x2-12057*x1^2*x3-22662*x1^2*x4+28098*x1*x2^2+3120*x1*x2*x3+28120*x1*x2*x4-13680*x1*x3^2-15894*x1*x3*x4-42410*x1*x4^2-14660*x2^3-19168*x2^2*x3+29914*x2^2*x4-8659*x2*x3^2-10030*x2*x3*x4+1626*x2*x4^2+284*x3^3-14*x3^2*x4-4028*x3*x4^2-9084*x4^3-1357*x1^2-8106*x1*x2-5888*x1*x3+20917*x1*x4-23092*x2^2-5342*x2*x3-4238*x2*x4-767*x3^2+3949*x3*x4+12749*x4^2-15229*x1-9610*x2+4159*x3-5308*x4+3108,
-2712*x1^4-9377*x1^3*x2-8179*x1^3*x3+3992*x1^3*x4+5114*x1^2*x2^2-3987*x1^2*x2*x3-11770*x1^2*x2*x4+18830*x1^2*x3^2+24882*x1^2*x3*x4+11130*x1^2*x4^2-199*x1*x2^3+13836*x1*x2^2*x3+8081*x1*x2^2*x4+20994*x1*x2*x3^2+15450*x1*x2*x3*x4-2429*x1*x2*x4^2+8409*x1*x3^3+5393*x1*x3^2*x4+24122*x1*x3*x4^2+4109*x1*x4^3+43*x2^4-5574*x2^3*x3-1921*x2^3*x4-9296*x2^2*x3^2-296*x2^2*x3*x4+10906*x2^2*x4^2-9231*x2*x3^3+30015*x2*x3^2*x4+30824*x2*x3*x4^2-1561*x2*x4^3-8613*x3^4-9222*x3^3*x4-40788*x3^2*x4^2-33156*x3*x4^3+4983*x4^4-649*x1^3-1077*x1^2*x2-827*x1^2*x3+2284*x1^2*x4-3918*x1*x2^2-33770*x1*x2*x3-3918*x1*x2*x4+29736*x1*x3^2+37288*x1*x3*x4+4981*x1*x4^2+216*x2^3+9667*x2^2*x3-120*x2^2*x4-5742*x2*x3^2-29118*x2*x3*x4+3592*x2*x4^2-6066*x3^3+27496*x3^2*x4+59180*x3*x4^2-10808*x4^3+4406*x1^2+13772*x1*x2+8694*x1*x3+949*x1*x4-7367*x2^2+4772*x2*x3+15841*x2*x4-1500*x3^2-36838*x3*x4-19651*x4^2+6078*x1-4497*x2+6930*x3+11772*x4-12744
henrion5-qq.ms
f1,f2,f3,f4,f5
0
2*f1*f2*f3*f4*f5-9823275,
21/5*f1*f2*f4*f5+16/5*f1*f3*f4*f5+9/5*f2*f3*f4*f5+24/5*f1*f2*f3*f5+5*f4*f3*f1*f2-4465125,
14/5*f4*f5*f1+14/5*f4*f5*f2+8/5*f3*f4*f5+18/5*f1*f2*f5+24/5*f1*f3*f5+18/5*f2*f3*f5+4*f3*f1*f2+6*f1*f2*f4+6*f3*f4*f1+4*f2*f3*f4-441486,
7/5*f4*f5+12/5*f5*f1+12/5*f5*f2+12/5*f5*f3+3*f1*f2+4*f3*f1+4*f4*f1+3*f2*f3+4*f4*f2+3*f3*f4-15498,
6/5*f5+2*f4+2*f3+2*f2+2*f1-215
univariate-assign-left.ms
_xx[1],_xx[2],_xx[3],_xx[4]
0
-_xx[1]^3*_xx[2]-_xx[1]^2*_xx[2]^2+_xx[1]*_xx[2]^2*_xx[3]+_xx[1]*_xx[2]*_xx[3]^2+8*_xx[1]^2*_xx[2]+_xx[1]^2*_xx[3]-7*_xx[1]*_xx[2]*_xx[3]+_xx[1]*_xx[3]^2-8*_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3*_xx[3]+21*_xx[1]^2*_xx[2]^2+1412*_xx[1]^2*_xx[2]*_xx[3]+516*_xx[1]^2*_xx[3]^2+9*_xx[1]*_xx[2]^3+281*_xx[1]*_xx[2]^2*_xx[3]-187*_xx[1]*_xx[2]*_xx[3]^2-15*_xx[1]*_xx[3]^3-3*_xx[2]^3*_xx[3]-2*_xx[2]^2*_xx[3]^2+_xx[2]*_xx[3]^3+124*_xx[1]^3-229*_xx[1]^2*_xx[2]-290*_xx[1]^2*_xx[3]-67*_xx[1]*_xx[2]^2+246*_xx[1]*_xx[2]*_xx[3]+59*_xx[1]*_xx[3]^2+19*_xx[2]^2*_xx[3]-9*_xx[2]*_xx[3]^2+32*_xx[1]^2-40*_xx[1]*_xx[2]-22*_xx[1]*_xx[3]-3*_xx[2]^2+15*_xx[2]*_xx[3]+2*_xx[1]-2*_xx[2],
2*_xx[1]+3*_xx[2]+_xx[3]-_xx[4]
reals-dim0-chgvar.ms
x1,x2,x3,x4
0
37*x1*x4^2-96*x2*x4^2-82*x3^3-18*x1*x4-8*x3^2+24*x4+49,
94*x1*x2^2+5*x2^2*x3+65*x2*x3*x4-16*x2*x4-11*x3*x4-72*x3-46,
-28*x1^2*x3-47*x1*x2^2+34*x3^3-4*x3^2*x4+77*x1^2-60*x4^2+30,
-51*x1^2*x4-33*x1*x2*x3+81*x2*x3*x4-27*x1^2+11*x2*x3+72*x3*x4+38

The tests were run, and this report drafted, with the help of Claude Code (generative AI); I reviewed the results.

wegank and others added 2 commits November 25, 2026 10:57
Over the rationals, msolve only lifted the elements of the modular
Groebner basis which do not involve the eliminated variables, hence it
returned the basis of the elimination ideal only. Some algorithms, e.g.
Suzuki-Sato's algorithm for comprehensive Groebner systems, need the
full Groebner basis w.r.t. the elimination order.

The new --elim-full-basis command line option, combined with -e, makes
the multi-modular lifting keep all elements of the basis (and all
variables in their leading monomials) in the learning and application
phases, and outputs the full basis together with the elimination
monomial order in the header. The default behaviour is unchanged.

While at it, the application phase now rejects primes for which the
basis has fewer elements than expected before reading their lengths.

Closes algebraic-solving#339.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test script and its input and expected output files have to be
listed in AC_CONFIG_LINKS so that they are shipped in the distribution
tarball and linked into the build tree, otherwise make distcheck fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature request] Full basis under elimination order in characteristic 0

2 participants