Skip to content

Commit 0f79d79

Browse files
Fix wrong behavior on true assumption in satcheck_minisat2
A true assumption literal shall have no effect, whereas it, until now, disabled the assumptions.
1 parent 8d42d90 commit 0f79d79

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/solvers/sat/satcheck_minisat2.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -328,14 +328,16 @@ bool satcheck_minisat2_baset<T>::is_in_conflict(literalt a) const
328328
template<typename T>
329329
void satcheck_minisat2_baset<T>::set_assumptions(const bvt &bv)
330330
{
331-
assumptions=bv;
332-
333-
forall_literals(it, assumptions)
334-
if(it->is_true())
331+
// We filter out 'true' assumptions which cause an assertion violation
332+
// in Minisat2.
333+
assumptions.clear();
334+
for(const auto &assumption : bv)
335+
{
336+
if(!assumption.is_true())
335337
{
336-
assumptions.clear();
337-
break;
338+
assumptions.push_back(assumption);
338339
}
340+
}
339341
}
340342

341343
satcheck_minisat_no_simplifiert::satcheck_minisat_no_simplifiert(

0 commit comments

Comments
 (0)