pub trait PseudoBooleanFunction: Function {
type Number: NumberBase;
Show 15 methods
// Required methods
fn new_var<'id>(manager: &mut Self::Manager<'id>) -> AllocResult<Self>;
fn constant_edge<'id>(
manager: &Self::Manager<'id>,
value: Self::Number,
) -> AllocResult<EdgeOfFunc<'id, Self>>;
fn add_edge<'id>(
manager: &Self::Manager<'id>,
lhs: &EdgeOfFunc<'id, Self>,
rhs: &EdgeOfFunc<'id, Self>,
) -> AllocResult<EdgeOfFunc<'id, Self>>;
fn sub_edge<'id>(
manager: &Self::Manager<'id>,
lhs: &EdgeOfFunc<'id, Self>,
rhs: &EdgeOfFunc<'id, Self>,
) -> AllocResult<EdgeOfFunc<'id, Self>>;
fn mul_edge<'id>(
manager: &Self::Manager<'id>,
lhs: &EdgeOfFunc<'id, Self>,
rhs: &EdgeOfFunc<'id, Self>,
) -> AllocResult<EdgeOfFunc<'id, Self>>;
fn div_edge<'id>(
manager: &Self::Manager<'id>,
lhs: &EdgeOfFunc<'id, Self>,
rhs: &EdgeOfFunc<'id, Self>,
) -> AllocResult<EdgeOfFunc<'id, Self>>;
fn min_edge<'id>(
manager: &Self::Manager<'id>,
lhs: &EdgeOfFunc<'id, Self>,
rhs: &EdgeOfFunc<'id, Self>,
) -> AllocResult<EdgeOfFunc<'id, Self>>;
fn max_edge<'id>(
manager: &Self::Manager<'id>,
lhs: &EdgeOfFunc<'id, Self>,
rhs: &EdgeOfFunc<'id, Self>,
) -> AllocResult<EdgeOfFunc<'id, Self>>;
// Provided methods
fn constant<'id>(
manager: &Self::Manager<'id>,
value: Self::Number,
) -> AllocResult<Self> { ... }
fn add(&self, rhs: &Self) -> AllocResult<Self> { ... }
fn sub(&self, rhs: &Self) -> AllocResult<Self> { ... }
fn mul(&self, rhs: &Self) -> AllocResult<Self> { ... }
fn div(&self, rhs: &Self) -> AllocResult<Self> { ... }
fn min(&self, rhs: &Self) -> AllocResult<Self> { ... }
fn max(&self, rhs: &Self) -> AllocResult<Self> { ... }
}
Expand description
Pseudo-Boolean function 𝔹ⁿ → ℝ
Required Associated Types§
Sourcetype Number: NumberBase
type Number: NumberBase
The number type used for the functions’ target set.
Required Methods§
Sourcefn new_var<'id>(manager: &mut Self::Manager<'id>) -> AllocResult<Self>
fn new_var<'id>(manager: &mut Self::Manager<'id>) -> AllocResult<Self>
Get a fresh variable, i.e. a function that is 1 if the variable is true and 0 otherwise. This adds a new level to a decision diagram.
Sourcefn constant_edge<'id>(
manager: &Self::Manager<'id>,
value: Self::Number,
) -> AllocResult<EdgeOfFunc<'id, Self>>
fn constant_edge<'id>( manager: &Self::Manager<'id>, value: Self::Number, ) -> AllocResult<EdgeOfFunc<'id, Self>>
Get the constant value
, edge version
Sourcefn add_edge<'id>(
manager: &Self::Manager<'id>,
lhs: &EdgeOfFunc<'id, Self>,
rhs: &EdgeOfFunc<'id, Self>,
) -> AllocResult<EdgeOfFunc<'id, Self>>
fn add_edge<'id>( manager: &Self::Manager<'id>, lhs: &EdgeOfFunc<'id, Self>, rhs: &EdgeOfFunc<'id, Self>, ) -> AllocResult<EdgeOfFunc<'id, Self>>
Point-wise addition self + rhs
, edge version
Sourcefn sub_edge<'id>(
manager: &Self::Manager<'id>,
lhs: &EdgeOfFunc<'id, Self>,
rhs: &EdgeOfFunc<'id, Self>,
) -> AllocResult<EdgeOfFunc<'id, Self>>
fn sub_edge<'id>( manager: &Self::Manager<'id>, lhs: &EdgeOfFunc<'id, Self>, rhs: &EdgeOfFunc<'id, Self>, ) -> AllocResult<EdgeOfFunc<'id, Self>>
Point-wise subtraction self - rhs
, edge version
Sourcefn mul_edge<'id>(
manager: &Self::Manager<'id>,
lhs: &EdgeOfFunc<'id, Self>,
rhs: &EdgeOfFunc<'id, Self>,
) -> AllocResult<EdgeOfFunc<'id, Self>>
fn mul_edge<'id>( manager: &Self::Manager<'id>, lhs: &EdgeOfFunc<'id, Self>, rhs: &EdgeOfFunc<'id, Self>, ) -> AllocResult<EdgeOfFunc<'id, Self>>
Point-wise multiplication self * rhs
, edge version
Sourcefn div_edge<'id>(
manager: &Self::Manager<'id>,
lhs: &EdgeOfFunc<'id, Self>,
rhs: &EdgeOfFunc<'id, Self>,
) -> AllocResult<EdgeOfFunc<'id, Self>>
fn div_edge<'id>( manager: &Self::Manager<'id>, lhs: &EdgeOfFunc<'id, Self>, rhs: &EdgeOfFunc<'id, Self>, ) -> AllocResult<EdgeOfFunc<'id, Self>>
Point-wise division self / rhs
, edge version
Sourcefn min_edge<'id>(
manager: &Self::Manager<'id>,
lhs: &EdgeOfFunc<'id, Self>,
rhs: &EdgeOfFunc<'id, Self>,
) -> AllocResult<EdgeOfFunc<'id, Self>>
fn min_edge<'id>( manager: &Self::Manager<'id>, lhs: &EdgeOfFunc<'id, Self>, rhs: &EdgeOfFunc<'id, Self>, ) -> AllocResult<EdgeOfFunc<'id, Self>>
Point-wise minimum min(self, rhs)
, edge version
Sourcefn max_edge<'id>(
manager: &Self::Manager<'id>,
lhs: &EdgeOfFunc<'id, Self>,
rhs: &EdgeOfFunc<'id, Self>,
) -> AllocResult<EdgeOfFunc<'id, Self>>
fn max_edge<'id>( manager: &Self::Manager<'id>, lhs: &EdgeOfFunc<'id, Self>, rhs: &EdgeOfFunc<'id, Self>, ) -> AllocResult<EdgeOfFunc<'id, Self>>
Point-wise maximum max(self, rhs)
, edge version
Provided Methods§
Sourcefn constant<'id>(
manager: &Self::Manager<'id>,
value: Self::Number,
) -> AllocResult<Self>
fn constant<'id>( manager: &Self::Manager<'id>, value: Self::Number, ) -> AllocResult<Self>
Get the constant value
Sourcefn add(&self, rhs: &Self) -> AllocResult<Self>
fn add(&self, rhs: &Self) -> AllocResult<Self>
Point-wise addition self + rhs
Locking behavior: acquires a shared manager lock
Panics if self
and rhs
do not belong to the same manager.
Sourcefn sub(&self, rhs: &Self) -> AllocResult<Self>
fn sub(&self, rhs: &Self) -> AllocResult<Self>
Point-wise subtraction self - rhs
Locking behavior: acquires a shared manager lock
Panics if self
and rhs
do not belong to the same manager.
Sourcefn mul(&self, rhs: &Self) -> AllocResult<Self>
fn mul(&self, rhs: &Self) -> AllocResult<Self>
Point-wise multiplication self * rhs
Locking behavior: acquires a shared manager lock
Panics if self
and rhs
do not belong to the same manager.
Sourcefn div(&self, rhs: &Self) -> AllocResult<Self>
fn div(&self, rhs: &Self) -> AllocResult<Self>
Point-wise division self / rhs
Locking behavior: acquires a shared manager lock
Panics if self
and rhs
do not belong to the same manager.
Sourcefn min(&self, rhs: &Self) -> AllocResult<Self>
fn min(&self, rhs: &Self) -> AllocResult<Self>
Point-wise minimum min(self, rhs)
Locking behavior: acquires a shared manager lock
Panics if self
and rhs
do not belong to the same manager.
Sourcefn max(&self, rhs: &Self) -> AllocResult<Self>
fn max(&self, rhs: &Self) -> AllocResult<Self>
Point-wise maximum max(self, rhs)
Locking behavior: acquires a shared manager lock
Panics if self
and rhs
do not belong to the same manager.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.