3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 17:15:31 +00:00

hilbert basis

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2013-02-12 21:45:20 -08:00
parent 0879c6f052
commit 706cbd3872
3 changed files with 223 additions and 229 deletions

View file

@ -44,26 +44,6 @@ static vector<rational> vec(int i, int j, int k, int l, int x, int y, int z) {
return nv;
}
static void saturate_basis(hilbert_sl_basis& hb) {
lbool is_sat = hb.saturate();
switch(is_sat) {
case l_true:
std::cout << "sat\n";
hb.display(std::cout);
break;
case l_false:
std::cout << "unsat\n";
break;
case l_undef:
std::cout << "undef\n";
break;
}
statistics st;
hb.collect_statistics(st);
st.display(std::cout);
}
static void saturate_basis(hilbert_basis& hb) {
lbool is_sat = hb.saturate();
@ -124,7 +104,7 @@ static void tst3() {
// Sigma_1, table 1, Ajili, Contejean
static void tst4() {
hilbert_sl_basis hb;
hilbert_basis hb;
hb.add_le(vec( 0,-2, 1, 3, 2,-2, 3), R(3));
hb.add_le(vec(-1, 7, 0, 1, 3, 5,-4), R(2));
hb.add_le(vec( 0,-1, 1,-1,-1, 0, 0), R(2));
@ -140,7 +120,7 @@ static void tst4() {
// Sigma_2 table 1, Ajili, Contejean
static void tst5() {
hilbert_sl_basis hb;
hilbert_basis hb;
hb.add_le(vec( 1, 2,-1, 1), R(3));
hb.add_le(vec( 2, 4, 1, 2), R(12));
hb.add_le(vec( 1, 4, 2, 1), R(9));
@ -153,7 +133,7 @@ static void tst5() {
// Sigma_3 table 1, Ajili, Contejean
static void tst6() {
hilbert_sl_basis hb;
hilbert_basis hb;
hb.add_le(vec( 4, 3, 0), R(6));
hb.add_le(vec(-3,-4, 0), R(-1));
hb.add_le(vec( 4, 0,-3), R(3));
@ -165,7 +145,7 @@ static void tst6() {
// Sigma_4 table 1, Ajili, Contejean
static void tst7() {
hilbert_sl_basis hb;
hilbert_basis hb;
hb.add_le(vec( 2, 1, 0, 1), R(6));
hb.add_le(vec( 1, 2, 1, 1), R(7));
hb.add_le(vec( 1, 3,-1, 2), R(8));
@ -177,7 +157,7 @@ static void tst7() {
// Sigma_5 table 1, Ajili, Contejean
static void tst8() {
hilbert_sl_basis hb;
hilbert_basis hb;
hb.add_le(vec( 2, 1, 1), R(2));
hb.add_le(vec( 1, 2, 3), R(5));
hb.add_le(vec( 2, 2, 3), R(6));
@ -187,7 +167,7 @@ static void tst8() {
// Sigma_6 table 1, Ajili, Contejean
static void tst9() {
hilbert_sl_basis hb;
hilbert_basis hb;
hb.add_le(vec( 1, 2, 3), R(11));
hb.add_le(vec( 2, 2, 5), R(13));
hb.add_le(vec( 1,-1,-11), R(3));
@ -196,7 +176,7 @@ static void tst9() {
// Sigma_7 table 1, Ajili, Contejean
static void tst10() {
hilbert_sl_basis hb;
hilbert_basis hb;
hb.add_le(vec( 1,-1,-1,-3), R(2));
hb.add_le(vec(-2, 3, 3, 5), R(3));
saturate_basis(hb);
@ -204,7 +184,7 @@ static void tst10() {
// Sigma_8 table 1, Ajili, Contejean
static void tst11() {
hilbert_sl_basis hb;
hilbert_basis hb;
hb.add_le(vec( 7,-2,11, 3, -5), R(5));
saturate_basis(hb);
}
@ -214,10 +194,12 @@ void tst_hilbert_basis() {
tst1();
tst2();
tst3();
#if 0
tst4();
tst5();
tst6();
tst7();
#endif
tst8();
tst9();
tst10();
tst11();
}