3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-07-15 03:25:43 +00:00
z3/src
Lev Nachmanson 835679b27d
Revert #10052: eager-commit of infinitesimal LP hint is unsound for shared-symbol objectives (#10057)
## Summary

Reverts #10052, whose eager-commit of infinitesimal LP hints is
**unsound** for shared-symbol objectives.

#10052 added, in `opt_solver::maximize_objective`:

```cpp
if (val.is_finite() && !val.get_infinitesimal().is_zero() && val > m_objective_values[i])
    m_objective_values[i] = val;
```

on the premise that *"a non-zero infinitesimal ⇒ an exact, unattainable
strict optimum, so the LP hint is authoritative."* That holds for a
**pure LP**, but is **false when the objective is a shared symbol** with
another theory (e.g. the auxiliary uninterpreted function used to encode
a `distinct` with > 32 arguments). There the LP relaxation only yields a
*hint* that can be a strict **over-estimate**, and #10052 commits it
without validation — exactly the class of bound that #10028's
`check_bound` exists to reject.

## Counterexample

A 6-mark Golomb ruler over integers `x0..x5`, with the `distinct` padded
to > 32 arguments so `x5` becomes a shared symbol; objective is a real
`obj` with `obj > x5` (full file attached to #5720):

- Ground truth: `minimize x5` (integer) ⇒ **17**; since `obj > x5`, the
true optimum is **`17 + ε`**.
- With #10052, z3 reports **`(obj (+ 5.0 epsilon))`** — wrong and
**infeasible** (`obj < 6` is `unsat`; the returned model itself has `x5
= 35, obj = 49.5`).

| benchmark | with #10052 (master) | after this revert |
| --- | --- | --- |
| Golomb `bug.smt2` (shared symbol) | `(obj (+ 5.0 epsilon))` 
infeasible | `(obj 18)`  consistent |
| #5720 (`max r < 1`) | `1 - epsilon`  | `0`  (regression returns) |

## Tradeoff / follow-up

This revert restores soundness on the shared-symbol case but
**reintroduces the #5720 regression** (`max r<1` ⇒ `0`), which is why
**#5720 has been reopened**. A correct fix should preserve the strict
single-objective supremum **without** trusting an unvalidated
shared-symbol hint — e.g. gate the eager commit on `!has_shared` (pure
LP only), or validate the rational part of the hint while keeping the
infinitesimal. The same blind spot affects the alternative `check_bound`
guard proposed in #10051.

Re: #5720

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-06 12:56:13 -07:00
..
ackermannization block ackermann over nested selects 2026-06-19 10:41:56 -07:00
api Remove unnecessary semicolons (Attempt 2) (#10020) 2026-07-02 12:47:29 -07:00
ast [snapshot-regression-fix] seq_rewriter: re.range with a provably-empty bound must be the empty language (#10047) 2026-07-05 13:05:38 -07:00
cmd_context updates to tptp_frontend 2026-07-04 14:34:21 -07:00
math [coz3-deepperf-fix] Batch fixed-column bound-witness linearization per row in lar_solver (#10029) 2026-07-06 10:39:22 -07:00
model updates to tptp_frontend 2026-07-04 14:34:21 -07:00
muz Remove unnecessary semicolons (Attempt 2) (#10020) 2026-07-02 12:47:29 -07:00
nlsat Remove unnecessary semicolons (Attempt 2) (#10020) 2026-07-02 12:47:29 -07:00
opt Revert #10052: eager-commit of infinitesimal LP hint is unsound for shared-symbol objectives (#10057) 2026-07-06 12:56:13 -07:00
params Porting seq_split to master (#9840) 2026-06-30 10:18:28 -07:00
parsers Remove unnecessary semicolons (Attempt 2) (#10020) 2026-07-02 12:47:29 -07:00
qe Remove unnecessary semicolons (Attempt 2) (#10020) 2026-07-02 12:47:29 -07:00
sat Remove unnecessary semicolons (Attempt 2) (#10020) 2026-07-02 12:47:29 -07:00
shell Fixes necessary to compile z3 included in clang-tidy via FetchContents. (#9768) 2026-06-08 19:44:01 -07:00
smt handle lambda equalities 2026-07-05 12:52:01 -07:00
solver stop complaining abot Char in QF_S benchmarks 2026-07-04 14:27:34 -07:00
tactic fix build 2026-07-04 12:51:52 -07:00
test [snapshot-regression-fix] Keep symbolic re.range non-empty; fix soundness regression on range membership (#10017) 2026-07-02 14:00:51 -07:00
util Remove unnecessary semicolons (Attempt 2) (#10020) 2026-07-02 12:47:29 -07:00
CMakeLists.txt git bindings v1.0 2026-02-18 21:02:25 -08:00