This illustrates how to compute a Gröbner basis of the Cyclic-4 system
\[ x_1 + x_2 + x_3 + x_4,\\ x_1 x_2 + x_2 x_3 + x_3 x_4 + x_4 x_1,\\ x_1 x_2 x_3 + x_2 x_3 x_4 + x_3 x_4 x_1 + x_4 x_1 x_2,\\ x_1 x_2 x_3 x_4 - 1 \]
using this package.
#include <set>
#include <iostream>
using std::set;
using std::cout; using std::endl;
#include "algorithm_buchberger_basic.hpp"
#include "fields.hpp"
#include "monomial.hpp"
#include "polynomial.hpp"
int main(int argc, char *argv[]) {
unsigned e1 [] {1,0,0,0};
Monomial t1(4, e1);
unsigned e2 [] {0,1,0,0};
Monomial t2(4, e2);
unsigned e3 [] {0,0,1,0};
Monomial t3(4, e3);
unsigned e4 [] {0,0,0,1};
Monomial t4(4, e4);
unsigned e5 [] {1,1,0,0};
Monomial t5(4, e5);
unsigned e6 [] {0,1,1,0};
Monomial t6(4, e6);
unsigned e7 [] {0,0,1,1};
Monomial t7(4, e7);
unsigned e8 [] {1,0,0,1};
Monomial t8(4, e8);
unsigned e9 [] {1,1,1,0};
Monomial t9 (4, e9);
unsigned e10 [] {0,1,1,1};
Monomial t10(4, e10);
unsigned e11 [] {1,0,1,1};
Monomial t11(4, e11);
unsigned e12 [] {1,1,0,1};
Monomial t12(4, e12);
unsigned e13 [] {1,1,1,1};
Monomial t13(4, e13);
cout << "Computing a Groebner basis for " << f1 << ", " << f2
<< ", " << f3 << ", " << f4 << endl;
set<Abstract_Polynomial *> F;
F.insert(&f1); F.insert(&f2); F.insert(&f3); F.insert(&f4);
cout << "Basis:\n";
for (list<Constant_Polynomial *>::iterator g = G.begin(); g != G.end(); ++g)
cout << '\t' << *(*g) << endl;
cout << "bye\n";
}