mirror of
https://github.com/Z3Prover/z3
synced 2025-07-21 11:52:05 +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
|
@ -111,8 +111,8 @@ namespace datalog {
|
||||||
|
|
||||||
void filter_interpreted(app* cond) {
|
void filter_interpreted(app* cond) {
|
||||||
rational one(1), mone(-1);
|
rational one(1), mone(-1);
|
||||||
expr* e1, *e2, *en;
|
expr* e1 = 0, *e2 = 0, *en = 0;
|
||||||
var* v, *w;
|
var* v = 0, *w = 0;
|
||||||
rational n1, n2;
|
rational n1, n2;
|
||||||
expr_ref_vector conjs(m);
|
expr_ref_vector conjs(m);
|
||||||
flatten_and(cond, conjs);
|
flatten_and(cond, conjs);
|
||||||
|
|
|
@ -721,7 +721,7 @@ namespace smt {
|
||||||
SASSERT(!ctx().b_internalized(atom));
|
SASSERT(!ctx().b_internalized(atom));
|
||||||
bool_var bv = ctx().mk_bool_var(atom);
|
bool_var bv = ctx().mk_bool_var(atom);
|
||||||
ctx().set_var_theory(bv, get_id());
|
ctx().set_var_theory(bv, get_id());
|
||||||
expr* n1, *n2;
|
expr* n1 = 0, *n2 = 0;
|
||||||
rational r;
|
rational r;
|
||||||
lra_lp::bound_kind k;
|
lra_lp::bound_kind k;
|
||||||
theory_var v = null_theory_var;
|
theory_var v = null_theory_var;
|
||||||
|
@ -862,7 +862,7 @@ namespace smt {
|
||||||
|
|
||||||
void relevant_eh(app* n) {
|
void relevant_eh(app* n) {
|
||||||
TRACE("arith", tout << mk_pp(n, m) << "\n";);
|
TRACE("arith", tout << mk_pp(n, m) << "\n";);
|
||||||
expr* n1, *n2;
|
expr* n1 = 0, *n2 = 0;
|
||||||
if (a.is_mod(n, n1, n2))
|
if (a.is_mod(n, n1, n2))
|
||||||
mk_idiv_mod_axioms(n1, n2);
|
mk_idiv_mod_axioms(n1, n2);
|
||||||
else if (a.is_rem(n, n1, n2))
|
else if (a.is_rem(n, n1, n2))
|
||||||
|
|
|
@ -90,8 +90,8 @@ void expr_dominators::compute_dominators() {
|
||||||
bool change = true;
|
bool change = true;
|
||||||
while (change) {
|
while (change) {
|
||||||
change = false;
|
change = false;
|
||||||
SASSERT(m_post2expr.back() == e);
|
SASSERT(m_post2expr.empty() || m_post2expr.back() == e);
|
||||||
for (unsigned i = 0; i < m_post2expr.size() - 1; ++i) {
|
for (unsigned i = 0; i + 1 < m_post2expr.size(); ++i) {
|
||||||
expr * child = m_post2expr[i];
|
expr * child = m_post2expr[i];
|
||||||
ptr_vector<expr> const& p = m_parents[child];
|
ptr_vector<expr> const& p = m_parents[child];
|
||||||
SASSERT(!p.empty());
|
SASSERT(!p.empty());
|
||||||
|
@ -167,7 +167,6 @@ void dom_simplify_tactic::operator()(
|
||||||
void dom_simplify_tactic::cleanup() {
|
void dom_simplify_tactic::cleanup() {
|
||||||
m_trail.reset();
|
m_trail.reset();
|
||||||
m_args.reset();
|
m_args.reset();
|
||||||
m_args2.reset();
|
|
||||||
m_result.reset();
|
m_result.reset();
|
||||||
m_dominators.reset();
|
m_dominators.reset();
|
||||||
}
|
}
|
||||||
|
@ -180,9 +179,11 @@ expr_ref dom_simplify_tactic::simplify_ite(app * ite) {
|
||||||
expr_ref new_c = simplify(c);
|
expr_ref new_c = simplify(c);
|
||||||
if (m.is_true(new_c)) {
|
if (m.is_true(new_c)) {
|
||||||
r = simplify(t);
|
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);
|
r = simplify(e);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
for (expr * child : tree(ite)) {
|
for (expr * child : tree(ite)) {
|
||||||
if (is_subexpr(child, t) && !is_subexpr(child, e)) {
|
if (is_subexpr(child, t) && !is_subexpr(child, e)) {
|
||||||
simplify(child);
|
simplify(child);
|
||||||
|
@ -254,6 +255,7 @@ expr_ref dom_simplify_tactic::simplify(expr * e0) {
|
||||||
cache(e0, r);
|
cache(e0, r);
|
||||||
TRACE("simplify", tout << "depth: " << m_depth << " " << mk_pp(e0, m) << " -> " << r << "\n";);
|
TRACE("simplify", tout << "depth: " << m_depth << " " << mk_pp(e0, m) << " -> " << r << "\n";);
|
||||||
--m_depth;
|
--m_depth;
|
||||||
|
m_subexpr_cache.reset();
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ private:
|
||||||
ast_manager& m;
|
ast_manager& m;
|
||||||
dom_simplifier* m_simplifier;
|
dom_simplifier* m_simplifier;
|
||||||
params_ref m_params;
|
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;
|
obj_map<expr, expr*> m_result;
|
||||||
expr_dominators m_dominators;
|
expr_dominators m_dominators;
|
||||||
unsigned m_scope_level;
|
unsigned m_scope_level;
|
||||||
|
@ -120,7 +120,7 @@ private:
|
||||||
public:
|
public:
|
||||||
dom_simplify_tactic(ast_manager & m, dom_simplifier* s, params_ref const & p = params_ref()):
|
dom_simplify_tactic(ast_manager & m, dom_simplifier* s, params_ref const & p = params_ref()):
|
||||||
m(m), m_simplifier(s), m_params(p),
|
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_dominators(m),
|
||||||
m_scope_level(0), m_depth(0), m_max_depth(1024) {}
|
m_scope_level(0), m_depth(0), m_max_depth(1024) {}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue