Skip to content

Commit 09aae3b

Browse files
Compare using bdd_xor instead of exprt equality
This is more robust as the expression a&!b could equivalently be written !b&a, !(!a|b), !(b|!a)...
1 parent c4f03c7 commit 09aae3b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

unit/solvers/prop/bdd_expr.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ SCENARIO("bdd_expr", "[core][solver][prop][bdd_expr]")
5656
WHEN("It is converted to an exprt")
5757
{
5858
const exprt result = bdd_expr_converter.as_expr(bdd);
59-
THEN("It is equal to the expression (a & !b) or (!b & a)")
59+
THEN("It is equivalent to the expression !(!a || b)")
6060
{
61-
REQUIRE(result.id() == ID_and);
62-
REQUIRE(result.operands().size() == 2);
63-
REQUIRE((result.op0() == a || result.op1() == a));
64-
REQUIRE((result.op0() == not_exprt(b) || result.op1() == not_exprt(b)));
61+
const bddt to_compare =
62+
bdd_expr_converter.from_expr(not_exprt{or_exprt{not_exprt{a}, b}});
63+
REQUIRE(bdd.bdd_xor(to_compare).is_false());
64+
REQUIRE(bdd.bdd_xor(to_compare.bdd_not()).is_true());
6565
}
6666
}
6767
}

0 commit comments

Comments
 (0)