Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix re.range symbolic argument bug in z3str3 #6189

Merged
merged 1 commit into from
Jul 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions src/smt/theory_str_regex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -724,8 +724,7 @@ namespace smt {
unsigned cx = estimate_regex_complexity(sub1);
return _qadd(lo, cx);
} else if (u.re.is_range(re, sub1, sub2)) {
SASSERT(u.str.is_string(sub1));
SASSERT(u.str.is_string(sub2));
if (!u.re.is_range(re, lo, hi)) throw default_exception("regular expressions must be built from string literals");
zstring str1, str2;
u.str.is_string(sub1, str1);
u.str.is_string(sub2, str2);
Expand Down Expand Up @@ -767,8 +766,7 @@ namespace smt {
unsigned cx = estimate_regex_complexity_under_complement(sub1);
return _qmul(2, cx);
} else if (u.re.is_range(re, sub1, sub2)) {
SASSERT(u.str.is_string(sub1));
SASSERT(u.str.is_string(sub2));
if (!u.re.is_range(re, lo, hi)) throw default_exception("regular expressions must be built from string literals");
zstring str1, str2;
u.str.is_string(sub1, str1);
u.str.is_string(sub2, str2);
Expand Down Expand Up @@ -874,8 +872,7 @@ namespace smt {
// this is bad -- term generation requires this not to appear
lens.reset();
} else if (u.re.is_range(re, sub1, sub2)) {
SASSERT(u.str.is_string(sub1));
SASSERT(u.str.is_string(sub2));
if (!u.re.is_range(re, lo, hi)) throw default_exception("regular expressions must be built from string literals");
zstring str1, str2;
u.str.is_string(sub1, str1);
u.str.is_string(sub2, str2);
Expand Down Expand Up @@ -1006,8 +1003,7 @@ namespace smt {
SASSERT(retval);
return retval;
} else if (u.re.is_range(re, sub1, sub2)) {
SASSERT(u.str.is_string(sub1));
SASSERT(u.str.is_string(sub2));
if (!u.re.is_range(re, lo, hi)) throw default_exception("regular expressions must be built from string literals");
zstring str1, str2;
u.str.is_string(sub1, str1);
u.str.is_string(sub2, str2);
Expand Down