[−][src]Struct biodivine_lib_bdd::Bdd
An array-based encoding of the binary decision diagram implementing basic logical operations.
To create Bdd
s for atomic formulas, use a BddVariableSet
.
Methods
impl Bdd
[src]
Basic boolean logical operations for Bdd
s:
$\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 Bdd
s.
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 Bdd
s.
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 Bdd
s.
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 Bdd
s.
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 Bdd
s.
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 Bdd
s.
impl Bdd
[src]
.dot
export procedure for Bdd
s.
pub fn write_as_dot_string(
&self,
output: &mut dyn Write,
variables: &BddVariableSet,
zero_pruned: bool
) -> Result<(), Error>
[src]
&self,
output: &mut dyn Write,
variables: &BddVariableSet,
zero_pruned: bool
) -> Result<(), Error>
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]
&self,
variables: &BddVariableSet,
zero_pruned: bool
) -> String
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 Bdd
s.
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 Bdd
s.
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]
&self,
variables: &BddVariableSet
) -> BooleanExpression
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]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,