mirror of
https://github.com/Z3Prover/z3
synced 2026-03-12 00:00:33 +00:00
Address code review: clarify add_lower/upper_int_bound return semantics; fix test assertion
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
parent
47f9be0270
commit
57ede4cdcd
2 changed files with 9 additions and 5 deletions
|
|
@ -540,15 +540,19 @@ namespace seq {
|
|||
|
||||
// IntBounds: tighten the lower bound for len(var).
|
||||
// Returns true if the bound was tightened (lb > current lower bound).
|
||||
// When tightened, adds an int_constraint len(var) >= lb to this node.
|
||||
// Sets arithmetic conflict if lb > current upper bound.
|
||||
// When tightened without conflict, adds an int_constraint len(var) >= lb.
|
||||
// When lb > current upper bound, sets arithmetic conflict (no constraint added)
|
||||
// and still returns true (the bound value changed). Check is_general_conflict()
|
||||
// separately to distinguish tightening-with-conflict from normal tightening.
|
||||
// Mirrors ZIPT's AddLowerIntBound().
|
||||
bool add_lower_int_bound(euf::snode* var, unsigned lb, dep_tracker const& dep);
|
||||
|
||||
// IntBounds: tighten the upper bound for len(var).
|
||||
// Returns true if the bound was tightened (ub < current upper bound).
|
||||
// When tightened, adds an int_constraint len(var) <= ub to this node.
|
||||
// Sets arithmetic conflict if current lower bound > ub.
|
||||
// When tightened without conflict, adds an int_constraint len(var) <= ub.
|
||||
// When current lower bound > ub, sets arithmetic conflict (no constraint added)
|
||||
// and still returns true (the bound value changed). Check is_general_conflict()
|
||||
// separately to distinguish tightening-with-conflict from normal tightening.
|
||||
// Mirrors ZIPT's AddHigherIntBound().
|
||||
bool add_upper_int_bound(euf::snode* var, unsigned ub, dep_tracker const& dep);
|
||||
|
||||
|
|
|
|||
|
|
@ -3477,7 +3477,7 @@ static void test_assert_root_constraints_once() {
|
|||
// we can verify the count is stable between iterations by checking
|
||||
// that the same constraints weren't added multiple times.
|
||||
// The simplest check: count > 0 (constraints were asserted)
|
||||
SASSERT(count_first >= 0); // at least some constraints asserted
|
||||
SASSERT(count_first > 0); // x=y produces at least len(x)=len(y) and non-neg constraints
|
||||
std::cout << " asserted " << count_first << " constraints total during solve\n";
|
||||
std::cout << " ok\n";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue