mirror of
https://github.com/Z3Prover/z3
synced 2026-06-27 10:58:48 +00:00
Derive with ranges (#9963)
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Margus Veanes <margus@microsoft.com> Co-authored-by: Margus Veanes <veanes@users.noreply.github.com>
This commit is contained in:
parent
0596c7c634
commit
22c2635786
24 changed files with 3462 additions and 1000 deletions
|
|
@ -19,6 +19,7 @@ Notes:
|
|||
#include "ast/rewriter/bool_rewriter.h"
|
||||
#include "params/bool_rewriter_params.hpp"
|
||||
#include "ast/rewriter/rewriter_def.h"
|
||||
#include "ast/rewriter/expr_safe_replace.h"
|
||||
#include "ast/ast_lt.h"
|
||||
#include "ast/for_each_expr.h"
|
||||
#include <algorithm>
|
||||
|
|
@ -1185,4 +1186,30 @@ void bool_rewriter::mk_ge2(expr* a, expr* b, expr* c, expr_ref& r) {
|
|||
}
|
||||
|
||||
|
||||
template class rewriter_tpl<bool_rewriter_cfg>;
|
||||
bool bool_rewriter::decompose_ite(expr *r, expr_ref &c, expr_ref &th, expr_ref &el) {
|
||||
expr *cond = nullptr, *r1 = nullptr, *r2 = nullptr;
|
||||
if (m().is_ite(r, cond, r1, r2)) {
|
||||
c = cond;
|
||||
th = r1;
|
||||
el = r2;
|
||||
return true;
|
||||
}
|
||||
for (expr *e : subterms::ground(expr_ref(r, m()))) {
|
||||
if (m().is_ite(e, cond, r1, r2)) {
|
||||
m_rep1.reset();
|
||||
m_rep2.reset();
|
||||
m_rep1.insert(e, r1);
|
||||
m_rep2.insert(e, r2);
|
||||
c = cond;
|
||||
th = r;
|
||||
el = r;
|
||||
m_rep1(th);
|
||||
m_rep2(el);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
template class rewriter_tpl<bool_rewriter_cfg>;
|
||||
Loading…
Add table
Add a link
Reference in a new issue