mirror of
https://github.com/Z3Prover/z3
synced 2026-06-21 08:00:27 +00:00
seq_model: address NSB review comments (#8995)
* Initial plan * Address NSB review comments in seq_model.cpp Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> * Address code review feedback: improve null-sort handling in seq_model and some_seq_in_re Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
parent
6947698d65
commit
2212f59704
5 changed files with 53 additions and 91 deletions
|
|
@ -6014,6 +6014,27 @@ void seq_rewriter::op_cache::cleanup() {
|
|||
}
|
||||
}
|
||||
|
||||
lbool seq_rewriter::some_seq_in_re(expr* r, expr_ref& result) {
|
||||
sort* seq_sort = nullptr;
|
||||
if (!u().is_re(r, seq_sort))
|
||||
return l_undef;
|
||||
if (u().is_string(seq_sort)) {
|
||||
zstring s;
|
||||
lbool res = some_string_in_re(r, s);
|
||||
if (res == l_true)
|
||||
result = str().mk_string(s);
|
||||
return res;
|
||||
}
|
||||
// For non-string sequences: check if the regex accepts the empty sequence.
|
||||
SASSERT(seq_sort);
|
||||
expr_ref is_null = is_nullable(r);
|
||||
if (m().is_true(is_null)) {
|
||||
result = str().mk_empty(seq_sort);
|
||||
return l_true;
|
||||
}
|
||||
return l_undef;
|
||||
}
|
||||
|
||||
lbool seq_rewriter::some_string_in_re(expr* r, zstring& s) {
|
||||
sort* rs;
|
||||
(void)rs;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue