-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
41 additions
and
20 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,19 +1,28 @@ | ||
use { | ||
ddir::{ | ||
bdd::{ToBinaryDecisionDiagram, BDD}, | ||
dd::{sample1, DecisionDiagramTrait, DDT}, | ||
dd::{example1, example2, DecisionDiagramTrait, DDT}, | ||
}, | ||
std::fs::File, | ||
}; | ||
|
||
fn main() { | ||
// let stdout = io::stdout(); | ||
let idp1: DDT = sample1(); | ||
let idp1: DDT = example1(); | ||
assert_eq!(idp1.len(), 127); | ||
let f1 = File::create("ind-tree.gv").expect("fail to create"); | ||
idp1.write_as_gv(f1).expect("fail to serialize"); | ||
|
||
let idp2: BDD = sample1().to_bdd(); | ||
let idp2: BDD = example1().to_bdd(); | ||
let f2 = File::create("ind-bdd.gv").expect("fail to create"); | ||
idp2.write_as_gv(f2).expect("fail to serialize") | ||
idp2.write_as_gv(f2).expect("fail to serialize"); | ||
|
||
let majority1: DDT = example2(); | ||
let f3 = File::create("maj-tree.gv").expect("fail to create"); | ||
majority1.write_as_gv(f3).expect("fail to serialize"); | ||
let f4 = File::create("maj-bdd.gv").expect("fail to create"); | ||
majority1 | ||
.to_bdd() | ||
.write_as_gv(f4) | ||
.expect("fail to serialize"); | ||
} |