pub struct LeaderFinder { /* private fields */ }Expand description
Finds the leader of an equivalence class — the canonical variable that dominates all other members of the class.
In LCNF, dominance is determined by binding order (earlier binding dominates later bindings in the same scope).
Implementations§
Source§impl LeaderFinder
impl LeaderFinder
pub fn new() -> Self
Sourcepub fn record(&mut self, vn: ValueNumber, var: LcnfVarId)
pub fn record(&mut self, vn: ValueNumber, var: LcnfVarId)
Record that var belongs to equivalence class vn.
Sourcepub fn leader(&self, vn: ValueNumber) -> Option<LcnfVarId>
pub fn leader(&self, vn: ValueNumber) -> Option<LcnfVarId>
Return the leader of the equivalence class for vn.
Sourcepub fn members(&self, vn: ValueNumber) -> &[LcnfVarId]
pub fn members(&self, vn: ValueNumber) -> &[LcnfVarId]
Return all members of the equivalence class for vn.
Sourcepub fn num_redundancies(&self) -> usize
pub fn num_redundancies(&self) -> usize
Return the number of non-singleton equivalence classes.
Trait Implementations§
Source§impl Debug for LeaderFinder
impl Debug for LeaderFinder
Source§impl Default for LeaderFinder
impl Default for LeaderFinder
Source§fn default() -> LeaderFinder
fn default() -> LeaderFinder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LeaderFinder
impl RefUnwindSafe for LeaderFinder
impl Send for LeaderFinder
impl Sync for LeaderFinder
impl Unpin for LeaderFinder
impl UnsafeUnpin for LeaderFinder
impl UnwindSafe for LeaderFinder
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