mirror of
https://github.com/Z3Prover/z3
synced 2025-04-22 16:45:31 +00:00
fix assertion for integrality, lax noprogress bail out code
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
53f82e3239
commit
465eafbf45
2 changed files with 6 additions and 2 deletions
|
@ -1449,6 +1449,8 @@ namespace smt {
|
|||
/**
|
||||
Move the variable x_i maximally towards its bound as long as
|
||||
bounds of other variables are not violated.
|
||||
Returns false if an integer bound was truncated and no
|
||||
progress was made.
|
||||
*/
|
||||
|
||||
template<typename Ext>
|
||||
|
@ -1492,7 +1494,9 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
|
||||
bool truncated = false;
|
||||
if (is_int(x_i)) {
|
||||
truncated = !delta_abs.is_int();
|
||||
delta_abs = floor(delta_abs);
|
||||
}
|
||||
|
||||
|
@ -1505,7 +1509,7 @@ namespace smt {
|
|||
|
||||
TRACE("opt", tout << "Safe delta: " << delta << "\n";);
|
||||
update_value(x_i, delta);
|
||||
return !delta.is_zero();
|
||||
return !truncated || !delta.is_zero();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -204,7 +204,7 @@ namespace smt {
|
|||
bool theory_arith<Ext>::satisfy_integrality() const {
|
||||
int num = get_num_vars();
|
||||
for (theory_var v = 0; v < num; v++) {
|
||||
if (!(is_int(v) && get_value(v).is_int())) {
|
||||
if (is_int(v) && !get_value(v).is_int()) {
|
||||
TRACE("bound_bug", display_var(tout, v); display(tout););
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue