3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 01:25:31 +00:00

string to regex approximation used to strengthen membership constraints (#4610)

* string to regex approximation used to strengthen membership constraints

* fixed pull request comments
This commit is contained in:
Margus Veanes 2020-08-01 16:45:00 -07:00 committed by GitHub
parent fb035c0634
commit 8137143ada
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 98 additions and 3 deletions

View file

@ -1449,3 +1449,17 @@ bool seq_util::re::is_loop(expr const* n, expr*& body, expr*& lo) const {
}
return false;
}
/**
Returns true iff e is the epsilon regex.
*/
bool seq_util::re::is_epsilon(expr* r) const {
expr* s;
return is_to_re(r, s) && u.str.is_empty(s);
}
/**
Makes the epsilon regex for a given sequence sort.
*/
app* seq_util::re::mk_epsilon(sort* seq_sort) {
return mk_to_re(u.str.mk_empty(seq_sort));
}

View file

@ -474,6 +474,8 @@ public:
bool is_loop(expr const* n, expr*& body, expr*& lo) const;
unsigned min_length(expr* r) const;
unsigned max_length(expr* r) const;
bool is_epsilon(expr* r) const;
app* mk_epsilon(sort* seq_sort);
};
str str;
re re;