Skip to main content

DynamicPolyWatchdogCell

Struct DynamicPolyWatchdogCell 

Source
pub struct DynamicPolyWatchdogCell<'totdb> { /* private fields */ }
Expand description

Dynamic polynomial watchdog structure with a RefCell to a totalizer database rather than owning it.

§References

  • [1] Tobias Paxian and Sven Reimer and Bernd Becker: Dynamic Polynomial Watchdog Encoding for Solving Weighted MaxSAT, SAT 2018.

Implementations§

Source§

impl<'totdb> DynamicPolyWatchdogCell<'totdb>

Source

pub fn new( structure: &'totdb Structure, db: &'totdb RefCell<&'totdb mut Db>, ) -> Self

Constructs a new DPW encoding referencing a totalizer database

Source

pub fn depth(&self) -> usize

Gets the maximum depth of the tree

Trait Implementations§

Source§

impl BoundUpper for DynamicPolyWatchdogCell<'_>

Source§

fn encode_ub<Col, R>( &mut self, range: R, collector: &mut Col, var_manager: &mut dyn ManageVars, ) -> Result<(), OutOfMemory>

Lazily builds the pseudo-boolean encoding to enable upper bounds within a given range. var_manager is the variable manager to use for tracking new variables. A specific encoding might ignore the upper or lower end of the range. Read more
Source§

fn enforce_ub(&self, ub: usize) -> Result<Vec<Lit>, EnforceError>

Returns assumptions/units for enforcing an upper bound (weighted sum of lits <= ub). Make sure that BoundUpper::encode_ub has been called adequately and nothing has been called afterwards. Read more
Source§

fn coarse_ub(&self, ub: usize) -> usize

Gets the next smaller upper bound value that can be easily encoded. This is used for coarse convergence, e.g., with the DynamicPolyWatchdog encoding.
Source§

impl BoundUpperIncremental for DynamicPolyWatchdogCell<'_>

Source§

fn encode_ub_change<Col, R>( &mut self, range: R, collector: &mut Col, var_manager: &mut dyn ManageVars, ) -> Result<(), OutOfMemory>

Lazily builds the change in pseudo-boolean encoding to enable upper bounds from within the range. A change might be added literals or changed bounds. var_manager is the variable manager to use for tracking new variables. A specific encoding might ignore the lower or upper end of the range. Read more
Source§

impl<'totdb> Debug for DynamicPolyWatchdogCell<'totdb>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Encode for DynamicPolyWatchdogCell<'_>

Source§

fn weight_sum(&self) -> usize

Get the sum of weights in the encoding
Source§

fn next_higher(&self, val: usize) -> usize

Gets the next higher value possible to be achieved by the weighted sum. Might simply return val + 1 if no stronger value can be inferred.
Source§

fn next_lower(&self, val: usize) -> usize

Gets the next lower value possible to be achieved by the weighted sum. Might simply return val - 1 if no stronger value can be inferred.
Source§

impl EncodeIncremental for DynamicPolyWatchdogCell<'_>

Source§

fn reserve(&mut self, var_manager: &mut dyn ManageVars)

Reserves all variables this encoding might need

Auto Trait Implementations§

§

impl<'totdb> Freeze for DynamicPolyWatchdogCell<'totdb>

§

impl<'totdb> !RefUnwindSafe for DynamicPolyWatchdogCell<'totdb>

§

impl<'totdb> !Send for DynamicPolyWatchdogCell<'totdb>

§

impl<'totdb> !Sync for DynamicPolyWatchdogCell<'totdb>

§

impl<'totdb> Unpin for DynamicPolyWatchdogCell<'totdb>

§

impl<'totdb> UnsafeUnpin for DynamicPolyWatchdogCell<'totdb>

§

impl<'totdb> !UnwindSafe for DynamicPolyWatchdogCell<'totdb>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.