3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-13 12:28:44 +00:00
z3/test/arith_simplifier_plugin.cpp
Leonardo de Moura 68269c43a6 other components
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2012-10-02 11:48:48 -07:00

68 lines
1.4 KiB
C++

#include "arith_eq_solver.h"
#include "front_end_params.h"
typedef rational numeral;
typedef vector<numeral> row;
static void test_solve_integer_equations(
arith_eq_solver& asimp,
vector<row>& rows
)
{
row r_unsat;
if (asimp.solve_integer_equations(rows, r_unsat)) {
std::cout << "solved\n";
}
else {
std::cout << "not solved\n";
for (unsigned i = 0; i < r_unsat.size(); ++i) {
std::cout << " " << r_unsat[i];
}
std::cout << "\n";
}
}
void tst_arith_simplifier_plugin() {
front_end_params params;
ast_manager m;
arith_eq_solver asimp(m);
row r1;
row r2;
r1.push_back(numeral(1));
r1.push_back(numeral(2));
r1.push_back(numeral(1));
r1.push_back(numeral(2));
r2.push_back(numeral(1));
r2.push_back(numeral(2));
r2.push_back(numeral(1));
r2.push_back(numeral(2));
vector<row> rows;
rows.push_back(r1);
rows.push_back(r2);
#if 0
test_solve_integer_equations(asimp, rows);
rows[1][3] = numeral(3);
test_solve_integer_equations(asimp, rows);
#endif
rows[0][0] = numeral(1);
rows[0][1] = numeral(3);
rows[0][2] = numeral(0);
rows[0][3] = numeral(0);
rows[1][0] = numeral(1);
rows[1][1] = numeral(0);
rows[1][2] = numeral(3);
rows[1][3] = numeral(1);
test_solve_integer_equations(asimp, rows);
}