3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-06-19 15:16:29 +00:00
z3/src
Margus Veanes 0b8bb98656 fix(seq::derive): symbolize top-level cache key to avoid concrete-ele poisoning
`seq::derive::operator()(ele, r)` looks up `m_top_cache` keyed only by the
regex `r`, but on a miss it used to set `m_ele = ele` (a concrete char)
before calling `derive_rec(r)`. The resulting ITE-tree contained
constant-folded `(= ele c)` conditions, so the "symbolic" derivative
stored in the cache was actually specialized to that one ele. Subsequent
calls with the same `r` but a different ele hit the stale cached answer
and the substitution at the bottom was a no-op (no `v0` left to replace).

Simplest victim:
  (str.in_re "aP" (re.++ (re.* "a") "P"))
returned `unsat`. The first call D_'a'(a*P) computed `a*P` and cached it
under key `a*P`; the next call D_'P'(a*P) hit that cache entry and
returned `a*P` instead of epsilon, so the membership check ended on a
non-nullable state.

Fix: set `m_ele = v` (the canonical fresh var) so the derivative is
genuinely symbolic. Concrete-ele callers go through the existing
substitution at the bottom of `operator()`.

Adds a regression test in src/test/seq_regex_bisim.cpp checking that
D_'a'(a*P) is not nullable while D_'P'(a*P) is.

Note: this is independent of the mut_0013 bisim-level unsoundness;
that case still fails and is being tracked separately.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-15 02:28:21 -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 Bump shell-quote from 1.7.3 to 1.8.4 in /src/api/js (#9803) 2026-06-10 08:40:36 -07:00
ast fix(seq::derive): symbolize top-level cache key to avoid concrete-ele poisoning 2026-06-15 02:28:21 -07:00
cmd_context refactor solver to include settable stats 2026-06-07 14:17:38 -07:00
math Avoid invalidated column-cell references in LP pivot paths (#9783) 2026-06-09 07:36:05 -07:00
model Address PR feedback on derive, nullability, and requested reverts 2026-06-10 15:26:40 -07:00
muz Add rlimit support in fixedpoint parameters (#9798) 2026-06-10 15:13:05 -07:00
nlsat making try-for tactic exception resilient on cancelation 2026-04-26 15:58:24 -07:00
opt Fixes necessary to compile z3 included in clang-tidy via FetchContents. (#9768) 2026-06-08 19:44:01 -07:00
params prepare for lambda unfolding in ho-matcher and selectively enable ho matching 2026-05-22 13:25:01 -07:00
parsers Fix off-by-one column after comment lines in SMT2 scanner (#9808) 2026-06-10 06:49:31 -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 Fixes necessary to compile z3 included in clang-tidy via FetchContents. (#9768) 2026-06-08 19:44:01 -07:00
smt Address PR feedback on derive, nullability, and requested reverts 2026-06-10 15:26:40 -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(seq::derive): symbolize top-level cache key to avoid concrete-ele poisoning 2026-06-15 02:28:21 -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