File tree 2 files changed +6
-10
lines changed
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)
15
15
16
16
bvt op=convert_bv (expr.op ());
17
17
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
+
18
22
literalt one_seen=const_literal (false );
19
23
literalt more_than_one_seen=const_literal (false );
20
24
@@ -25,14 +29,5 @@ literalt boolbvt::convert_onehot(const unary_exprt &expr)
25
29
one_seen=prop.lor (*it, one_seen);
26
30
}
27
31
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);
38
33
}
Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ SRC += analyses/ai/ai.cpp \
96
96
pointer-analysis/value_set.cpp \
97
97
solvers/bdd/miniBDD/miniBDD.cpp \
98
98
solvers/flattening/boolbv.cpp \
99
+ solvers/flattening/boolbv_onehot.cpp \
99
100
solvers/flattening/boolbv_update_bit.cpp \
100
101
solvers/floatbv/float_utils.cpp \
101
102
solvers/prop/bdd_expr.cpp \
You can’t perform that action at this time.
0 commit comments