pub struct BddManager { /* private fields */ }Expand description
A Binary Decision Diagram manager. Maintains a unique table to ensure node sharing and canonical representation.
Implementations§
Source§impl BddManager
impl BddManager
Sourcepub fn constant_false(&self) -> NodeId
pub fn constant_false(&self) -> NodeId
Returns the FALSE constant.
Sourcepub fn constant_true(&self) -> NodeId
pub fn constant_true(&self) -> NodeId
Returns the TRUE constant.
Sourcepub fn and(&mut self, left: NodeId, right: NodeId) -> NodeId
pub fn and(&mut self, left: NodeId, right: NodeId) -> NodeId
Computes the AND of two BDD nodes.
Sourcepub fn xor(&mut self, left: NodeId, right: NodeId) -> NodeId
pub fn xor(&mut self, left: NodeId, right: NodeId) -> NodeId
Computes the XOR of two BDD nodes.
Sourcepub fn implies(&mut self, left: NodeId, right: NodeId) -> NodeId
pub fn implies(&mut self, left: NodeId, right: NodeId) -> NodeId
Computes the implication: left => right (equivalent to !left | right)
Sourcepub fn iff(&mut self, left: NodeId, right: NodeId) -> NodeId
pub fn iff(&mut self, left: NodeId, right: NodeId) -> NodeId
Computes the equivalence: left <=> right
Sourcepub fn ite(
&mut self,
cond: NodeId,
then_node: NodeId,
else_node: NodeId,
) -> NodeId
pub fn ite( &mut self, cond: NodeId, then_node: NodeId, else_node: NodeId, ) -> NodeId
If-then-else operation: if cond then then_node else else_node
Sourcepub fn eval(&self, node: NodeId, assignment: &FxHashMap<VarId, bool>) -> bool
pub fn eval(&self, node: NodeId, assignment: &FxHashMap<VarId, bool>) -> bool
Evaluates a BDD with a given variable assignment.
Sourcepub fn sat_count(&self, node: NodeId, num_vars: u32) -> u64
pub fn sat_count(&self, node: NodeId, num_vars: u32) -> u64
Counts the number of satisfying assignments for a BDD.
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Returns the number of nodes in the manager.
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clears the operation cache (useful for memory management).
Trait Implementations§
Source§impl Clone for BddManager
impl Clone for BddManager
Source§fn clone(&self) -> BddManager
fn clone(&self) -> BddManager
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BddManager
impl Debug for BddManager
Source§impl Default for BddManager
impl Default for BddManager
Auto Trait Implementations§
impl Freeze for BddManager
impl RefUnwindSafe for BddManager
impl Send for BddManager
impl Sync for BddManager
impl Unpin for BddManager
impl UnsafeUnpin for BddManager
impl UnwindSafe for BddManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more