Skip to content

Commit

Permalink
Nicer message when printing a BDD using an incompatible variable set.
Browse files Browse the repository at this point in the history
  • Loading branch information
daemontus committed Nov 24, 2023
1 parent 88f54f5 commit 2617d06
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/_impl_bdd/_impl_export_dot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ fn write_bdd_as_dot(
var_names: &[String],
zero_pruned: bool,
) -> Result<(), std::io::Error> {
if var_names.len() != (bdd.num_vars() as usize) {
panic!(
"Bdd is incompatible with the variable set ({} vs. {} variables)",
bdd.num_vars(),
var_names.len()
);
}
writeln!(output, "digraph G {{")?;
writeln!(
output,
Expand Down

0 comments on commit 2617d06

Please sign in to comment.