mirror of
https://github.com/Z3Prover/z3
synced 2026-05-17 07:29:28 +00:00
add simplification rule to concatentations of regex to avoid stack overflow in derivatives of very long expressions
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
41412293fe
commit
e172aa370d
2 changed files with 7 additions and 0 deletions
|
|
@ -4539,6 +4539,11 @@ br_status seq_rewriter::mk_re_concat(expr* a, expr* b, expr_ref& result) {
|
|||
result = re().mk_plus(b);
|
||||
return BR_DONE;
|
||||
}
|
||||
expr *x = nullptr, *y = nullptr;
|
||||
if (re().is_concat(a, x, y) && re().is_full_seq(y) && re().is_full_seq(b)) {
|
||||
result = a;
|
||||
return BR_DONE;
|
||||
}
|
||||
expr_ref a_str(m());
|
||||
expr_ref b_str(m());
|
||||
if (lift_str_from_to_re(a, a_str) && lift_str_from_to_re(b, b_str)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue