Skip to content

Commit

Permalink
feat(bdd): introduced public make_variable_set(&self)
Browse files Browse the repository at this point in the history
  • Loading branch information
AurumTheEnd committed May 22, 2024
1 parent 338abc0 commit 7f9d435
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/bdd/mod.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down Expand Up @@ -38,6 +38,13 @@ where
bdd: InnerBdd,
}

impl<TLiteral: Debug + Clone + Eq + Ord + Display> Bdd<TLiteral> {
/// 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<TLiteral: Debug + Clone + Eq + Ord> Bdd<TLiteral> {
pub fn mk_const(value: bool) -> Bdd<TLiteral> {
let empty_set = BddVariableSet::new(&[]);
Expand Down

0 comments on commit 7f9d435

Please sign in to comment.