35 int main (
int argc,
char **argv)
37 cout <<
"#########################################################" << endl;
38 cout <<
"# CHECK CYCLIC6 ON GF(2) #" << endl;
39 cout <<
"#########################################################" << endl << endl;
42 vector<string> polynomialArray;
45 vector<string> variableName;
46 for(
int i = 0; i < 6; i++)
48 variableName.push_back(
'x'+to_string(i));
52 polynomialArray.emplace_back(
"x0+x1+x2+x3+x4+x5");
53 polynomialArray.emplace_back(
"x0*x1+x1*x2+x2*x3+x3*x4+x0*x5+x4*x5");
54 polynomialArray.emplace_back(
"x0*x1*x2+x1*x2*x3+x2*x3*x4+x0*x1*x5+x0*x4*x5+x3*x4*x5");
55 polynomialArray.emplace_back(
"x0*x1*x2*x3+x1*x2*x3*x4+x0*x1*x2*x5+x0*x1*x4*x5+x0*x3*x4*x5+x2*x3*x4*x5");
56 polynomialArray.emplace_back(
"x0*x1*x2*x3*x4+x0*x1*x2*x3*x5+x0*x1*x2*x4*x5+x0*x1*x3*x4*x5+x0*x2*x3*x4*x5+x1*x2*x3*x4*x5");
57 polynomialArray.emplace_back(
"x0*x1*x2*x3*x4*x5-1");
63 vector<string> groebnerBasisCyclic6;
70 groebnerBasisCyclic6.push_back(
"(1*x0^1) + (1*x1^1) + (1*x2^1) + (1*x3^1) + (1*x4^1) + (1*x5^1)");
71 groebnerBasisCyclic6.push_back(
"(1*x1^2) + (1*x1^1*x3^1) + (1*x2^1*x3^1) + (1*x1^1*x4^1) + (1*x3^1*x4^1) + (1*x2^1*x5^1) + (1*x3^1*x5^1) + (1*x5^2)");
72 groebnerBasisCyclic6.push_back(
"(1*x2^1*x3^3*x5^4) + (1*x2^1*x3^2*x5^5) + (1*x3^3*x5^5) + (1*x3^2*x5^6) + (1*x2^1*x3^1) + (1*x2^1*x5^1) + (1*x3^1*x5^1) + (1*x5^2)");
73 groebnerBasisCyclic6.push_back(
"(1*x1^1*x2^1) + (1*x2^2) + (1*x1^1*x3^1) + (1*x2^1*x3^1) + (1*x1^1*x4^1) + (1*x2^1*x4^1) + (1*x3^1*x4^1) + (1*x4^2) + (1*x1^1*x5^1) + (1*x2^1*x5^1) + (1*x3^1*x5^1) + (1*x4^1*x5^1)");
74 groebnerBasisCyclic6.push_back(
"(1*x2^3) + (1*x2^2*x5^1) + (1*x2^1*x5^2) + (1*x5^3)");
75 groebnerBasisCyclic6.push_back(
"(1*x2^2*x3^1) + (1*x2^1*x3^1*x4^1) + (1*x2^2*x5^1) + (1*x2^1*x3^1*x5^1) + (1*x2^1*x4^1*x5^1) + (1*x3^1*x4^1*x5^1) + (1*x2^1*x5^2) + (1*x4^1*x5^2)");
76 groebnerBasisCyclic6.push_back(
"(1*x1^1*x3^3) + (1*x2^1*x3^3) + (1*x3^3*x4^1) + (1*x1^1*x4^3) + (1*x4^4) + (1*x1^1*x3^2*x5^1) + (1*x2^1*x3^2*x5^1) + (1*x3^3*x5^1) + (1*x3^2*x4^1*x5^1) + (1*x1^1*x4^2*x5^1) + (1*x4^3*x5^1) + (1*x1^1*x3^1*x5^2) + (1*x2^1*x3^1*x5^2) + (1*x3^2*x5^2) + (1*x1^1*x4^1*x5^2) + (1*x3^1*x4^1*x5^2) + (1*x4^2*x5^2) + (1*x2^1*x5^3) + (1*x3^1*x5^3) + (1*x5^4)");
77 groebnerBasisCyclic6.push_back(
"(1*x1^1*x3^2*x5^4) + (1*x2^2*x4^1*x5^4) + (1*x2^1*x3^1*x4^1*x5^4) + (1*x3^2*x4^1*x5^4) + (1*x1^1*x4^2*x5^4) + (1*x2^1*x4^2*x5^4) + (1*x4^3*x5^4) + (1*x2^2*x5^5) + (1*x2^1*x3^1*x5^5) + (1*x2^1*x4^1*x5^5) + (1*x3^1*x4^1*x5^5) + (1*x4^2*x5^5) + (1*x2^1*x5^6) + (1*x3^1*x5^6) + (1*x2^1) + (1*x5^1)");
78 groebnerBasisCyclic6.push_back(
"(1*x2^1*x4^3*x5^4) + (1*x2^1*x4^2*x5^5) + (1*x4^3*x5^5) + (1*x4^2*x5^6) + (1*x2^1*x4^1) + (1*x2^1*x5^1) + (1*x4^1*x5^1) + (1*x5^2)");
79 groebnerBasisCyclic6.push_back(
"(1*x2^1*x3^2*x5^6) + (1*x2^1*x4^2*x5^6) + (1*x3^2*x5^7) + (1*x4^2*x5^7) + (1*x2^1*x5^8) + (1*x5^9) + (1*x1^1*x3^2) + (1*x2^1*x3^2) + (1*x2^2*x4^1) + (1*x2^1*x3^1*x4^1) + (1*x3^2*x4^1) + (1*x1^1*x4^2) + (1*x4^3) + (1*x2^2*x5^1) + (1*x2^1*x3^1*x5^1) + (1*x3^2*x5^1) + (1*x2^1*x4^1*x5^1) + (1*x3^1*x4^1*x5^1) + (1*x2^1*x5^2) + (1*x3^1*x5^2)");
80 groebnerBasisCyclic6.push_back(
"(1*x1^1*x3^1*x4^1) + (1*x1^1*x4^2) + (1*x3^1*x4^2) + (1*x4^3) + (1*x1^1*x3^1*x5^1) + (1*x1^1*x4^1*x5^1) + (1*x3^1*x4^1*x5^1) + (1*x4^2*x5^1)");
81 groebnerBasisCyclic6.push_back(
"(1*x2^1*x3^2*x4^1) + (1*x2^1*x3^2*x5^1) + (1*x3^2*x4^1*x5^1) + (1*x3^2*x5^2) + (1*x2^1*x4^1*x5^2) + (1*x2^1*x5^3) + (1*x4^1*x5^3) + (1*x5^4)");
82 groebnerBasisCyclic6.push_back(
"(1*x2^2*x4^2) + (1*x2^2*x5^2) + (1*x4^2*x5^2) + (1*x5^4)");
83 groebnerBasisCyclic6.push_back(
"(1*x2^1*x3^1*x4^2) + (1*x2^1*x4^2*x5^1) + (1*x3^1*x4^2*x5^1) + (1*x2^1*x3^1*x5^2) + (1*x4^2*x5^2) + (1*x2^1*x5^3) + (1*x3^1*x5^3) + (1*x5^4)");
84 groebnerBasisCyclic6.push_back(
"(1*x3^2*x4^2*x5^2) + (1*x1^1*x3^1*x5^4) + (1*x2^1*x3^1*x5^4) + (1*x1^1*x4^1*x5^4) + (1*x3^1*x4^1*x5^4) + (1*x4^2*x5^4) + (1*x2^1*x5^5) + (1*x3^1*x5^5) + (1*x5^6) + (1*1)");
85 groebnerBasisCyclic6.push_back(
"(1*x1^1*x4^4*x5^2) + (1*x4^5*x5^2) + (1*x2^2*x4^1*x5^4) + (1*x2^1*x3^1*x4^1*x5^4) + (1*x2^1*x4^2*x5^4) + (1*x2^2*x5^5) + (1*x2^1*x3^1*x5^5) + (1*x2^1*x4^1*x5^5) + (1*x3^1*x4^1*x5^5) + (1*x4^2*x5^5) + (1*x2^1*x5^6) + (1*x3^1*x5^6) + (1*x1^1) + (1*x2^1) + (1*x4^1) + (1*x5^1)");
86 groebnerBasisCyclic6.push_back(
"(1*x2^2*x5^6) + (1*x5^8) + (1*x2^2) + (1*x5^2)");
87 groebnerBasisCyclic6.push_back(
"(1*x1^1*x3^1*x5^6) + (1*x2^1*x3^1*x5^6) + (1*x1^1*x4^1*x5^6) + (1*x3^1*x4^1*x5^6) + (1*x4^2*x5^6) + (1*x2^1*x5^7) + (1*x3^1*x5^7) + (1*x5^8) + (1*x1^1*x3^1) + (1*x2^1*x3^1) + (1*x1^1*x4^1) + (1*x3^1*x4^1) + (1*x4^2) + (1*x2^1*x5^1) + (1*x3^1*x5^1) + (1*x5^2)");
88 groebnerBasisCyclic6.push_back(
"(1*x2^1*x3^1*x4^1*x5^6) + (1*x2^1*x3^1*x5^7) + (1*x2^1*x4^1*x5^7) + (1*x3^1*x4^1*x5^7) + (1*x2^1*x5^8) + (1*x3^1*x5^8) + (1*x4^1*x5^8) + (1*x5^9) + (1*x2^1*x3^1*x4^1) + (1*x2^1*x3^1*x5^1) + (1*x2^1*x4^1*x5^1) + (1*x3^1*x4^1*x5^1) + (1*x2^1*x5^2) + (1*x3^1*x5^2) + (1*x4^1*x5^2) + (1*x5^3)");
91 bool testCyclic6 =
true;
93 while(i < basis.size() && testCyclic6 == true )
95 testCyclic6 = testCyclic6 && (groebnerBasisCyclic6[i].compare(basis[i])==0);
100 cout <<
"Test cyclic6 GF(2) on 8 bits pass" << endl;
105 cout <<
"Test cyclic6 GF(2) on 8 bits failed" << endl;
std::vector< std::string > groebnerBasisGF2F4(int nbVariable, std::vector< std::string > variableName, std::vector< std::string > polynomialList, int nbThread, int verbose)
Compute a reduced groebner basis of the ideal defined by the list of polynomials polynomialList.
Declaration of library methods.