mirror of
https://github.com/Z3Prover/z3
synced 2025-04-27 10:55:50 +00:00
bv_bounds: speedup up to 10x in larger formulas
introduce a may_simplify() function to short-circuit evaluation of expression trees that are guaranteed to not be simplifiable
This commit is contained in:
parent
c1aa33339d
commit
c693c990df
3 changed files with 80 additions and 17 deletions
|
@ -331,17 +331,13 @@ struct ctx_simplify_tactic::imp {
|
|||
|
||||
void simplify(expr * t, expr_ref & r) {
|
||||
r = 0;
|
||||
if (m_depth >= m_max_depth || m_num_steps >= m_max_steps || !is_app(t)) {
|
||||
if (m_depth >= m_max_depth || m_num_steps >= m_max_steps || !is_app(t) || !m_simp->may_simplify(t)) {
|
||||
r = t;
|
||||
return;
|
||||
}
|
||||
checkpoint();
|
||||
TRACE("ctx_simplify_tactic_detail", tout << "processing: " << mk_bounded_pp(t, m) << "\n";);
|
||||
if (m_simp->simplify(t, r)) {
|
||||
SASSERT(r.get() != 0);
|
||||
return;
|
||||
}
|
||||
if (is_cached(t, r)) {
|
||||
if (is_cached(t, r) || m_simp->simplify(t, r)) {
|
||||
SASSERT(r.get() != 0);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ public:
|
|||
virtual ~simplifier() {}
|
||||
virtual bool assert_expr(expr * t, bool sign) = 0;
|
||||
virtual bool simplify(expr* t, expr_ref& result) = 0;
|
||||
virtual bool may_simplify(expr* t) { return true; }
|
||||
virtual void push() = 0;
|
||||
virtual void pop(unsigned num_scopes) = 0;
|
||||
virtual simplifier * translate(ast_manager & m) = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue