macro_rules! send_bcp_delta {
($self:ident, $variant:ident, $literal:expr, $clause:expr ) => {
if let Some(dispatcher) = &$self.dispatcher {
let delta = delta::BCP::$variant {
literal: $literal,
clause: $clause,
};
dispatcher(Dispatch::Delta(Delta::BCP(delta)));
}
};
}
pub(crate) use send_bcp_delta;
macro_rules! send_stats {
($self:ident ) => {
if let Some(dispatcher) = &$self.dispatcher {
let total_iterations = $self.counters.total_iterations;
let total_decisions = $self.counters.total_decisions;
let total_conflicts = $self.counters.total_conflicts;
dispatcher(Dispatch::Stat(Stat::Iterations(total_iterations)));
dispatcher(Dispatch::Stat(Stat::Chosen(total_decisions)));
dispatcher(Dispatch::Stat(Stat::Conflicts(total_conflicts)));
dispatcher(Dispatch::Stat(Stat::Time($self.counters.time)));
}
};
}
pub(crate) use send_stats;
macro_rules! send_finish {
($self:ident) => {
if let Some(dispatcher) = &$self.dispatcher {
dispatcher(Dispatch::Report(Report::Finish));
}
};
}
pub(crate) use send_finish;
macro_rules! send_resolution_delta {
( $self:ident, $dispatch:expr ) => {
if let Some(dispatcher) = &$self.dispatcher {
dispatcher(Dispatch::Delta(delta::Delta::Resolution($dispatch)));
}
};
}
pub(crate) use send_resolution_delta;
macro_rules! send_atom_db_delta {
( $self:ident, $dispatch:expr ) => {
if let Some(dispatcher) = &$self.dispatcher {
dispatcher(Dispatch::Delta(delta::Delta::AtomDB($dispatch)));
}
};
}
pub(crate) use send_atom_db_delta;
macro_rules! send_remove {
($self:ident, $clause:expr) => {
if let Some(dispatcher) = &$self.dispatcher {
let delta = delta::ClauseDB::ClauseStart;
dispatcher(Dispatch::Delta(Delta::ClauseDB(delta)));
for literal in $clause.into_iter() {
let delta = delta::ClauseDB::ClauseLiteral(*literal);
dispatcher(Dispatch::Delta(Delta::ClauseDB(delta)));
}
let delta = delta::ClauseDB::Deletion($clause.key());
dispatcher(Dispatch::Delta(Delta::ClauseDB(delta)));
}
};
}
pub(crate) use send_remove;