3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-07-20 11:22:04 +00:00
@veanes
mk_bool_app_helper has a bug:
When it simplifies a disjunction or conjunction of regex membership constraints of the form (and (str.in_re "" R) (str.in_re x Q))
then the first term (str.in_re "" R) is omitted in the result.
You have a test here
3da9d91866/src/ast/rewriter/seq_rewriter.cpp (L438)
that means a regex membership with empty first argument is not put in the two buffers with membership/non-membership.
It isn't put into new_args either because the test bypasses these
3da9d91866/src/ast/rewriter/seq_rewriter.cpp (L485)
This commit is contained in:
Nikolaj Bjorner 2021-06-06 20:30:09 -07:00
parent 3da9d91866
commit 92ec81d108
2 changed files with 21 additions and 9 deletions

View file

@ -1269,7 +1269,22 @@ seq_util::rex::info seq_util::rex::mk_info_rec(app* e) const {
case OP_RE_OPTION:
i1 = get_info_rec(e->get_arg(0));
return i1.opt();
case OP_RE_RANGE:
case OP_RE_RANGE: {
lbool is_nullable = l_undef;
bool is_singleton = false;
bool is_interpreted = false;
zstring s1, s2;
expr* r1, *r2;
if (is_range(e, r1, r2) &&
u.str.is_string(r1, s1) && u.str.is_string(r2, s2) &&
s1.length() == 1 && s2.length() == 1 && s1[0] <= s2[0]) {
is_nullable = l_false;
is_singleton = true;
is_interpreted = true;
}
std::cout << is_nullable << "\n";
return info(true, true, is_interpreted, true, true, true, is_singleton, is_nullable, 1, 0);
}
case OP_RE_FULL_CHAR_SET:
case OP_RE_OF_PRED:
//TBD: check if the character predicate contains uninterpreted symbols or is nonground or is unsat