From f6ae4957007800729a1022df90255c6c87e28a6a Mon Sep 17 00:00:00 2001 From: Stefan Ellmauthaler Date: Fri, 4 Mar 2022 15:03:02 +0100 Subject: [PATCH] ADD API function for accessing var_depencies --- lib/src/obdd.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/src/obdd.rs b/lib/src/obdd.rs index 1df1969..9bc7458 100644 --- a/lib/src/obdd.rs +++ b/lib/src/obdd.rs @@ -2,7 +2,6 @@ pub mod vectorize; use crate::datatypes::*; use serde::{Deserialize, Serialize}; -#[cfg(feature = "HashSet")] use std::collections::HashSet; use std::{cell::RefCell, cmp::min, collections::HashMap, fmt::Display}; @@ -211,6 +210,8 @@ impl Bdd { } /// Computes the number of counter-models and models for a given BDD-tree + /// + /// Use the flag `_memoization` to choose between using the memoization approach or not. (This flag does nothing if the feature `adhoccounting` is used) pub fn models(&self, term: Term, _memoization: bool) -> ModelCounts { #[cfg(feature = "adhoccounting")] { @@ -314,6 +315,15 @@ impl Bdd { } }); } + + pub fn var_depencies(self, tree: Term) -> HashSet { + #[cfg(feature = "variablelist")] + { + return self.var_deps[tree.value()].clone(); + } + HashSet::new() + // TODO! + } } #[cfg(test)]