diff --git a/src/adiar/bdd/build.cpp b/src/adiar/bdd/build.cpp index 639ed75ec..e553af3f1 100644 --- a/src/adiar/bdd/build.cpp +++ b/src/adiar/bdd/build.cpp @@ -13,8 +13,9 @@ namespace adiar { - template - using bdd_chain_converter = internal::chain_converter; + template + using bdd_chain_converter = + internal::chain_converter; ////////////////////////////////////////////////////////////////////////////// bdd bdd_const(bool value) @@ -74,7 +75,7 @@ namespace adiar bdd bdd_and(const generator> &vars) { bdd_and_policy p; - bdd_chain_converter vars_wrapper(vars); + bdd_chain_converter vars_wrapper(vars); return internal::build_chain<>(p, vars_wrapper); } @@ -82,49 +83,25 @@ namespace adiar bdd bdd_and(const generator &vars) { bdd_and_policy p; - bdd_chain_converter vars_wrapper(vars); + bdd_chain_converter vars_wrapper(vars); return internal::build_chain<>(p, vars_wrapper); } ////////////////////////////////////////////////////////////////////////////// - // TODO: Remove `bdd_or_policy` in favour of using De Morgan's law with - // `bdd_and` - class bdd_or_policy : public bdd_policy - { - public: - static constexpr bool init_terminal = false; - - constexpr bool - skip(const bdd::label_type &) const - { return false; } - - inline typename bdd::node_type - make_node(const bdd::label_type &l, - const bdd::pointer_type &r, - const bool negated) const - { - const bdd::pointer_type low = negated ? bdd::pointer_type(true) : r; - const bdd::pointer_type high = negated ? r : bdd::pointer_type(true); - - return typename bdd::node_type(l, bdd::max_id, low, high); - } - }; - - bdd bdd_or(const generator> &vars) { - bdd_or_policy p; - bdd_chain_converter vars_wrapper(vars); + bdd_and_policy p; + bdd_chain_converter vars_wrapper(vars); - return internal::build_chain<>(p, vars_wrapper); + return bdd_not(internal::build_chain<>(p, vars_wrapper)); } bdd bdd_or(const generator &vars) { - bdd_or_policy p; - bdd_chain_converter vars_wrapper(vars); + bdd_and_policy p; + bdd_chain_converter vars_wrapper(vars); - return internal::build_chain<>(p, vars_wrapper); + return bdd_not(internal::build_chain<>(p, vars_wrapper)); } } diff --git a/test/adiar/bdd/test_build.cpp b/test/adiar/bdd/test_build.cpp index e2bd15bba..37360fb1a 100644 --- a/test/adiar/bdd/test_build.cpp +++ b/test/adiar/bdd/test_build.cpp @@ -1076,20 +1076,20 @@ go_bandit([]() { AssertThat(res->width, Is().EqualTo(0u)); - AssertThat(res->max_1level_cut[cut::Internal], Is().EqualTo(0u)); - AssertThat(res->max_1level_cut[cut::Internal_False], Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::Internal_True], Is().EqualTo(0u)); - AssertThat(res->max_1level_cut[cut::All], Is().EqualTo(1u)); + AssertThat(res.max_1level_cut(cut::Internal), Is().EqualTo(0u)); + AssertThat(res.max_1level_cut(cut::Internal_False), Is().EqualTo(1u)); + AssertThat(res.max_1level_cut(cut::Internal_True), Is().EqualTo(0u)); + AssertThat(res.max_1level_cut(cut::All), Is().EqualTo(1u)); - AssertThat(res->max_2level_cut[cut::Internal], Is().EqualTo(0u)); - AssertThat(res->max_2level_cut[cut::Internal_False], Is().EqualTo(1u)); - AssertThat(res->max_2level_cut[cut::Internal_True], Is().EqualTo(0u)); - AssertThat(res->max_2level_cut[cut::All], Is().EqualTo(1u)); + AssertThat(res.max_2level_cut(cut::Internal), Is().EqualTo(0u)); + AssertThat(res.max_2level_cut(cut::Internal_False), Is().EqualTo(1u)); + AssertThat(res.max_2level_cut(cut::Internal_True), Is().EqualTo(0u)); + AssertThat(res.max_2level_cut(cut::All), Is().EqualTo(1u)); AssertThat(bdd_iscanonical(res), Is().True()); - AssertThat(res->number_of_terminals[false], Is().EqualTo(1u)); - AssertThat(res->number_of_terminals[true], Is().EqualTo(0u)); + AssertThat(res.number_of_terminals(false), Is().EqualTo(1u)); + AssertThat(res.number_of_terminals(true), Is().EqualTo(0u)); }); it("can create x1", [&]() { @@ -1121,20 +1121,20 @@ go_bandit([]() { AssertThat(res->width, Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::Internal], Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::Internal_False], Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::Internal_True], Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::All], Is().EqualTo(2u)); + AssertThat(res.max_1level_cut(cut::Internal), Is().EqualTo(1u)); + AssertThat(res.max_1level_cut(cut::Internal_False), Is().EqualTo(1u)); + AssertThat(res.max_1level_cut(cut::Internal_True), Is().EqualTo(1u)); + AssertThat(res.max_1level_cut(cut::All), Is().EqualTo(2u)); - AssertThat(res->max_2level_cut[cut::Internal], Is().EqualTo(1u)); - AssertThat(res->max_2level_cut[cut::Internal_False], Is().EqualTo(1u)); - AssertThat(res->max_2level_cut[cut::Internal_True], Is().EqualTo(1u)); - AssertThat(res->max_2level_cut[cut::All], Is().EqualTo(2u)); + AssertThat(res.max_2level_cut(cut::Internal), Is().EqualTo(1u)); + AssertThat(res.max_2level_cut(cut::Internal_False), Is().EqualTo(1u)); + AssertThat(res.max_2level_cut(cut::Internal_True), Is().EqualTo(1u)); + AssertThat(res.max_2level_cut(cut::All), Is().EqualTo(2u)); AssertThat(bdd_iscanonical(res), Is().True()); - AssertThat(res->number_of_terminals[false], Is().EqualTo(1u)); - AssertThat(res->number_of_terminals[true], Is().EqualTo(1u)); + AssertThat(res.number_of_terminals(false), Is().EqualTo(1u)); + AssertThat(res.number_of_terminals(true), Is().EqualTo(1u)); }); it("can create -x1", [&]() { @@ -1166,20 +1166,20 @@ go_bandit([]() { AssertThat(res->width, Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::Internal], Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::Internal_False], Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::Internal_True], Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::All], Is().EqualTo(2u)); + AssertThat(res.max_1level_cut(cut::Internal), Is().EqualTo(1u)); + AssertThat(res.max_1level_cut(cut::Internal_False), Is().EqualTo(1u)); + AssertThat(res.max_1level_cut(cut::Internal_True), Is().EqualTo(1u)); + AssertThat(res.max_1level_cut(cut::All), Is().EqualTo(2u)); - AssertThat(res->max_2level_cut[cut::Internal], Is().EqualTo(1u)); - AssertThat(res->max_2level_cut[cut::Internal_False], Is().EqualTo(1u)); - AssertThat(res->max_2level_cut[cut::Internal_True], Is().EqualTo(1u)); - AssertThat(res->max_2level_cut[cut::All], Is().EqualTo(2u)); + AssertThat(res.max_2level_cut(cut::Internal), Is().EqualTo(1u)); + AssertThat(res.max_2level_cut(cut::Internal_False), Is().EqualTo(1u)); + AssertThat(res.max_2level_cut(cut::Internal_True), Is().EqualTo(1u)); + AssertThat(res.max_2level_cut(cut::All), Is().EqualTo(2u)); AssertThat(bdd_iscanonical(res), Is().True()); - AssertThat(res->number_of_terminals[false], Is().EqualTo(1u)); - AssertThat(res->number_of_terminals[true], Is().EqualTo(1u)); + AssertThat(res.number_of_terminals(false), Is().EqualTo(1u)); + AssertThat(res.number_of_terminals(true), Is().EqualTo(1u)); }); // TODO: more tests independent of iterators (and differentiating it from bdd_and) @@ -1203,20 +1203,20 @@ go_bandit([]() { AssertThat(res->width, Is().EqualTo(0u)); - AssertThat(res->max_1level_cut[cut::Internal], Is().EqualTo(0u)); - AssertThat(res->max_1level_cut[cut::Internal_False], Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::Internal_True], Is().EqualTo(0u)); - AssertThat(res->max_1level_cut[cut::All], Is().EqualTo(1u)); + AssertThat(res.max_1level_cut(cut::Internal), Is().EqualTo(0u)); + AssertThat(res.max_1level_cut(cut::Internal_False), Is().EqualTo(1u)); + AssertThat(res.max_1level_cut(cut::Internal_True), Is().EqualTo(0u)); + AssertThat(res.max_1level_cut(cut::All), Is().EqualTo(1u)); - AssertThat(res->max_2level_cut[cut::Internal], Is().EqualTo(0u)); - AssertThat(res->max_2level_cut[cut::Internal_False], Is().EqualTo(1u)); - AssertThat(res->max_2level_cut[cut::Internal_True], Is().EqualTo(0u)); - AssertThat(res->max_2level_cut[cut::All], Is().EqualTo(1u)); + AssertThat(res.max_2level_cut(cut::Internal), Is().EqualTo(0u)); + AssertThat(res.max_2level_cut(cut::Internal_False), Is().EqualTo(1u)); + AssertThat(res.max_2level_cut(cut::Internal_True), Is().EqualTo(0u)); + AssertThat(res.max_2level_cut(cut::All), Is().EqualTo(1u)); AssertThat(bdd_iscanonical(res), Is().True()); - AssertThat(res->number_of_terminals[false], Is().EqualTo(1u)); - AssertThat(res->number_of_terminals[true], Is().EqualTo(0u)); + AssertThat(res.number_of_terminals(false), Is().EqualTo(1u)); + AssertThat(res.number_of_terminals(true), Is().EqualTo(0u)); }); it("can create x1", [&]() { @@ -1245,20 +1245,20 @@ go_bandit([]() { AssertThat(res->width, Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::Internal], Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::Internal_False], Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::Internal_True], Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::All], Is().EqualTo(2u)); + AssertThat(res.max_1level_cut(cut::Internal), Is().EqualTo(1u)); + AssertThat(res.max_1level_cut(cut::Internal_False), Is().EqualTo(1u)); + AssertThat(res.max_1level_cut(cut::Internal_True), Is().EqualTo(1u)); + AssertThat(res.max_1level_cut(cut::All), Is().EqualTo(2u)); - AssertThat(res->max_2level_cut[cut::Internal], Is().EqualTo(1u)); - AssertThat(res->max_2level_cut[cut::Internal_False], Is().EqualTo(1u)); - AssertThat(res->max_2level_cut[cut::Internal_True], Is().EqualTo(1u)); - AssertThat(res->max_2level_cut[cut::All], Is().EqualTo(2u)); + AssertThat(res.max_2level_cut(cut::Internal), Is().EqualTo(1u)); + AssertThat(res.max_2level_cut(cut::Internal_False), Is().EqualTo(1u)); + AssertThat(res.max_2level_cut(cut::Internal_True), Is().EqualTo(1u)); + AssertThat(res.max_2level_cut(cut::All), Is().EqualTo(2u)); AssertThat(bdd_iscanonical(res), Is().True()); - AssertThat(res->number_of_terminals[false], Is().EqualTo(1u)); - AssertThat(res->number_of_terminals[true], Is().EqualTo(1u)); + AssertThat(res.number_of_terminals(false), Is().EqualTo(1u)); + AssertThat(res.number_of_terminals(true), Is().EqualTo(1u)); }); it("can create -x1", [&]() { @@ -1287,20 +1287,20 @@ go_bandit([]() { AssertThat(res->width, Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::Internal], Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::Internal_False], Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::Internal_True], Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::All], Is().EqualTo(2u)); + AssertThat(res.max_1level_cut(cut::Internal), Is().EqualTo(1u)); + AssertThat(res.max_1level_cut(cut::Internal_False), Is().EqualTo(1u)); + AssertThat(res.max_1level_cut(cut::Internal_True), Is().EqualTo(1u)); + AssertThat(res.max_1level_cut(cut::All), Is().EqualTo(2u)); - AssertThat(res->max_2level_cut[cut::Internal], Is().EqualTo(1u)); - AssertThat(res->max_2level_cut[cut::Internal_False], Is().EqualTo(1u)); - AssertThat(res->max_2level_cut[cut::Internal_True], Is().EqualTo(1u)); - AssertThat(res->max_2level_cut[cut::All], Is().EqualTo(2u)); + AssertThat(res.max_2level_cut(cut::Internal), Is().EqualTo(1u)); + AssertThat(res.max_2level_cut(cut::Internal_False), Is().EqualTo(1u)); + AssertThat(res.max_2level_cut(cut::Internal_True), Is().EqualTo(1u)); + AssertThat(res.max_2level_cut(cut::All), Is().EqualTo(2u)); AssertThat(bdd_iscanonical(res), Is().True()); - AssertThat(res->number_of_terminals[false], Is().EqualTo(1u)); - AssertThat(res->number_of_terminals[true], Is().EqualTo(1u)); + AssertThat(res.number_of_terminals(false), Is().EqualTo(1u)); + AssertThat(res.number_of_terminals(true), Is().EqualTo(1u)); }); // TODO: more tests independent of iterators (and differentiating it from bdd_and) @@ -1345,20 +1345,20 @@ go_bandit([]() { AssertThat(res->width, Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::Internal], Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::Internal_False], Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::Internal_True], Is().EqualTo(3u)); - AssertThat(res->max_1level_cut[cut::All], Is().EqualTo(4u)); + AssertThat(res.max_1level_cut(cut::Internal), Is().EqualTo(1u)); + AssertThat(res.max_1level_cut(cut::Internal_False), Is().EqualTo(1u)); + AssertThat(res.max_1level_cut(cut::Internal_True), Is().EqualTo(3u)); + AssertThat(res.max_1level_cut(cut::All), Is().EqualTo(4u)); - AssertThat(res->max_2level_cut[cut::Internal], Is().EqualTo(1u)); - AssertThat(res->max_2level_cut[cut::Internal_False], Is().EqualTo(1u)); - AssertThat(res->max_2level_cut[cut::Internal_True], Is().EqualTo(3u)); - AssertThat(res->max_2level_cut[cut::All], Is().EqualTo(4u)); + AssertThat(res.max_2level_cut(cut::Internal), Is().EqualTo(1u)); + AssertThat(res.max_2level_cut(cut::Internal_False), Is().EqualTo(1u)); + AssertThat(res.max_2level_cut(cut::Internal_True), Is().EqualTo(3u)); + AssertThat(res.max_2level_cut(cut::All), Is().EqualTo(4u)); AssertThat(bdd_iscanonical(res), Is().True()); - AssertThat(res->number_of_terminals[false], Is().EqualTo(1u)); - AssertThat(res->number_of_terminals[true], Is().EqualTo(3u)); + AssertThat(res.number_of_terminals(false), Is().EqualTo(1u)); + AssertThat(res.number_of_terminals(true), Is().EqualTo(3u)); }); it("can create {} as trivially false", [&]() { @@ -1376,15 +1376,15 @@ go_bandit([]() { AssertThat(res->width, Is().EqualTo(0u)); - AssertThat(res->max_1level_cut[cut::Internal], Is().EqualTo(0u)); - AssertThat(res->max_1level_cut[cut::Internal_False], Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::Internal_True], Is().EqualTo(0u)); + AssertThat(res.max_1level_cut(cut::Internal), Is().EqualTo(0u)); + AssertThat(res.max_1level_cut(cut::Internal_False), Is().EqualTo(1u)); + AssertThat(res.max_1level_cut(cut::Internal_True), Is().EqualTo(0u)); AssertThat(res->max_1level_cut[cut::All], Is().EqualTo(1u)); AssertThat(bdd_iscanonical(res), Is().True()); - AssertThat(res->number_of_terminals[false], Is().EqualTo(1u)); - AssertThat(res->number_of_terminals[true], Is().EqualTo(0u)); + AssertThat(res.number_of_terminals(false), Is().EqualTo(1u)); + AssertThat(res.number_of_terminals(true), Is().EqualTo(0u)); }); it("can create {x1, -x3}", [&]() { @@ -1417,20 +1417,20 @@ go_bandit([]() { AssertThat(res->width, Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::Internal], Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::Internal_False], Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::Internal_True], Is().EqualTo(2u)); - AssertThat(res->max_1level_cut[cut::All], Is().EqualTo(3u)); + AssertThat(res.max_1level_cut(cut::Internal), Is().EqualTo(1u)); + AssertThat(res.max_1level_cut(cut::Internal_False), Is().EqualTo(1u)); + AssertThat(res.max_1level_cut(cut::Internal_True), Is().EqualTo(2u)); + AssertThat(res.max_1level_cut(cut::All), Is().EqualTo(3u)); - AssertThat(res->max_2level_cut[cut::Internal], Is().EqualTo(1u)); - AssertThat(res->max_2level_cut[cut::Internal_False], Is().EqualTo(1u)); - AssertThat(res->max_2level_cut[cut::Internal_True], Is().EqualTo(2u)); - AssertThat(res->max_2level_cut[cut::All], Is().EqualTo(3u)); + AssertThat(res.max_2level_cut(cut::Internal), Is().EqualTo(1u)); + AssertThat(res.max_2level_cut(cut::Internal_False), Is().EqualTo(1u)); + AssertThat(res.max_2level_cut(cut::Internal_True), Is().EqualTo(2u)); + AssertThat(res.max_2level_cut(cut::All), Is().EqualTo(3u)); AssertThat(bdd_iscanonical(res), Is().True()); - AssertThat(res->number_of_terminals[false], Is().EqualTo(1u)); - AssertThat(res->number_of_terminals[true], Is().EqualTo(2u)); + AssertThat(res.number_of_terminals(false), Is().EqualTo(1u)); + AssertThat(res.number_of_terminals(true), Is().EqualTo(2u)); }); it("can create {-x2, x4}", [&]() { @@ -1463,20 +1463,20 @@ go_bandit([]() { AssertThat(res->width, Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::Internal], Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::Internal_False], Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::Internal_True], Is().EqualTo(2u)); - AssertThat(res->max_1level_cut[cut::All], Is().EqualTo(3u)); + AssertThat(res.max_1level_cut(cut::Internal), Is().EqualTo(1u)); + AssertThat(res.max_1level_cut(cut::Internal_False), Is().EqualTo(1u)); + AssertThat(res.max_1level_cut(cut::Internal_True), Is().EqualTo(2u)); + AssertThat(res.max_1level_cut(cut::All), Is().EqualTo(3u)); - AssertThat(res->max_2level_cut[cut::Internal], Is().EqualTo(1u)); - AssertThat(res->max_2level_cut[cut::Internal_False], Is().EqualTo(1u)); - AssertThat(res->max_2level_cut[cut::Internal_True], Is().EqualTo(2u)); - AssertThat(res->max_2level_cut[cut::All], Is().EqualTo(3u)); + AssertThat(res.max_2level_cut(cut::Internal), Is().EqualTo(1u)); + AssertThat(res.max_2level_cut(cut::Internal_False), Is().EqualTo(1u)); + AssertThat(res.max_2level_cut(cut::Internal_True), Is().EqualTo(2u)); + AssertThat(res.max_2level_cut(cut::All), Is().EqualTo(3u)); AssertThat(bdd_iscanonical(res), Is().True()); - AssertThat(res->number_of_terminals[false], Is().EqualTo(1u)); - AssertThat(res->number_of_terminals[true], Is().EqualTo(2u)); + AssertThat(res.number_of_terminals(false), Is().EqualTo(1u)); + AssertThat(res.number_of_terminals(true), Is().EqualTo(2u)); }); it("skips duplicates", [&]() { @@ -1517,20 +1517,20 @@ go_bandit([]() { AssertThat(res->width, Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::Internal], Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::Internal_False], Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::Internal_True], Is().EqualTo(3u)); - AssertThat(res->max_1level_cut[cut::All], Is().EqualTo(4u)); + AssertThat(res.max_1level_cut(cut::Internal), Is().EqualTo(1u)); + AssertThat(res.max_1level_cut(cut::Internal_False), Is().EqualTo(1u)); + AssertThat(res.max_1level_cut(cut::Internal_True), Is().EqualTo(3u)); + AssertThat(res.max_1level_cut(cut::All), Is().EqualTo(4u)); - AssertThat(res->max_2level_cut[cut::Internal], Is().EqualTo(1u)); - AssertThat(res->max_2level_cut[cut::Internal_False], Is().EqualTo(1u)); - AssertThat(res->max_2level_cut[cut::Internal_True], Is().EqualTo(3u)); - AssertThat(res->max_2level_cut[cut::All], Is().EqualTo(4u)); + AssertThat(res.max_2level_cut(cut::Internal), Is().EqualTo(1u)); + AssertThat(res.max_2level_cut(cut::Internal_False), Is().EqualTo(1u)); + AssertThat(res.max_2level_cut(cut::Internal_True), Is().EqualTo(3u)); + AssertThat(res.max_2level_cut(cut::All), Is().EqualTo(4u)); AssertThat(bdd_iscanonical(res), Is().True()); - AssertThat(res->number_of_terminals[false], Is().EqualTo(1u)); - AssertThat(res->number_of_terminals[true], Is().EqualTo(3u)); + AssertThat(res.number_of_terminals(false), Is().EqualTo(1u)); + AssertThat(res.number_of_terminals(true), Is().EqualTo(3u)); }); it("works with ForwardIt::value_type == 'ssize_t'", [&]() { @@ -1579,20 +1579,20 @@ go_bandit([]() { AssertThat(res->width, Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::Internal], Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::Internal_False], Is().EqualTo(1u)); - AssertThat(res->max_1level_cut[cut::Internal_True], Is().EqualTo(4u)); - AssertThat(res->max_1level_cut[cut::All], Is().EqualTo(5u)); + AssertThat(res.max_1level_cut(cut::Internal), Is().EqualTo(1u)); + AssertThat(res.max_1level_cut(cut::Internal_False), Is().EqualTo(1u)); + AssertThat(res.max_1level_cut(cut::Internal_True), Is().EqualTo(4u)); + AssertThat(res.max_1level_cut(cut::All), Is().EqualTo(5u)); - AssertThat(res->max_2level_cut[cut::Internal], Is().EqualTo(1u)); - AssertThat(res->max_2level_cut[cut::Internal_False], Is().EqualTo(1u)); - AssertThat(res->max_2level_cut[cut::Internal_True], Is().EqualTo(4u)); - AssertThat(res->max_2level_cut[cut::All], Is().EqualTo(5u)); + AssertThat(res.max_2level_cut(cut::Internal), Is().EqualTo(1u)); + AssertThat(res.max_2level_cut(cut::Internal_False), Is().EqualTo(1u)); + AssertThat(res.max_2level_cut(cut::Internal_True), Is().EqualTo(4u)); + AssertThat(res.max_2level_cut(cut::All), Is().EqualTo(5u)); AssertThat(bdd_iscanonical(res), Is().True()); - AssertThat(res->number_of_terminals[false], Is().EqualTo(1u)); - AssertThat(res->number_of_terminals[true], Is().EqualTo(4u)); + AssertThat(res.number_of_terminals(false), Is().EqualTo(1u)); + AssertThat(res.number_of_terminals(true), Is().EqualTo(4u)); }); it("throws exception for non-ascending list", []() {