diff --git a/src/bdd/mod.rs b/src/bdd/mod.rs index d47464b..b018354 100644 --- a/src/bdd/mod.rs +++ b/src/bdd/mod.rs @@ -1,5 +1,5 @@ use std::collections::{BTreeMap, BTreeSet}; -use std::fmt::Debug; +use std::fmt::{Debug, Display}; use std::num::TryFromIntError; use biodivine_lib_bdd::{Bdd as InnerBdd, BddVariable, BddVariableSet}; @@ -38,6 +38,13 @@ where bdd: InnerBdd, } +impl Bdd { + /// Creates the String-based `BddVariableSet` from `self` that `lib-bdd` operates with to map BDD node indexes to variables with names. + pub fn make_variable_set(&self) -> BddVariableSet { + BddVariableSet::from_iter(self.inputs.iter().map(ToString::to_string)) + } +} + impl Bdd { pub fn mk_const(value: bool) -> Bdd { let empty_set = BddVariableSet::new(&[]);