3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-24 03:57:51 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2021-04-04 12:16:46 -07:00
parent d247289606
commit 52d37f131d
3 changed files with 109 additions and 80 deletions

View file

@ -5,14 +5,21 @@ namespace polysat {
// test resolve, factoring routines
// auxiliary
struct solver_scope {
reslimit lim;
trail_stack stack;
};
struct scoped_solver : public solver_scope, public solver {
scoped_solver(): solver(stack, lim) {}
};
/**
* This one is unsat because a*a*(a*a - 1)
* is 0 for all values of a.
*/
static void test_eq1() {
trail_stack stack;
solver s(stack);
scoped_solver s;
auto a = s.var(s.add_var(2));
auto p = a*a*(a*a - 1) + 1;
s.add_eq(p);
@ -23,8 +30,7 @@ namespace polysat {
* has solution a = 3
*/
static void test_eq2() {
trail_stack stack;
solver s(stack);
scoped_solver s;
auto a = s.var(s.add_var(2));
auto p = a*(a-1) + 2;
s.add_eq(p);
@ -38,8 +44,7 @@ namespace polysat {
* v*q > u
*/
static void test_ineq1() {
trail_stack stack;
solver s(stack);
scoped_solver s;
auto u = s.var(s.add_var(5));
auto v = s.var(s.add_var(5));
auto q = s.var(s.add_var(5));
@ -57,8 +62,7 @@ namespace polysat {
* n > r2 > 0
*/
static void test_ineq2() {
trail_stack stack;
solver s(stack);
scoped_solver s;
auto n = s.var(s.add_var(5));
auto q1 = s.var(s.add_var(5));
auto a = s.var(s.add_var(5));