3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-04-05 03:09:01 +00:00

Fixed regex witness

This commit is contained in:
CEisenhofer 2026-03-19 17:16:29 +01:00
parent d31968f0ad
commit 109ab7d098
2 changed files with 42 additions and 13 deletions

View file

@ -6112,8 +6112,29 @@ lbool seq_rewriter::some_string_in_re(expr_mark& visited, expr* r, unsigned_vect
// I want this case to be processed first => push it last
// reason: current string is only pruned
SASSERT(low <= high);
str.push_back(low); // ASSERT: low .. high does not intersect with exclude
todo.push_back({ expr_ref(th, m()), str.size(), {}, true });
unsigned ch = low;
bool found = true;
while (true) {
bool advanced = false;
for (auto [l, h] : exclude) {
if (l <= ch && ch <= h) {
if (h >= high) {
found = false;
break;
}
ch = h + 1;
advanced = true;
}
}
if (!found || ch > high)
break;
if (!advanced)
break;
}
if (found && ch <= high) {
str.push_back(ch);
todo.push_back({ expr_ref(th, m()), str.size(), {}, true });
}
}
continue;
}