pub enum SddPtr<'a> {
PtrTrue,
PtrFalse,
BDD(&'a BinarySDD<'a>),
ComplBDD(&'a BinarySDD<'a>),
Var(VarLabel, bool),
Compl(&'a SddOr<'a>),
Reg(&'a SddOr<'a>),
}
Variants§
PtrTrue
PtrFalse
BDD(&'a BinarySDD<'a>)
ComplBDD(&'a BinarySDD<'a>)
Var(VarLabel, bool)
Compl(&'a SddOr<'a>)
Reg(&'a SddOr<'a>)
Implementations§
Source§impl<'a> SddPtr<'a>
impl<'a> SddPtr<'a>
Sourcepub fn cached_semantic_hash<const P: u128>(
&self,
vtree: &VTreeManager,
map: &WmcParams<FiniteField<P>>,
) -> FiniteField<P>
pub fn cached_semantic_hash<const P: u128>( &self, vtree: &VTreeManager, map: &WmcParams<FiniteField<P>>, ) -> FiniteField<P>
performs a semantic hash and caches the result on the node
Sourcepub fn scratch<T: ?Sized + Clone + 'static>(&self) -> Option<T>
pub fn scratch<T: ?Sized + Clone + 'static>(&self) -> Option<T>
Gets the scratch value stored in &self
Sourcepub fn set_scratch<T: 'static>(&self, v: T)
pub fn set_scratch<T: 'static>(&self, v: T)
Set the scratch in this node to the value v
.
Panics if not a node.
Invariant: values stored in set_scratch
must not outlive
the provided allocator alloc
(i.e., calling scratch
involves dereferencing a pointer stored in alloc
)
pub fn is_scratch_cleared(&self) -> bool
Sourcepub fn clear_scratch(&self)
pub fn clear_scratch(&self)
recursively traverses the SDD and clears all scratch
pub fn is_const(&self) -> bool
pub fn is_var(&self) -> bool
pub fn is_neg_var(&self) -> bool
pub fn is_pos_var(&self) -> bool
pub fn is_bdd(&self) -> bool
Sourcepub fn low(&self) -> SddPtr<'a>
pub fn low(&self) -> SddPtr<'a>
gets the low pointer of a BDD negates the returned pointer if the root is negated
panics if not a bdd pointer
Sourcepub fn high(&self) -> SddPtr<'a>
pub fn high(&self) -> SddPtr<'a>
gets the high pointer of a BDD negates the returned pointer if the root is negated
panics if not a bdd pointer
Sourcepub fn node_iter(&self) -> impl Iterator<Item = SddAnd<'a>>
pub fn node_iter(&self) -> impl Iterator<Item = SddAnd<'a>>
get an iterator to all the (prime, sub) pairs this node points to panics if not an or-node
Sourcepub fn vtree(&self) -> VTreeIndex
pub fn vtree(&self) -> VTreeIndex
retrieve the vtree index (as its index in a left-first depth-first traversal)
panics if this is not a node
pub fn is_canonical(&self) -> bool
pub fn is_compressed(&self) -> bool
pub fn is_trimmed(&self) -> bool
Trait Implementations§
Source§impl<'a> DDNNFPtr<'a> for SddPtr<'a>
impl<'a> DDNNFPtr<'a> for SddPtr<'a>
Source§fn fold<T: 'static + Clone + Copy + Debug, F: Fn(DDNNF<T>) -> T>(
&self,
f: F,
) -> T
fn fold<T: 'static + Clone + Copy + Debug, F: Fn(DDNNF<T>) -> T>( &self, f: F, ) -> T
f
callsSource§fn count_nodes(&self) -> usize
fn count_nodes(&self) -> usize
Source§fn unsmoothed_wmc<T>(&self, params: &WmcParams<T>) -> T
fn unsmoothed_wmc<T>(&self, params: &WmcParams<T>) -> T
fn evaluate(&self, instantations: &[bool]) -> bool
Source§fn semantic_hash<const P: u128>(
&self,
map: &WmcParams<FiniteField<P>>,
) -> FiniteField<P>
fn semantic_hash<const P: u128>( &self, map: &WmcParams<FiniteField<P>>, ) -> FiniteField<P>
Source§impl<'a> Ord for SddPtr<'a>
impl<'a> Ord for SddPtr<'a>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<'a> PartialOrd for SddPtr<'a>
impl<'a> PartialOrd for SddPtr<'a>
impl<'a> Copy for SddPtr<'a>
impl<'a> Eq for SddPtr<'a>
Auto Trait Implementations§
impl<'a> Freeze for SddPtr<'a>
impl<'a> !RefUnwindSafe for SddPtr<'a>
impl<'a> !Send for SddPtr<'a>
impl<'a> !Sync for SddPtr<'a>
impl<'a> Unpin for SddPtr<'a>
impl<'a> !UnwindSafe for SddPtr<'a>
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
Source§impl<'a, T> BottomUpBuilder<'a, SddPtr<'a>> for Twhere
T: SddBuilder<'a>,
impl<'a, T> BottomUpBuilder<'a, SddPtr<'a>> for Twhere
T: SddBuilder<'a>,
Source§fn condition(&'a self, f: SddPtr<'a>, lbl: VarLabel, value: bool) -> SddPtr<'a>
fn condition(&'a self, f: SddPtr<'a>, lbl: VarLabel, value: bool) -> SddPtr<'a>
Computes f | var = value
TODO: This is highly inefficient, will re-traverse nodes, needs a cache
TODO : this can bail out early by checking the vtree
Source§fn ite(&'a self, f: SddPtr<'a>, g: SddPtr<'a>, h: SddPtr<'a>) -> SddPtr<'a>
fn ite(&'a self, f: SddPtr<'a>, g: SddPtr<'a>, h: SddPtr<'a>) -> SddPtr<'a>
Computes the SDD representing the logical function if f then g else h
Source§fn iff(&'a self, f: SddPtr<'a>, g: SddPtr<'a>) -> SddPtr<'a>
fn iff(&'a self, f: SddPtr<'a>, g: SddPtr<'a>) -> SddPtr<'a>
Computes the SDD representing the logical function f <=> g
Source§fn xor(&'a self, f: SddPtr<'a>, g: SddPtr<'a>) -> SddPtr<'a>
fn xor(&'a self, f: SddPtr<'a>, g: SddPtr<'a>) -> SddPtr<'a>
Computes the SDD representing the logical function f xor g
Source§fn exists(&'a self, sdd: SddPtr<'a>, lbl: VarLabel) -> SddPtr<'a>
fn exists(&'a self, sdd: SddPtr<'a>, lbl: VarLabel) -> SddPtr<'a>
Existentially quantifies out the variable lbl
from f
Source§fn compile_cnf(&'a self, cnf: &Cnf) -> SddPtr<'a>
fn compile_cnf(&'a self, cnf: &Cnf) -> SddPtr<'a>
compile an SDD from an input CNF
fn true_ptr(&self) -> SddPtr<'a>
fn false_ptr(&self) -> SddPtr<'a>
fn var(&'a self, label: VarLabel, polarity: bool) -> SddPtr<'a>
fn negate(&'a self, f: SddPtr<'a>) -> SddPtr<'a>
Source§fn eq(&'a self, a: SddPtr<'a>, b: SddPtr<'a>) -> bool
fn eq(&'a self, a: SddPtr<'a>, b: SddPtr<'a>) -> bool
fn and(&'a self, a: SddPtr<'a>, b: SddPtr<'a>) -> SddPtr<'a>
Source§fn or(&'a self, a: Ptr, b: Ptr) -> Ptr
fn or(&'a self, a: Ptr, b: Ptr) -> Ptr
f || g
by default, or is defined using de morgan’s law as andSource§fn compose(&'a self, f: Ptr, lbl: VarLabel, g: Ptr) -> Ptr
fn compose(&'a self, f: Ptr, lbl: VarLabel, g: Ptr) -> Ptr
Source§fn compile_logical_expr(&'a self, expr: &LogicalExpr) -> Ptr
fn compile_logical_expr(&'a self, expr: &LogicalExpr) -> Ptr
Source§fn compile_plan(&'a self, expr: &BottomUpPlan) -> Ptr
fn compile_plan(&'a self, expr: &BottomUpPlan) -> Ptr
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.