3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-07-22 06:55:51 +00:00
z3/src
Copilot 63730fefaf
Fix swapped assert_expr arguments in smt_solver::translate for named assertions (#10135)
With `parallel.enable=true`, Z3 could return a SAT model for a QF_BV
instance that violates its own assertions. The bug traces to solver
translation: named assertions were re-registered with swapped
formula/indicator arguments, corrupting the translated solver's
assertion state.

## Bug

`m_name2assertion` stores `indicator → formula`. In
`smt_solver::translate()`, the structured binding `[k, v]` gives `k =
indicator`, `v = formula`, but `assert_expr(t, a)` expects `(formula,
indicator)`:

```cpp
// Before — args reversed
for (auto& [k, v] : m_name2assertion) {
    expr* val = translator(k);  // indicator
    expr* key = translator(v);  // formula
    result->assert_expr(val, key);  // assert_expr(indicator, formula) ← wrong
}
```

## Fix

```cpp
// After — correct order
for (auto& [k, v] : m_name2assertion) {
    expr* fml = translator(v);  // formula
    expr* ind = translator(k);  // indicator
    result->assert_expr(fml, ind);  // assert_expr(formula, indicator) ✓
}
```

This affects any code path that calls `smt_solver::translate()` and uses
named assertions (`assert_and_track` / `Z3_solver_assert_and_track`),
including all parallel solving modes.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-07-16 13:46:19 -07:00
..
ackermannization block ackermann over nested selects 2026-06-19 10:41:56 -07:00
api put tag back in 2026-07-14 14:10:36 -07:00
ast [fixer-selftest] Fix typo in euf_ac_plugin.cpp comment: "betwen" → "between" (#10141) 2026-07-16 11:33:30 -07:00
cmd_context update release.yml and tptp_frontend 2026-07-14 11:16:56 -07:00
math Recognize rational roots in closest-root isolation (#10132) 2026-07-16 06:56:38 -07:00
model updates to tptp_frontend 2026-07-04 14:34:21 -07:00
muz Fix use-after-free in spacer hypothesis_reducer::reduce_core (#10123) 2026-07-14 15:18:02 -07:00
nlsat Remove unnecessary semicolons (Attempt 2) (#10020) 2026-07-02 12:47:29 -07:00
opt opt: validate strict optimization optima faithfully with delta-rational bounds (#10059) 2026-07-09 10:39:23 -07:00
params expose avoid-skolems parameter to deal with TPTP problems 2026-07-12 18:54:31 -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 Fix unsound model from parallel QF_BV solving (#10133) (#10142) 2026-07-16 11:47:07 -07:00
shell Fixes necessary to compile z3 included in clang-tidy via FetchContents. (#9768) 2026-06-08 19:44:01 -07:00
smt Fix swapped assert_expr arguments in smt_solver::translate for named assertions (#10135) 2026-07-16 13:46:19 -07:00
solver Fix unsigned overflow in parallel solver conflict budget escalation (#10076) 2026-07-10 15:25:57 -07:00
tactic Issue 438 (#10085) 2026-07-12 13:35:57 -07:00
test fixup unit tests 2026-07-16 09:35:18 -07:00
util Improve hash mixing to eliminate bitvector-expression hash-table clustering (#10120) 2026-07-14 11:51:49 -07:00
CMakeLists.txt git bindings v1.0 2026-02-18 21:02:25 -08:00