3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-29 01:18:45 +00:00
z3/src/test/arith_simplifier_plugin.cpp
Nikolaj Bjorner b19f94ae5b make include paths uniformly use path relative to src. #534
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2017-07-31 13:24:11 -07:00

73 lines
1.4 KiB
C++

/*++
Copyright (c) 2015 Microsoft Corporation
--*/
#include "smt/arith_eq_solver.h"
#include "smt/params/smt_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() {
smt_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);
}