3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-15 13:28:47 +00:00

add completion (introducing negative root function symbols) to address regression introduced when fixing unsound handling of negative roots

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2015-12-16 00:49:06 +02:00
parent 90b1b07af4
commit ee0dbf34f0
2 changed files with 4 additions and 5 deletions

View file

@ -1158,7 +1158,6 @@ namespace pdr {
while (!todo.empty()) { while (!todo.empty()) {
model_node* n = todo.back(); model_node* n = todo.back();
model* md = 0; model* md = 0;
ast_manager& m = n->pt().get_manager();
if (!n->get_model_ptr()) { if (!n->get_model_ptr()) {
if (models.find(n->state(), md)) { if (models.find(n->state(), md)) {
TRACE("pdr", tout << n->state() << "\n";); TRACE("pdr", tout << n->state() << "\n";);

View file

@ -366,7 +366,7 @@ struct purify_arith_proc {
push_cnstr(EQ(x, u().mk_power(k, u().mk_numeral(n, false)))); push_cnstr(EQ(x, u().mk_power(k, u().mk_numeral(n, false))));
push_cnstr_pr(result_pr); push_cnstr_pr(result_pr);
} }
else if (complete()) { else {
SASSERT(n.is_even()); SASSERT(n.is_even());
// (^ x (/ 1 n)) --> k | x >= 0 implies (x = k^n and k >= 0), x < 0 implies k = neg-root(x, n) // (^ x (/ 1 n)) --> k | x >= 0 implies (x = k^n and k >= 0), x < 0 implies k = neg-root(x, n)
// when n is even // when n is even
@ -379,9 +379,9 @@ struct purify_arith_proc {
EQ(k, u().mk_neg_root(x, u().mk_numeral(n, false))))); EQ(k, u().mk_neg_root(x, u().mk_numeral(n, false)))));
push_cnstr_pr(result_pr); push_cnstr_pr(result_pr);
} }
else { // else {
return BR_FAILED; // return BR_FAILED;
} // }
} }
else { else {
// root not supported for integers. // root not supported for integers.