File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -44,4 +44,25 @@ SCENARIO("bdd_expr", "[core][solver][prop][bdd_expr]")
4444 REQUIRE (bdd.as_expr () == bdd2.as_expr ());
4545 }
4646 }
47+
48+ GIVEN (" A bdd for (a&!b)" )
49+ {
50+ const symbol_exprt a (" a" , bool_typet ());
51+ const symbol_exprt b (" b" , bool_typet ());
52+
53+ bdd_exprt bdd{ns};
54+ bdd.from_expr (and_exprt (a, not_exprt (b)));
55+
56+ WHEN (" It is converted to an exprt" )
57+ {
58+ const exprt result = bdd.as_expr ();
59+ THEN (" It is equal to the expression (a & !b) or (!b & a)" )
60+ {
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)));
65+ }
66+ }
67+ }
4768}
You can’t perform that action at this time.
0 commit comments