Enum SddPtr

Source
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>

Source

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

Source

pub fn scratch<T: ?Sized + Clone + 'static>(&self) -> Option<T>

Gets the scratch value stored in &self

Source

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)

Source

pub fn is_scratch_cleared(&self) -> bool

Source

pub fn clear_scratch(&self)

recursively traverses the SDD and clears all scratch

Source

pub fn is_const(&self) -> bool

Source

pub fn is_var(&self) -> bool

Source

pub fn is_neg_var(&self) -> bool

Source

pub fn is_pos_var(&self) -> bool

Source

pub fn is_bdd(&self) -> bool

Source

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

Source

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

Source

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

Source

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

Source

pub fn is_canonical(&self) -> bool

Source

pub fn is_compressed(&self) -> bool

Source

pub fn is_trimmed(&self) -> bool

Trait Implementations§

Source§

impl<'a> Clone for SddPtr<'a>

Source§

fn clone(&self) -> SddPtr<'a>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> DDNNFPtr<'a> for SddPtr<'a>

Source§

fn is_neg(&self) -> bool

true if the node is complemented

Source§

fn fold<T: 'static + Clone + Copy + Debug, F: Fn(DDNNF<T>) -> T>( &self, f: F, ) -> T

performs a memoized bottom-up pass with aggregating function f calls
Source§

fn count_nodes(&self) -> usize

count the number of nodes in this representation
Source§

fn false_ptr() -> SddPtr<'a>

Generate a pointer to the false constant
Source§

fn true_ptr() -> SddPtr<'a>

Generate a pointer to the true constant
Source§

fn is_true(&self) -> bool

True if self is a true constant, false otherwise
Source§

fn is_false(&self) -> bool

True if self is a false constant, false otherwise
Source§

fn neg(&self) -> Self

Negate the pointer
Source§

fn unsmoothed_wmc<T>(&self, params: &WmcParams<T>) -> T
where T: 'static + Semiring + Add<Output = T> + Mul<Output = T>,

Unsmoothed weighted-model count
Source§

fn evaluate(&self, instantations: &[bool]) -> bool

Source§

fn semantic_hash<const P: u128>( &self, map: &WmcParams<FiniteField<P>>, ) -> FiniteField<P>

compute the semantic hash for this pointer
Source§

impl<'a> Debug for SddPtr<'a>

Source§

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

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

impl<'a> Hash for SddPtr<'a>

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'a> Ord for SddPtr<'a>

Source§

fn cmp(&self, other: &SddPtr<'a>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<'a> PartialEq for SddPtr<'a>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialOrd for SddPtr<'a>

Source§

fn partial_cmp(&self, other: &SddPtr<'a>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<'a> Copy for SddPtr<'a>

Source§

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> 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<'a, T> BottomUpBuilder<'a, SddPtr<'a>> for T
where T: SddBuilder<'a>,

Source§

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>

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>

Computes the SDD representing the logical function f <=> g

Source§

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>

Existentially quantifies out the variable lbl from f

Source§

fn compile_cnf(&'a self, cnf: &Cnf) -> SddPtr<'a>

compile an SDD from an input CNF

Source§

fn true_ptr(&self) -> SddPtr<'a>

Source§

fn false_ptr(&self) -> SddPtr<'a>

Source§

fn var(&'a self, label: VarLabel, polarity: bool) -> SddPtr<'a>

Source§

fn negate(&'a self, f: SddPtr<'a>) -> SddPtr<'a>

Source§

fn eq(&'a self, a: SddPtr<'a>, b: SddPtr<'a>) -> bool

Test for semantic equality (not pointer/structural equality)
Source§

fn and(&'a self, a: SddPtr<'a>, b: SddPtr<'a>) -> SddPtr<'a>

Source§

fn or(&'a self, a: Ptr, b: Ptr) -> Ptr

Compute the Boolean function f || g by default, or is defined using de morgan’s law as and
Source§

fn compose(&'a self, f: Ptr, lbl: VarLabel, g: Ptr) -> Ptr

compose g into f for variable v I.e., computes the logical function (exists v. (g <=> v) /\ f).
Source§

fn compile_logical_expr(&'a self, expr: &LogicalExpr) -> Ptr

directly compile a logical expression
Source§

fn compile_plan(&'a self, expr: &BottomUpPlan) -> Ptr

Compiles from a BottomUpPlan, which represents a deferred computation
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

Source§

impl<N> NodeTrait for N
where N: Copy + Ord + Hash,