mirror of
https://github.com/Z3Prover/z3
synced 2025-04-15 13:28:47 +00:00
fix bug in tracking levels of variables: levels are not cleared, only truth assignment
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
48e37b0e16
commit
ed0b2be618
|
@ -61,13 +61,12 @@ namespace opt {
|
|||
return is_sat;
|
||||
}
|
||||
m_upper = m_lower;
|
||||
bool was_sat = false;
|
||||
expr_ref_vector asms(m);
|
||||
vector<expr_ref_vector> cores;
|
||||
|
||||
obj_map<expr, rational>::iterator it = soft.begin(), end = soft.end();
|
||||
for (; it != end; ++it) {
|
||||
expr* c = assert_weighted(wth(), it->m_key, it->m_value);
|
||||
assert_weighted(wth(), it->m_key, it->m_value);
|
||||
if (!is_true(it->m_key)) {
|
||||
m_upper += it->m_value;
|
||||
}
|
||||
|
@ -97,7 +96,6 @@ namespace opt {
|
|||
expr_ref fml = wth().mk_block();
|
||||
//DEBUG_CODE(verify_cores(cores););
|
||||
s().assert_expr(fml);
|
||||
was_sat = true;
|
||||
}
|
||||
else {
|
||||
//DEBUG_CODE(verify_cores(cores););
|
||||
|
|
|
@ -3162,7 +3162,7 @@ static void back_remove(sat::literal_vector& lits, sat::literal l) {
|
|||
return;
|
||||
}
|
||||
}
|
||||
std::cout << "UNREACHABLE\n";
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
static void brute_force_consequences(sat::solver& s, sat::literal_vector const& asms, sat::literal_vector const& gamma, vector<sat::literal_vector>& conseq) {
|
||||
|
@ -3259,9 +3259,12 @@ static void back_remove(sat::literal_vector& lits, sat::literal l) {
|
|||
}
|
||||
}
|
||||
|
||||
// is_sat = core_chunking(*this, mdl, vars, asms, conseq, 100);
|
||||
|
||||
if (false && asms.empty()) {
|
||||
is_sat = core_chunking(*this, mdl, vars, asms, conseq, 100);
|
||||
}
|
||||
else {
|
||||
is_sat = get_consequences(asms, lits, conseq);
|
||||
}
|
||||
set_model(mdl);
|
||||
return is_sat;
|
||||
}
|
||||
|
@ -3390,8 +3393,7 @@ static void back_remove(sat::literal_vector& lits, sat::literal l) {
|
|||
literal lit = *it;
|
||||
if (value(lit) != l_undef) {
|
||||
++num_fixed;
|
||||
if (lvl(lit) <= 1) {
|
||||
SASSERT(value(lit) == l_true);
|
||||
if (lvl(lit) <= 1 && value(lit) == l_true) {
|
||||
extract_fixed_consequences(lit, assumptions, unfixed_vars, conseq);
|
||||
}
|
||||
continue;
|
||||
|
@ -3498,8 +3500,9 @@ static void back_remove(sat::literal_vector& lits, sat::literal l) {
|
|||
literal_set::iterator it = unfixed_lits.begin(), end = unfixed_lits.end();
|
||||
for (; it != end; ++it) {
|
||||
literal lit = *it;
|
||||
if (lvl(lit) <= 1) {
|
||||
SASSERT(value(lit) == l_true);
|
||||
TRACE("sat", tout << "extract: " << lit << " " << value(lit) << " " << lvl(lit) << "\n";);
|
||||
|
||||
if (lvl(lit) <= 1 && value(lit) == l_true) {
|
||||
extract_fixed_consequences(lit, assumptions, unfixed_vars, conseq);
|
||||
}
|
||||
}
|
||||
|
@ -3508,8 +3511,8 @@ static void back_remove(sat::literal_vector& lits, sat::literal l) {
|
|||
bool solver::check_domain(literal lit, literal lit2) {
|
||||
if (!m_antecedents.contains(lit2.var())) {
|
||||
SASSERT(value(lit2) == l_true);
|
||||
SASSERT(m_todo_antecedents.empty() || m_todo_antecedents.back() != lit2);
|
||||
m_todo_antecedents.push_back(lit2);
|
||||
TRACE("sat", tout << "todo: " << lit2 << " " << value(lit2) << "\n";);
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Reference in a new issue