3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-06-27 19:08:49 +00:00

remove expr_ref from dependencies, only use literals that are true.

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2026-05-17 13:28:12 -07:00
parent b75acc5c14
commit 9d4feed0ae
10 changed files with 141 additions and 101 deletions

View file

@ -3748,13 +3748,20 @@ public:
return include_func_interp(n->get_decl());
}
bool get_lower(enode* n, rational& val, bool& is_strict) {
bool get_lower(enode *n, rational &val, bool &is_strict, literal_vector* lits = nullptr, enode_pair_vector* eqs = nullptr) {
if (a.is_numeral(n->get_expr(), val)) {
is_strict = false;
return true;
}
theory_var v = n->get_th_var(get_id());
if (!is_registered_var(v))
return false;
if (!is_registered_var(v))
return false;
lpvar vi = get_lpvar(v);
u_dependency* ci;
return lp().has_lower_bound(vi, ci, val, is_strict);
u_dependency *ci = nullptr;
bool r = lp().has_lower_bound(vi, ci, val, is_strict);
if (r && lits && eqs)
set_evidence(ci, *lits, *eqs);
return r;
}
bool get_lower(enode* n, expr_ref& r) {
@ -3767,13 +3774,21 @@ public:
return false;
}
bool get_upper(enode* n, rational& val, bool& is_strict) {
bool get_upper(enode *n, rational &val, bool &is_strict, literal_vector *lits = nullptr,
enode_pair_vector *eqs = nullptr) {
if (a.is_numeral(n->get_expr(), val)) {
is_strict = false;
return true;
}
theory_var v = n->get_th_var(get_id());
if (!is_registered_var(v))
return false;
lpvar vi = get_lpvar(v);
u_dependency* dep = nullptr;
return lp().has_upper_bound(vi, dep, val, is_strict);
bool r = lp().has_upper_bound(vi, dep, val, is_strict);
if (r && lits && eqs)
set_evidence(dep, *lits, *eqs);
return r;
}
void solve_fixed(enode* n, lpvar j, expr_ref& term, expr_ref& guard) {
@ -4483,6 +4498,13 @@ bool theory_lra::get_upper(enode* n, rational& r, bool& is_strict) {
return m_imp->get_upper(n, r, is_strict);
}
bool theory_lra::get_lower(enode* n, rational& r, bool& is_strict, literal_vector& core, enode_pair_vector& eqs) {
return m_imp->get_lower(n, r, is_strict, &core, &eqs);
}
bool theory_lra::get_upper(enode* n, rational& r, bool& is_strict, literal_vector& core, enode_pair_vector& eqs) {
return m_imp->get_upper(n, r, is_strict, &core, &eqs);
}
void theory_lra::solve_for(vector<solution>& sol) {
m_imp->solve_for(sol);
}