Struct biodivine_lib_bdd::BddVariableSetBuilder
source · [−]pub struct BddVariableSetBuilder {
pub(crate) var_names: Vec<String>,
pub(crate) var_names_set: HashSet<String>,
}
Expand description
Used to safely initialize BddVariableSet
.
Note that some characters are not allowed in variable names (to allow safe serialisation,
formula parsers and export as .dot
, etc.).
These characters are !
, &
, |
, ^
, =
, <
, >
, (
and )
.
Fields
var_names: Vec<String>
var_names_set: HashSet<String>
Implementations
sourceimpl BddVariableSetBuilder
impl BddVariableSetBuilder
sourcepub fn new() -> BddVariableSetBuilder
pub fn new() -> BddVariableSetBuilder
Create a new builder without any variables.
sourcepub fn make_variable(&mut self, name: &str) -> BddVariable
pub fn make_variable(&mut self, name: &str) -> BddVariable
Create a new variable with the given name
. Returns a BddVariable
instance that can be later used to create and query actual BDDs.
Panics:
- Each variable name has to be unique.
- Currently, there can be at most 65535 variables.
- The name must not contain
!
,&
,|
,^
,=
,<
,>
,(
or)
.
sourcepub fn make<const X: usize>(&mut self, names: &[&str; X]) -> [BddVariable; X]
pub fn make<const X: usize>(&mut self, names: &[&str; X]) -> [BddVariable; X]
A more convenient version of make_variables
which allows irrefutable pattern matching
on the result, because it is an array instead of a vector.
sourcepub fn make_variables(&mut self, names: &[&str]) -> Vec<BddVariable>
pub fn make_variables(&mut self, names: &[&str]) -> Vec<BddVariable>
Similar to make_variable
, but allows creating multiple variables at the same time.
sourcepub fn build(self) -> BddVariableSet
pub fn build(self) -> BddVariableSet
Convert this builder to an actual variable set.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for BddVariableSetBuilder
impl Send for BddVariableSetBuilder
impl Sync for BddVariableSetBuilder
impl Unpin for BddVariableSetBuilder
impl UnwindSafe for BddVariableSetBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more