3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-22 16:45:31 +00:00

constant folding

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-05-18 19:38:21 -07:00
parent 5bbf05c93c
commit 6e55880601

View file

@ -1984,7 +1984,11 @@ bool seq_rewriter::get_head_tail(expr* s, expr_ref& head, expr_ref& tail) {
}
expr_ref seq_rewriter::kleene_and(expr* cond, expr* r) {
if (m().is_true(cond))
return expr_ref(r, m());
expr* re_empty = m_util.re.mk_empty(m().get_sort(r));
if (m().is_false(cond))
return expr_ref(re_empty, m());
return expr_ref(m().mk_ite(cond, r, re_empty), m());
}