Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions solver/src/reasoners/sat/clauses/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ impl Display for ClauseId {
write!(f, "{}", usize::from(*self))
}
}
impl std::fmt::Debug for ClauseId {
fn fmt(&self, f: &mut Formatter) -> Result<(), Error> {
write!(f, "{}", usize::from(*self))
}
}

#[derive(Clone)]
pub struct ClauseDb {
Expand Down
3 changes: 3 additions & 0 deletions solver/src/reasoners/sat/sat_solver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,9 @@ impl SatSolver {
// process all clauses that have been added since last propagation
while let Some(PendingClause { clause }) = self.pending_clauses.pop_front() {
if let Some(conflict) = self.process_arbitrary_clause(clause, model) {
// the clause returned is violated before being properly set up.
// Add it back to the queue so that it is not forgotten if one is calling the solver again
self.pending_clauses.push_front(PendingClause { clause });
return Err(conflict);
}
}
Expand Down
Loading