mirror of
https://github.com/Z3Prover/z3
synced 2025-08-04 02:10:23 +00:00
household chores in legacy arithmetic solver
This commit is contained in:
parent
5ab1afe5c2
commit
e40b8a2d13
4 changed files with 48 additions and 69 deletions
|
@ -43,7 +43,6 @@ namespace smt {
|
|||
return;
|
||||
numeral const & val = lower_bound(v).get_rational();
|
||||
value_sort_pair key(val, is_int_src(v));
|
||||
TRACE("arith_eq", tout << mk_pp(get_enode(v)->get_expr(), get_manager()) << " = " << val << "\n";);
|
||||
theory_var v2;
|
||||
if (m_fixed_var_table.find(key, v2)) {
|
||||
if (v2 < static_cast<int>(get_num_vars()) && is_fixed(v2) && lower_bound(v2).get_rational() == val) {
|
||||
|
@ -310,26 +309,22 @@ namespace smt {
|
|||
}
|
||||
// add new entry
|
||||
m_var_offset2row_id.insert(key, rid);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<typename Ext>
|
||||
void theory_arith<Ext>::propagate_eq_to_core(theory_var x, theory_var y, antecedents& antecedents) {
|
||||
// Ignore equality if variables are already known to be equal.
|
||||
ast_manager& m = get_manager();
|
||||
(void)m;
|
||||
if (is_equal(x, y))
|
||||
return;
|
||||
// I doesn't make sense to propagate an equality (to the core) of variables of different sort.
|
||||
if (var2expr(x)->get_sort() != var2expr(y)->get_sort()) {
|
||||
TRACE("arith", tout << mk_pp(var2expr(x), m) << " = " << mk_pp(var2expr(y), m) << "\n";);
|
||||
return;
|
||||
}
|
||||
context & ctx = get_context();
|
||||
enode * _x = get_enode(x);
|
||||
enode * _y = get_enode(y);
|
||||
// I doesn't make sense to propagate an equality (to the core) of variables of different sort.
|
||||
CTRACE("arith", _x->get_sort() != _y->get_sort(), tout << enode_pp(_x, ctx) << " = " << enode_pp(_y, ctx) << "\n");
|
||||
if (_x->get_sort() != _y->get_sort())
|
||||
return;
|
||||
|
||||
eq_vector const& eqs = antecedents.eqs();
|
||||
literal_vector const& lits = antecedents.lits();
|
||||
justification * js =
|
||||
|
@ -346,9 +341,9 @@ namespace smt {
|
|||
for (literal lit : lits)
|
||||
ctx.display_detailed_literal(tout, lit) << "\n";
|
||||
for (auto const& p : eqs)
|
||||
tout << pp(p.first, m) << " = " << pp(p.second, m) << "\n";
|
||||
tout << enode_pp(p.first, ctx) << " = " << enode_pp(p.second, ctx) << "\n";
|
||||
tout << " ==> ";
|
||||
tout << pp(_x, m) << " = " << pp(_y, m) << "\n";);
|
||||
tout << enode_pp(_x, ctx) << " = " << enode_pp(_y, ctx) << "\n";);
|
||||
ctx.assign_eq(_x, _y, eq_justification(js));
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue