mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
debugging karr invariants
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
ce7d6a16d0
commit
6ed266e4de
13 changed files with 196 additions and 68 deletions
|
@ -514,6 +514,15 @@ static void tst16() {
|
|||
saturate_basis(hb);
|
||||
}
|
||||
|
||||
static void tst17() {
|
||||
hilbert_basis hb;
|
||||
hb.add_eq(vec(1, 0), R(0));
|
||||
hb.add_eq(vec(-1, 0), R(0));
|
||||
hb.add_eq(vec(0, 2), R(0));
|
||||
hb.add_eq(vec(0, -2), R(0));
|
||||
saturate_basis(hb);
|
||||
|
||||
}
|
||||
|
||||
void tst_hilbert_basis() {
|
||||
std::cout << "hilbert basis test\n";
|
||||
|
@ -522,6 +531,9 @@ void tst_hilbert_basis() {
|
|||
|
||||
g_use_ordered_support = true;
|
||||
|
||||
tst17();
|
||||
return;
|
||||
|
||||
if (true) {
|
||||
tst1();
|
||||
tst2();
|
||||
|
|
|
@ -165,6 +165,28 @@ namespace karr {
|
|||
return v;
|
||||
}
|
||||
|
||||
static vector<rational> V(int i, int j, int k, int l, int m) {
|
||||
vector<rational> v;
|
||||
v.push_back(rational(i));
|
||||
v.push_back(rational(j));
|
||||
v.push_back(rational(k));
|
||||
v.push_back(rational(l));
|
||||
v.push_back(rational(m));
|
||||
return v;
|
||||
}
|
||||
|
||||
static vector<rational> V(int i, int j, int k, int l, int x, int y, int z) {
|
||||
vector<rational> v;
|
||||
v.push_back(rational(i));
|
||||
v.push_back(rational(j));
|
||||
v.push_back(rational(k));
|
||||
v.push_back(rational(l));
|
||||
v.push_back(rational(x));
|
||||
v.push_back(rational(y));
|
||||
v.push_back(rational(z));
|
||||
return v;
|
||||
}
|
||||
|
||||
#define R(_x_) rational(_x_)
|
||||
|
||||
|
||||
|
@ -206,8 +228,66 @@ namespace karr {
|
|||
e2.display(std::cout << "e2\n");
|
||||
}
|
||||
|
||||
void tst2() {
|
||||
/**
|
||||
0 0 0 0 0 0 0 = 0
|
||||
0 0 0 0 0 0 0 = 0
|
||||
0 0 0 0 0 0 0 = 0
|
||||
0 0 0 0 0 0 0 = 0
|
||||
0 0 0 0 1 0 0 = 0
|
||||
0 0 0 0 -1 0 0 = 0
|
||||
0 1 0 0 0 0 0 = 0
|
||||
0 -1 0 0 0 0 0 = 0
|
||||
0 0 0 2 0 0 0 = 0
|
||||
0 0 0 -2 0 0 0 = 0
|
||||
*/
|
||||
|
||||
matrix ND;
|
||||
ND.A.push_back(V(0,0,0,0,1,0,0)); ND.b.push_back(R(0));
|
||||
ND.A.push_back(V(0,0,0,0,-1,0,0)); ND.b.push_back(R(0));
|
||||
ND.A.push_back(V(0,1,0,0,0,0,0)); ND.b.push_back(R(0));
|
||||
ND.A.push_back(V(0,-1,0,0,0,0,0)); ND.b.push_back(R(0));
|
||||
ND.A.push_back(V(0,0,0,2,0,0,0)); ND.b.push_back(R(0));
|
||||
ND.A.push_back(V(0,0,0,-2,0,0,0)); ND.b.push_back(R(0));
|
||||
|
||||
ND.display(std::cout << "ND\n");
|
||||
|
||||
matrix N;
|
||||
dualizeH(N, ND);
|
||||
|
||||
N.display(std::cout << "N\n");
|
||||
|
||||
|
||||
}
|
||||
|
||||
void tst3() {
|
||||
/**
|
||||
0 0 0 0 1 0 0 = 0
|
||||
0 0 0 0 -1 0 0 = 0
|
||||
0 1 0 0 0 0 0 = 0
|
||||
0 -1 0 0 0 0 0 = 0
|
||||
0 0 0 2 0 0 0 = 0
|
||||
0 0 0 -2 0 0 0 = 0
|
||||
*/
|
||||
|
||||
matrix ND;
|
||||
ND.A.push_back(V(1,0)); ND.b.push_back(R(0));
|
||||
ND.A.push_back(V(0,2)); ND.b.push_back(R(0));
|
||||
|
||||
ND.display(std::cout << "ND\n");
|
||||
|
||||
matrix N;
|
||||
dualizeH(N, ND);
|
||||
|
||||
N.display(std::cout << "N\n");
|
||||
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
void tst_karr() {
|
||||
karr::tst3();
|
||||
return;
|
||||
karr::tst1();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue