Skip to content

Commit

Permalink
Improve performance of 'bdd_isithvar' and 'bdd_isnithvar' based on BD…
Browse files Browse the repository at this point in the history
…D semantics
  • Loading branch information
SSoelvsten committed Nov 4, 2023
1 parent 0cbb687 commit 31ebf4c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/adiar/bdd/pred.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ namespace adiar
internal::node_stream<> ns(f);
const bdd::node_type root = ns.pull();

return root.low() == bdd::node_type::pointer_type(false)
&& root.high() == bdd::node_type::pointer_type(true);
adiar_assert(root.low() != root.high(),
"A reduced BDD cannot have identical children");

return root.high() == bdd::node_type::pointer_type(true);
}

bool bdd_isnithvar(const bdd& f)
Expand All @@ -56,8 +58,10 @@ namespace adiar
internal::node_stream<> ns(f);
const bdd::node_type root = ns.pull();

return root.low() == bdd::node_type::pointer_type(true)
&& root.high() == bdd::node_type::pointer_type(false);
adiar_assert(root.low() != root.high(),
"A reduced BDD cannot have identical children");

return root.low() == bdd::node_type::pointer_type(true);
}

bool bdd_equal(const exec_policy &ep, const bdd &f, const bdd &g)
Expand Down

0 comments on commit 31ebf4c

Please sign in to comment.