3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-07-27 01:12:40 +00:00

nla: add LP-based nonlinear bound optimization for cross-nested confl… (#10180)

…icts

Add core::optimize_nl_bounds() (gated by arith.nl.optimize_bounds) which
runs LP max/min over monomial leaf variables inside core::propagate(),
analogous to solver=2's max_min_nl_vars, so nla (arith.solver=6) can
detect cross-nested conflicts previously missed. Collect improved bounds
first, then apply them and re-establish feasibility once; reconcile the
core solver via find_feasible_solution before the raw maximize solves to
preserve inf_heap_is_correct(). Skip null witnesses in
get_dependencies_of_maximum for implied/unconditional bounds.

On FStar-UInt128-divergence solver=6 this yields unsat in 2
final-checks, seed-insensitive (seeds 1-10).


Copilot-Session: ac36bb84-de91-4e6c-86df-6008c7396ceb

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ac36bb84-de91-4e6c-86df-6008c7396ceb
Copilot-Session: 96a14756-2ffe-4cc3-87e7-49fda1b6113a
This commit is contained in:
Nikolaj Bjorner 2026-07-23 09:00:46 -07:00 committed by GitHub
parent 53fa8f9cc4
commit aba41d026f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 370 additions and 292 deletions

View file

@ -2459,8 +2459,10 @@ static unsigned div_u(unsigned k, unsigned n) {
template<bool SYNCH>
bool mpz_manager<SYNCH>::root(mpz & a, unsigned n) {
SASSERT(n % 2 != 0 || is_nonneg(a));
if (is_zero(a)) {
SASSERT(n != 0);
if (n % 2 == 0 && is_neg(a))
return false;
if (is_zero(a) || n == 1) {
return true; // precise
}

View file

@ -703,7 +703,7 @@ public:
Otherwise return false, and update a with the smallest
integer r such that r*r > n.
\remark This method assumes that if n is even, then a is nonegative
\remark This method returns false if a is negative and n is even.
*/
bool root(mpz & a, unsigned n);
bool root(mpz const & a, unsigned n, mpz & r) { set(r, a); return root(r, n); }