3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-07-27 17:32:45 +00:00
z3/src/opt
Lev Nachmanson 1d936e2384
opt: keep infinitesimal LP optimum instead of falling back to model value
When an objective's optimum is an open (strict) bound, the arithmetic
relaxation returns a value carrying a non-zero infinitesimal (e.g.
minimizing a real x subject to x > 0, whose infimum is the unattained 0,
reported as "epsilon"). opt_solver::maximize_objective validates such a
hint with check_bound(), which asserts the objective is >= val via mk_ge
and searches for a model reaching it. mk_ge cannot faithfully encode the
infinitesimal (it drops a negative infinitesimal and turns a positive one
into a strict bound), so this validation always fails spuriously for an
open optimum. Since #10028 (fdc32d0e6) stopped committing the hint before
validation, this false negative now discards the true infinitesimal
optimum and reports an attainable - strictly worse - model value instead
(x = 1 rather than epsilon).

Treat a hint with a non-zero infinitesimal as valid in check_bound: for
such open bounds the relaxation value is exact. Hints without an
infinitesimal (such as the integer objective of #10028) are still
validated normally, so that fix is preserved.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-05 02:31:15 -07:00
..
CMakeLists.txt Fixes necessary to compile z3 included in clang-tidy via FetchContents. (#9768) 2026-06-08 19:44:01 -07:00
maxcore.cpp Refactor mk_and/mk_or call sites to use vector overloads (#8286) 2026-01-22 13:21:22 -08:00
maxcore.h Remove unnecessary semicolons (Attempt 2) (#10020) 2026-07-02 12:47:29 -07:00
maxlex.cpp Centralize and document TRACE tags using X-macros (#7657) 2025-05-28 14:31:25 +01:00
maxlex.h Remove unnecessary semicolons (Attempt 2) (#10020) 2026-07-02 12:47:29 -07:00
maxsmt.cpp Remove unnecessary semicolons (Attempt 2) (#10020) 2026-07-02 12:47:29 -07:00
maxsmt.h Remove unnecessary semicolons (Attempt 2) (#10020) 2026-07-02 12:47:29 -07:00
opt_cmds.cpp Fix unused parameter warnings in empty override functions by omitting parameter names (#8174) 2026-01-12 21:27:33 -08:00
opt_cmds.h booyah 2020-07-04 15:56:30 -07:00
opt_context.cpp refactor solver to include settable stats 2026-06-07 14:17:38 -07:00
opt_context.h refactor solver to include settable stats 2026-06-07 14:17:38 -07:00
opt_cores.cpp Remove unnecessary semicolons (Attempt 2) (#10020) 2026-07-02 12:47:29 -07:00
opt_cores.h Remove unnecessary semicolons (Attempt 2) (#10020) 2026-07-02 12:47:29 -07:00
opt_lns.cpp Remove unnecessary semicolons (Attempt 2) (#10020) 2026-07-02 12:47:29 -07:00
opt_lns.h Remove unnecessary semicolons (Attempt 2) (#10020) 2026-07-02 12:47:29 -07:00
opt_mux.h separate pre-processing, add callback parameter to push/pop in python API 2022-04-11 17:05:59 +02:00
opt_params.pyg update wcnf front-end and add new wcnf strategy 2026-01-01 17:50:42 -08:00
opt_pareto.cpp Centralize and document TRACE tags using X-macros (#7657) 2025-05-28 14:31:25 +01:00
opt_pareto.h Use = default for virtual constructors. 2022-08-05 18:11:46 +03:00
opt_parse.cpp Refactor mk_and/mk_or call sites to use vector overloads (#8286) 2026-01-22 13:21:22 -08:00
opt_parse.h booyah 2020-07-04 15:56:30 -07:00
opt_preprocess.cpp Remove unnecessary semicolons (Attempt 2) (#10020) 2026-07-02 12:47:29 -07:00
opt_preprocess.h Remove unnecessary semicolons (Attempt 2) (#10020) 2026-07-02 12:47:29 -07:00
opt_sls_solver.h refactor solver to include settable stats 2026-06-07 14:17:38 -07:00
opt_solver.cpp opt: keep infinitesimal LP optimum instead of falling back to model value 2026-07-05 02:31:15 -07:00
opt_solver.h opt_solver: clarify model member names (#10042) 2026-07-04 17:32:46 -07:00
optsmt.cpp Fix inconsistent optimization result with unvalidated LP bound (#10028) (#10040) 2026-07-04 17:28:42 -07:00
optsmt.h Remove unnecessary semicolons (Attempt 2) (#10020) 2026-07-02 12:47:29 -07:00
pb_sls.cpp Centralize and document TRACE tags using X-macros (#7657) 2025-05-28 14:31:25 +01:00
pb_sls.h Remove unnecessary semicolons (Attempt 2) (#10020) 2026-07-02 12:47:29 -07:00
sortmax.cpp Refactor mk_and and mk_app to use std::span API (#8285) 2026-01-22 16:58:38 -08:00
totalizer.cpp totalizer 2022-06-30 19:49:19 -07:00
totalizer.h totalizer 2022-06-30 19:49:19 -07:00
wmax.cpp Add [[nodiscard]] to AST factory functions and modernize iterator loops (#8143) 2026-01-11 09:58:25 -08:00
wmax.h re-enable pre-process 2022-04-13 11:24:24 +02:00