mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
fixes/debugging
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
4c81f8676c
commit
3f3bd5948f
5 changed files with 41 additions and 30 deletions
|
@ -146,7 +146,7 @@ namespace polysat {
|
|||
if (!c2->has_bvar() || l_undef == c2.bvalue(s))
|
||||
core.keep(c2); // adds propagation of c to the search stack
|
||||
core.reset();
|
||||
LOG("reduced to " << c2);
|
||||
LOG_H3("Polynomial superposition " << eq << " " << c << " reduced to " << c2);
|
||||
if (c2.bvalue(s) == l_false) {
|
||||
core.insert(eq);
|
||||
core.insert(c);
|
||||
|
@ -161,12 +161,10 @@ namespace polysat {
|
|||
}
|
||||
|
||||
bool ex_polynomial_superposition::try_explain(pvar v, conflict& core) {
|
||||
LOG_H3("Trying polynomial superposition...");
|
||||
reduce_by(v, core);
|
||||
lbool result = l_undef;
|
||||
while (result == l_undef)
|
||||
result = try_explain1(v, core);
|
||||
LOG("success? " << result);
|
||||
return result == l_true;
|
||||
}
|
||||
|
||||
|
|
|
@ -147,20 +147,26 @@ namespace polysat {
|
|||
auto c2 = s.ule(y, pddm.mk_val(y_lo));
|
||||
new_constraints.insert(c1);
|
||||
new_constraints.insert(c2);
|
||||
LOG("bounded " << bound << " : " << c1 << " " << c2);
|
||||
LOG("bounded " << bound << " : " << x << " " << x_max << " " << y << " " << y_max << " " << c1 << " " << c2);
|
||||
}
|
||||
|
||||
rational inf_saturate::max_value(pdd const& x) {
|
||||
if (x.is_var())
|
||||
return s.m_viable.max_viable(x.var());
|
||||
else if (x.is_val())
|
||||
return x.val();
|
||||
else
|
||||
return x.manager().max_value();
|
||||
}
|
||||
|
||||
// determine worst case upper bounds for x, y
|
||||
// then extract premises for a non-worst-case bound.
|
||||
void inf_saturate::push_omega(vector<signed_constraint>& new_constraints, pdd const& x, pdd const& y) {
|
||||
auto& pddm = x.manager();
|
||||
rational x_max = pddm.max_value();
|
||||
rational y_max = pddm.max_value();
|
||||
rational x_max = max_value(x);
|
||||
rational y_max = max_value(y);
|
||||
|
||||
if (x.is_var())
|
||||
x_max = s.m_viable.max_viable(x.var());
|
||||
if (y.is_var())
|
||||
y_max = s.m_viable.max_viable(y.var());
|
||||
LOG("pushing " << x << " " << y);
|
||||
|
||||
if (x_max * y_max > pddm.max_value())
|
||||
push_omega_bisect(new_constraints, x, x_max, y, y_max);
|
||||
|
|
|
@ -89,6 +89,8 @@ namespace polysat {
|
|||
// p := coeff*x*y where coeff_x = coeff*x, x a variable
|
||||
bool is_coeffxY(pdd const& coeff_x, pdd const& p, pdd& y);
|
||||
|
||||
rational max_value(pdd const& x);
|
||||
|
||||
public:
|
||||
inf_saturate(solver& s) : inference_engine(s) {}
|
||||
bool perform(pvar v, conflict& core) override;
|
||||
|
|
|
@ -489,7 +489,7 @@ namespace polysat {
|
|||
*/
|
||||
void solver::resolve_bool(sat::literal lit) {
|
||||
SASSERT(m_bvars.is_propagation(lit.var()));
|
||||
clause other = *m_bvars.reason(lit.var());
|
||||
clause const& other = *m_bvars.reason(lit.var());
|
||||
LOG_H3("resolve_bool: " << lit << " " << other);
|
||||
m_conflict.resolve(m_constraints, lit, other);
|
||||
}
|
||||
|
@ -518,7 +518,8 @@ namespace polysat {
|
|||
SASSERT(!lemma.empty());
|
||||
lemma.set_justified_var(v);
|
||||
add_lemma(lemma);
|
||||
decide_bool(lemma);
|
||||
if (!is_conflict())
|
||||
decide_bool(lemma);
|
||||
}
|
||||
|
||||
// Guess a literal from the given clause; returns the guessed constraint
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue