mirror of
https://github.com/Z3Prover/z3
synced 2026-06-19 15:16:29 +00:00
make concatentation right associative
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
e011aead11
commit
29489c3bd8
1 changed files with 6 additions and 1 deletions
|
|
@ -3838,7 +3838,7 @@ br_status seq_rewriter::mk_re_concat(expr* a, expr* b, expr_ref& result) {
|
|||
result = re().mk_to_re(str().mk_concat(a_str, b_str));
|
||||
return BR_REWRITE2;
|
||||
}
|
||||
expr* a1 = nullptr;
|
||||
expr *a1 = nullptr, *a2 = nullptr;
|
||||
expr* b1 = nullptr;
|
||||
if (re().is_to_re(a, a1) && re().is_to_re(b, b1)) {
|
||||
result = re().mk_to_re(str().mk_concat(a1, b1));
|
||||
|
|
@ -3859,6 +3859,7 @@ br_status seq_rewriter::mk_re_concat(expr* a, expr* b, expr_ref& result) {
|
|||
}
|
||||
unsigned lo1, hi1, lo2, hi2;
|
||||
|
||||
|
||||
if (re().is_loop(a, a1, lo1, hi1) && lo1 <= hi1 && re().is_loop(b, b1, lo2, hi2) && lo2 <= hi2 && a1 == b1) {
|
||||
result = re().mk_loop_proper(a1, lo1 + lo2, hi1 + hi2);
|
||||
return BR_DONE;
|
||||
|
|
@ -3900,6 +3901,10 @@ br_status seq_rewriter::mk_re_concat(expr* a, expr* b, expr_ref& result) {
|
|||
result = m().mk_ite(c, re().mk_concat(a, a1), re().mk_concat(a, b1));
|
||||
return BR_REWRITE3;
|
||||
}
|
||||
if (re().is_concat(a, a1, a2)) {
|
||||
result = re().mk_concat(a1, re().mk_concat(a2, b));
|
||||
return BR_DONE;
|
||||
}
|
||||
return BR_FAILED;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue