3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-06-10 10:57:15 +00:00
z3/src
Copilot 49014fe302
Fix right-side can_add indexing in sls_seq_plugin edit-distance repair (#9773)
`seq_plugin::edit_distance_with_updates` used the left-string DP index
when checking whether the right string could accept an insertion from
the `d[i][j - 1]` transition. This miscomputed updateable edit distance
and could suppress valid repair proposals when `i != j`.

- **Bug fix**
- Change the right-side insertion guard in
`src/ast/sls/sls_seq_plugin.cpp` from `b.can_add(i - 1)` to `b.can_add(j
- 1)`.
- This aligns the mutability check with the DP transition being
evaluated and with the existing update-generation logic below it.

- **Regression coverage**
- Add a focused test in `src/test/sls_seq_plugin.cpp` for an asymmetric
variable/value layout on the right-hand side.
- The test asserts that the repair logic admits the right-side add at `j
- 1`, which is the case that the previous index mixup could reject.

- **Reference**
  - The updated condition now matches the intended transition semantics:

```cpp
if (d[i][j - 1] < u[i][j] && b.can_add(j - 1)) {
    m_string_updates.reset();
    u[i][j] = d[i][j - 1];
}
```

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-06-08 19:36:14 -07:00
..
ackermannization Fix off-by-one vulnerabilities: use range-based for on goals; cache loop bound 2026-02-19 22:37:22 +00:00
api Fix Java UnsatisfiedLinkError on macOS (#7640) (#9027) 2026-06-08 19:35:04 -07:00
ast Fix right-side can_add indexing in sls_seq_plugin edit-distance repair (#9773) 2026-06-08 19:36:14 -07:00
cmd_context refactor solver to include settable stats 2026-06-07 14:17:38 -07:00
math Fix mpz_manager leak in algebraic root comparison (#9654) 2026-05-28 09:06:05 -07:00
model disable test in tptp, move to native lambdas 2026-06-02 10:38:51 -07:00
muz spacer: enable model completion in arith qe_project (#9776) 2026-06-08 19:35:49 -07:00
nlsat making try-for tactic exception resilient on cancelation 2026-04-26 15:58:24 -07:00
opt refactor solver to include settable stats 2026-06-07 14:17:38 -07:00
params prepare for lambda unfolding in ho-matcher and selectively enable ho matching 2026-05-22 13:25:01 -07:00
parsers Add SMT-LIB choice support via array OP_CHOICE and instantiate choice axioms in array solvers (#9649) 2026-05-27 10:05:06 -07:00
qe Cleanup thanks to Copilot (#9709) 2026-06-04 10:46:33 -07:00
sat refactor solver to include settable stats 2026-06-07 14:17:38 -07:00
shell benchmark patching 2026-05-20 13:32:23 -07:00
smt refactor solver to include settable stats 2026-06-07 14:17:38 -07:00
solver refactor solver to include settable stats 2026-06-07 14:17:38 -07:00
tactic refactor solver to include settable stats 2026-06-07 14:17:38 -07:00
test Fix right-side can_add indexing in sls_seq_plugin edit-distance repair (#9773) 2026-06-08 19:36:14 -07:00
util Handle SIGXCPU like a regular timeout (#9697) 2026-06-03 07:26:38 -07:00
CMakeLists.txt git bindings v1.0 2026-02-18 21:02:25 -08:00