File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,10 @@ literalt boolbvt::convert_onehot(const unary_exprt &expr)
1515
1616 bvt op=convert_bv (expr.op ());
1717
18+ // onehot0 is the same as onehot with the input bits flipped
19+ if (expr.id () == ID_onehot0)
20+ op = bv_utils.inverted (op);
21+
1822 literalt one_seen=const_literal (false );
1923 literalt more_than_one_seen=const_literal (false );
2024
@@ -25,14 +29,5 @@ literalt boolbvt::convert_onehot(const unary_exprt &expr)
2529 one_seen=prop.lor (*it, one_seen);
2630 }
2731
28- if (expr.id ()==ID_onehot)
29- return prop.land (one_seen, !more_than_one_seen);
30- else
31- {
32- INVARIANT (
33- expr.id () == ID_onehot0,
34- " should be a onehot0 expression as other onehot expression kind has been "
35- " handled in other branch" );
36- return !more_than_one_seen;
37- }
32+ return prop.land (one_seen, !more_than_one_seen);
3833}
Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ SRC += analyses/ai/ai.cpp \
9696 pointer-analysis/value_set.cpp \
9797 solvers/bdd/miniBDD/miniBDD.cpp \
9898 solvers/flattening/boolbv.cpp \
99+ solvers/flattening/boolbv_onehot.cpp \
99100 solvers/flattening/boolbv_update_bit.cpp \
100101 solvers/floatbv/float_utils.cpp \
101102 solvers/prop/bdd_expr.cpp \
You can’t perform that action at this time.
0 commit comments