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:
parent
fb035c0634
commit
8137143ada
4 changed files with 98 additions and 3 deletions
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue