Skip to content

Commit

Permalink
IPASIR-UP: Use literals in the notify_assignment callback
Browse files Browse the repository at this point in the history
  • Loading branch information
Dekker1 committed Apr 30, 2024
1 parent 9941431 commit 03599e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
9 changes: 4 additions & 5 deletions crates/pindakaas/src/solver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,18 +138,17 @@ pub trait Propagator {
false
}

/// Method called to notify the propagator about assignments to observed
/// variables.
/// Method called to notify the propagator about assignments of literals
/// concerning observed variables.
///
/// The notification is not necessarily eager. It usually happens before the
/// call of propagator callbacks and when a driving clause is leading to an
/// assignment.
///
/// If [`persistent`] is set to `true`, then the assignment is known to
/// persist through backtracking.
fn notify_assignment(&mut self, var: Var, val: bool, persistent: bool) {
let _ = var;
let _ = val;
fn notify_assignment(&mut self, lit: Lit, persistent: bool) {
let _ = lit;
let _ = persistent;
}
fn notify_new_decision_level(&mut self) {}
Expand Down
3 changes: 1 addition & 2 deletions crates/pindakaas/src/solver/libloading.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,7 @@ pub(crate) unsafe extern "C" fn ipasir_notify_assignment_cb(
) {
let prop = &mut *(state as *mut IpasirPropStore);
let lit = crate::Lit(std::num::NonZeroI32::new(lit).unwrap());
prop.prop
.notify_assignment(lit.var(), !lit.is_negated(), is_fixed)
prop.prop.notify_assignment(lit, is_fixed)
}
#[cfg(feature = "ipasir-up")]
pub(crate) unsafe extern "C" fn ipasir_notify_new_decision_level_cb(state: *mut c_void) {
Expand Down

0 comments on commit 03599e7

Please sign in to comment.