mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 09:35:32 +00:00
deal with empty set of post-orders
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
f59cf2452d
commit
eac659f748
5 changed files with 16 additions and 14 deletions
|
@ -90,8 +90,8 @@ void expr_dominators::compute_dominators() {
|
|||
bool change = true;
|
||||
while (change) {
|
||||
change = false;
|
||||
SASSERT(m_post2expr.back() == e);
|
||||
for (unsigned i = 0; i < m_post2expr.size() - 1; ++i) {
|
||||
SASSERT(m_post2expr.empty() || m_post2expr.back() == e);
|
||||
for (unsigned i = 0; i + 1 < m_post2expr.size(); ++i) {
|
||||
expr * child = m_post2expr[i];
|
||||
ptr_vector<expr> const& p = m_parents[child];
|
||||
SASSERT(!p.empty());
|
||||
|
@ -167,7 +167,6 @@ void dom_simplify_tactic::operator()(
|
|||
void dom_simplify_tactic::cleanup() {
|
||||
m_trail.reset();
|
||||
m_args.reset();
|
||||
m_args2.reset();
|
||||
m_result.reset();
|
||||
m_dominators.reset();
|
||||
}
|
||||
|
@ -180,9 +179,11 @@ expr_ref dom_simplify_tactic::simplify_ite(app * ite) {
|
|||
expr_ref new_c = simplify(c);
|
||||
if (m.is_true(new_c)) {
|
||||
r = simplify(t);
|
||||
} else if (m.is_false(new_c) || !assert_expr(new_c, false)) {
|
||||
}
|
||||
else if (m.is_false(new_c) || !assert_expr(new_c, false)) {
|
||||
r = simplify(e);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
for (expr * child : tree(ite)) {
|
||||
if (is_subexpr(child, t) && !is_subexpr(child, e)) {
|
||||
simplify(child);
|
||||
|
@ -254,6 +255,7 @@ expr_ref dom_simplify_tactic::simplify(expr * e0) {
|
|||
cache(e0, r);
|
||||
TRACE("simplify", tout << "depth: " << m_depth << " " << mk_pp(e0, m) << " -> " << r << "\n";);
|
||||
--m_depth;
|
||||
m_subexpr_cache.reset();
|
||||
return r;
|
||||
}
|
||||
|
||||
|
@ -361,7 +363,7 @@ bool dom_simplify_tactic::is_subexpr(expr * a, expr * b) {
|
|||
return true;
|
||||
}
|
||||
}
|
||||
m_subexpr_cache.insert(a, b, false);
|
||||
m_subexpr_cache.insert(a, b, false);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ private:
|
|||
ast_manager& m;
|
||||
dom_simplifier* m_simplifier;
|
||||
params_ref m_params;
|
||||
expr_ref_vector m_trail, m_args, m_args2;
|
||||
expr_ref_vector m_trail, m_args;
|
||||
obj_map<expr, expr*> m_result;
|
||||
expr_dominators m_dominators;
|
||||
unsigned m_scope_level;
|
||||
|
@ -120,7 +120,7 @@ private:
|
|||
public:
|
||||
dom_simplify_tactic(ast_manager & m, dom_simplifier* s, params_ref const & p = params_ref()):
|
||||
m(m), m_simplifier(s), m_params(p),
|
||||
m_trail(m), m_args(m), m_args2(m),
|
||||
m_trail(m), m_args(m),
|
||||
m_dominators(m),
|
||||
m_scope_level(0), m_depth(0), m_max_depth(1024) {}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue