[][src]Struct biodivine_lib_bdd::Bdd

pub struct Bdd(_);

An array-based encoding of the binary decision diagram implementing basic logical operations.

To create Bdds for atomic formulas, use a BddVariableSet.

Methods

impl Bdd[src]

Basic boolean logical operations for Bdds: $\neg, \land, \lor, \Rightarrow, \Leftrightarrow, \oplus$.

pub fn not(&self) -> Bdd[src]

Create a Bdd corresponding to the $\neg \phi$ formula, where $\phi$ is this Bdd.

pub fn and(&self, right: &Bdd) -> Bdd[src]

Create a Bdd corresponding to the $\phi \land \psi$ formula, where $\phi$ and $\psi$ are the two given Bdds.

pub fn or(&self, right: &Bdd) -> Bdd[src]

Create a Bdd corresponding to the $\phi \lor \psi$ formula, where $\phi$ and $\psi$ are the two given Bdds.

pub fn imp(&self, right: &Bdd) -> Bdd[src]

Create a Bdd corresponding to the $\phi \Rightarrow \psi$ formula, where $\phi$ and $\psi$ are the two given Bdds.

pub fn iff(&self, right: &Bdd) -> Bdd[src]

Create a Bdd corresponding to the $\phi \Leftrightarrow \psi$ formula, where $\phi$ and $\psi$ are the two given Bdds.

pub fn xor(&self, right: &Bdd) -> Bdd[src]

Create a Bdd corresponding to the $\phi \oplus \psi$ formula, where $\phi$ and $\psi$ are the two given Bdds.

pub fn and_not(&self, right: &Bdd) -> Bdd[src]

Create a Bdd corresponding to the $\phi \land \neg \psi$ formula, where $\phi$ and $\psi$ are the two given Bdds.

impl Bdd[src]

.dot export procedure for Bdds.

pub fn write_as_dot_string(
    &self,
    output: &mut dyn Write,
    variables: &BddVariableSet,
    zero_pruned: bool
) -> Result<(), Error>
[src]

Output this Bdd as a .dot string into the given output writer.

Variable names in the graph are resolved from the given BddVariableSet.

If zero_pruned is true, edges leading to zero are not shown. This can greatly simplify the graph without losing information.

pub fn to_dot_string(
    &self,
    variables: &BddVariableSet,
    zero_pruned: bool
) -> String
[src]

Convert this Bdd to a .dot string.

Variable names in the graph are resolved from the given BddVariableSet.

If zero_pruned is true, edges leading to zero are not shown. This can greatly simplify the graph without losing information.

impl Bdd[src]

Serialisation and deserialisation methods for Bdds.

pub fn write_as_bytes(&self, output: &mut dyn Write) -> Result<(), Error>[src]

Write this Bdd into the given output writer using a simple little-endian binary encoding.

pub fn read_as_bytes(input: &mut dyn Read) -> Result<Bdd, Error>[src]

Read a Bdd from a given input reader using a simple little-endian binary encoding.

pub fn to_string(&self) -> String[src]

Convert this Bdd to a serialized string.

pub fn from_string(bdd: &str) -> Bdd[src]

Read a Bdd from a serialized string.

pub fn to_bytes(&self) -> Vec<u8>[src]

Convert this Bdd to a byte vector.

pub fn from_bytes(data: &mut &[u8]) -> Bdd[src]

Read a Bdd from a byte vector.

impl Bdd[src]

Several useful (mostly internal) low-level utility methods for Bdds.

pub fn size(&self) -> usize[src]

The number of nodes in this Bdd. (Do not confuse with cardinality)

pub fn num_vars(&self) -> u16[src]

Number of variables in the corresponding BddVariableSet.

pub fn is_true(&self) -> bool[src]

True if this Bdd is exactly the true formula.

pub fn is_false(&self) -> bool[src]

True if this Bdd is exactly the false formula.

pub fn cardinality(&self) -> f64[src]

Approximately computes the number of valuations satisfying the formula given by this Bdd.

pub fn sat_witness(&self) -> Option<BddValuation>[src]

If the Bdd is satisfiable, return some BddValuation that satisfies the Bdd.

pub fn to_boolean_expression(
    &self,
    variables: &BddVariableSet
) -> BooleanExpression
[src]

Convert this Bdd to a BooleanExpression (using the variable names from the given BddVariableSet).

impl Bdd[src]

Methods for working with Bdd valuations.

pub fn eval_in(&self, valuation: &BddValuation) -> bool[src]

Evaluate this Bdd in a specified BddValuation.

Panics if the number of variables in the valuation is different than the Bdd.

Trait Implementations

impl Clone for Bdd[src]

impl Debug for Bdd[src]

impl Eq for Bdd[src]

impl Hash for Bdd[src]

impl PartialEq<Bdd> for Bdd[src]

impl StructuralEq for Bdd[src]

impl StructuralPartialEq for Bdd[src]

Auto Trait Implementations

impl RefUnwindSafe for Bdd

impl Send for Bdd

impl Sync for Bdd

impl Unpin for Bdd

impl UnwindSafe for Bdd

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.