3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-06-08 01:50:55 +00:00
z3/src
Copilot d5779a6993
sls_seq_plugin: remove hard aborts in is_sat for str.len and seq.last_indexof (#9736)
`src/ast/sls/sls_seq_plugin.cpp::is_sat()` had two unconditional abort
paths (`VERIFY(false)` and `NOT_IMPLEMENTED_YET()`) reachable from valid
string formulas under SLS. This changes those paths to graceful
repair/fail behavior so SLS can continue search instead of terminating
the process.

- **Length coherence fallback no longer aborts**
- Replaced the terminal `VERIFY(false)` in the `str.len` coherence block
with a normal `return false` repair failure path.
- Effect: failed local repair is propagated to the outer SLS loop
instead of crashing.

- **Implemented `seq.last_indexof` coherence handling**
  - Replaced `NOT_IMPLEMENTED_YET()` with concrete coherence logic:
    - read current `x`, `y`, and `e`,
    - compute `actual = sx.last_indexof(sy)`,
    - update `e` when `e != actual`,
    - otherwise continue.
- Effect: formulas containing `seq.last_indexof` are handled in SLS
coherence checks instead of aborting.

- **No new hard-abort behavior introduced**
- In the new `last_index` block, non-numeral `e` is handled by graceful
`return false` (repair failure), not assertion abort.

```cpp
if (seq.str.is_last_index(e, x, y) && seq.is_string(x->get_sort())) {
    auto sx = strval0(x), sy = strval0(y);
    rational val_e;
    if (!a.is_numeral(ctx.get_value(e), val_e))
        return false;
    rational actual(sx.last_indexof(sy));
    if (val_e == actual) continue;
    update(e, actual);
    return false;
}
```

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-06-06 13:26:01 -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 python: make Statistics doctests robust to optional ":time" counter (#9729) 2026-06-06 13:24:19 -07:00
ast sls_seq_plugin: remove hard aborts in is_sat for str.len and seq.last_indexof (#9736) 2026-06-06 13:26:01 -07:00
cmd_context update tptp front-end 2026-05-25 09:31:25 -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 ensure engine is datalog for dl_table and dl_util tests 2026-05-31 15:32:23 -07:00
nlsat making try-for tactic exception resilient on cancelation 2026-04-26 15:58:24 -07:00
opt fix box mode: reset bounds before each objective 2026-03-19 17:07:21 -10: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 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
shell benchmark patching 2026-05-20 13:32:23 -07:00
smt Update used_enodes properly (#9695) 2026-06-03 13:36:37 -07:00
solver SMT2 front-end: accept HO_ALL and normalize curried expression-head applications (#9636) 2026-05-26 18:39:38 -07:00
tactic build warnings 2026-05-29 10:17:46 -07:00
test Cleanup thanks to Copilot (#9709) 2026-06-04 10:46:33 -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