mirror of
https://github.com/Z3Prover/z3
synced 2025-04-08 18:31:49 +00:00
This commit is contained in:
parent
eed87807c5
commit
c388d99c35
|
@ -128,6 +128,7 @@ namespace sat {
|
|||
std::function<void(unsigned sz, literal const* c, unsigned const* coeffs, unsigned k)>& pb) {
|
||||
return false;
|
||||
}
|
||||
virtual bool is_pb() { return false; }
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
@ -380,16 +380,14 @@ namespace sat {
|
|||
|
||||
if (m_config.phase_sticky()) {
|
||||
unsigned v = 0;
|
||||
for (var_info& vi : m_vars) {
|
||||
for (var_info& vi : m_vars)
|
||||
vi.m_bias = s.m_phase[v++] ? 98 : 2;
|
||||
}
|
||||
}
|
||||
|
||||
// copy units
|
||||
unsigned trail_sz = s.init_trail_size();
|
||||
for (unsigned i = 0; i < trail_sz; ++i) {
|
||||
for (unsigned i = 0; i < trail_sz; ++i)
|
||||
add_clause(1, s.m_trail.data() + i);
|
||||
}
|
||||
|
||||
// copy binary clauses
|
||||
{
|
||||
|
@ -410,9 +408,8 @@ namespace sat {
|
|||
}
|
||||
|
||||
// copy clauses
|
||||
for (clause* c : s.m_clauses) {
|
||||
for (clause* c : s.m_clauses)
|
||||
add_clause(c->size(), c->begin());
|
||||
}
|
||||
m_num_non_binary_clauses = s.m_clauses.size();
|
||||
|
||||
|
||||
|
@ -422,7 +419,7 @@ namespace sat {
|
|||
[&](unsigned sz, literal const* c, unsigned k) { add_cardinality(sz, c, k); };
|
||||
std::function<void(unsigned sz, literal const* c, unsigned const* coeffs, unsigned k)> pb =
|
||||
[&](unsigned sz, literal const* c, unsigned const* coeffs, unsigned k) { add_pb(sz, c, coeffs, k); };
|
||||
if (ext && !ext->extract_pb(card, pb))
|
||||
if (ext && (!ext->is_pb() || !ext->extract_pb(card, pb)))
|
||||
throw default_exception("local search is incomplete with extensions beyond PB");
|
||||
|
||||
if (_init) {
|
||||
|
|
|
@ -1396,7 +1396,8 @@ namespace sat {
|
|||
}
|
||||
};
|
||||
scoped_ls _ls(*this);
|
||||
if (inconsistent()) return l_false;
|
||||
if (inconsistent())
|
||||
return l_false;
|
||||
scoped_limits scoped_rl(rlimit());
|
||||
SASSERT(m_local_search);
|
||||
m_local_search->add(*this);
|
||||
|
|
|
@ -211,6 +211,7 @@ namespace pb {
|
|||
unsigned next_id() { return m_constraint_id++; }
|
||||
void set_non_learned(constraint& c);
|
||||
double get_reward(literal l, sat::ext_justification_idx idx, sat::literal_occs_fun& occs) const override;
|
||||
bool is_pb() override { return true; }
|
||||
|
||||
// cardinality
|
||||
lbool add_assign(card& c, literal lit);
|
||||
|
|
Loading…
Reference in a new issue