\[ b x + 32002 a y , d x + 32002 c y + 32002 d + y ,\\ a^2 + b^2 + 32002 r^2 ,\\ c^2 + d^2 + 32002 s^2 + 32001 c + 1 ,\\ a^2 + b^2 + 32001 a c + c^2 + 32001 b d + d^2 + 32002 t^2 \]
#include <set>
#include <cstdlib>
#include <cstring>
#include <iostream>
using std::set;
using std::cout; using std::endl;
#include "system_constants.hpp"
#include "fields.hpp"
#include "monomial.hpp"
#include "polynomial.hpp"
#include "dynamic_engine.hpp"
#include "algorithm_buchberger_basic.hpp"
#include "algorithm_buchberger_dynamic.hpp"
int main(int argc, char *argv[]) {
if (argc != 3 or (strcmp(argv[2],"stat") and strcmp(argv[2],"dyn"))) {
cout << "need to know method (usually 2) and then if dynamic (stat or dyn)\n";
return 1;
}
bool static_algorithm = true;
if (!strcmp(argv[2],"dyn")) static_algorithm = false;
string X [9] = {"a", "b", "c", "d", "r", "s", "t", "x", "y"} ;
DEG_TYPE e0 [] { 0, 0, 0, 0, 0, 0 };
Monomial bx { 0, 1, 0, 0, 0, 0, 0, 1, 0 };
Monomial ay { 1, 0, 0, 0, 0, 0, 0, 0, 1 };
Monomial dx { 0, 0, 0, 1, 0, 0, 0, 1, 0 };
Monomial d1 { 0, 0, 0, 1, 0, 0, 0, 0, 0 };
Monomial cy { 0, 0, 1, 0, 0, 0, 0, 0, 1 };
Monomial y1 { 0, 0, 0, 0, 0, 0, 0, 0, 1 };
Monomial b2 { 0, 2, 0, 0, 0, 0, 0, 0, 0 };
Monomial a2 { 2, 0, 0, 0, 0, 0, 0, 0, 0 };
Monomial r2 { 0, 0, 0, 0, 2, 0, 0, 0, 0 };
Monomial c2 { 0, 0, 2, 0, 0, 0, 0, 0, 0 };
Monomial c1 { 0, 0, 1, 0, 0, 0, 0, 0, 0 };
Monomial one { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Monomial d2 { 0, 0, 0, 2, 0, 0, 0, 0, 0 };
Monomial s2 { 0, 0, 0, 0, 0, 2, 0, 0, 0 };
Monomial ac { 1, 0, 1, 0, 0, 0, 0, 0, 0 };
Monomial bd { 0, 1, 0, 1, 0, 0, 0, 0, 0 };
Monomial t2 { 0, 0, 0, 0, 0, 0, 2, 0, 0 };
Monomial M5 [] { a2, ac, c2, b2, bd, d2, t2 };
cout << "Computing a Groebner basis for\n\t" << f1
<< ",\n\t" << f2
<< ",\n\t" << f3
<< ",\n\t" << f4
<< ",\n\t" << f5
<< endl;
list<Abstract_Polynomial *> F;
F.push_back(&f1); F.push_back(&f2); F.push_back(&f3);
F.push_back(&f4); F.push_back(&f5);
list<Constant_Polynomial *> G;
if (static_algorithm) G =
buchberger(F, method, StrategyFlags::SUGAR_STRATEGY);
F, method, StrategyFlags::SUGAR_STRATEGY, nullptr,
DynamicHeuristic::ORD_HILBERT_THEN_DEG
);
cout << "Basis:\n";
cout << '\t';
g->leading_monomial().print(
true, cout, R.
name_list());
delete g;
}
cout << "bye\n";
}