-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: check trimming, compression; global node storage
- Loading branch information
Showing
5 changed files
with
652 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
use crate::options::{GcSchedule, InitialVTree, SDDOptions, VTreeStrategy}; | ||
use crate::manager::SddManager; | ||
use crate::options::{GcSchedule, InitialVTree, SddOptions, VTreeStrategy}; | ||
|
||
pub mod manager; | ||
pub mod options; | ||
pub mod sdd; | ||
pub mod structs; | ||
pub mod literal; | ||
pub mod vtree; | ||
|
||
fn main() { | ||
let options = SDDOptions::default() | ||
let options = SddOptions::default() | ||
.set_gc_schedule(GcSchedule::Automatic(1120)) | ||
.set_gc_strategy(VTreeStrategy::Cycle) | ||
.set_initial_vtree(InitialVTree::Balanced) | ||
.to_owned(); | ||
|
||
#[allow(unused)] | ||
let mut manager = sdd::SDDManager::new(options); | ||
let mut manager = SddManager::new(options); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
use std::collections::HashMap; | ||
|
||
use crate::literal::VarLabelManager; | ||
use crate::options::SddOptions; | ||
use crate::sdd::Node; | ||
use crate::sdd::Sdd; | ||
use crate::vtree::VTreeManager; | ||
|
||
#[allow(clippy::module_name_repetitions)] | ||
pub struct SddManager { | ||
options: SddOptions, | ||
|
||
vtree_manager: VTreeManager, | ||
|
||
var_label_manager: VarLabelManager, | ||
|
||
nodes: HashMap<u64, Node>, | ||
} | ||
|
||
impl SddManager { | ||
#[must_use] | ||
pub fn new(options: SddOptions) -> SddManager { | ||
SddManager { | ||
options, | ||
vtree_manager: VTreeManager::new(), | ||
var_label_manager: VarLabelManager::new(), | ||
nodes: HashMap::new(), | ||
} | ||
} | ||
|
||
#[must_use] | ||
pub fn new_with_nodes(options: SddOptions, nodes: HashMap<u64, Node>) -> SddManager { | ||
SddManager { | ||
options, | ||
vtree_manager: VTreeManager::new(), | ||
var_label_manager: VarLabelManager::new(), | ||
nodes, | ||
} | ||
} | ||
|
||
#[must_use] | ||
pub fn get_node(&self, id: &u64) -> Option<&Node> { | ||
self.nodes.get(id) | ||
} | ||
|
||
pub fn conjoin(&self, _fst: &Sdd, _snd: &Sdd) {} | ||
pub fn disjoin(&self, _fst: &Sdd, _snd: &Sdd) {} | ||
pub fn negate(&self, _fst: &Sdd) {} | ||
pub fn imply(&self, _fst: &Sdd, _snd: &Sdd) {} | ||
pub fn equiv(&self, _fst: &Sdd, _snd: &Sdd) {} | ||
|
||
pub fn condition() {} | ||
pub fn exist() {} | ||
pub fn forall() {} | ||
|
||
// TODO: expose operations manipulating the vtree. | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.