File tree 1 file changed +22
-2
lines changed
1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -1838,7 +1838,8 @@ void smt2_convt::convert_typecast(const typecast_exprt &expr)
1838
1838
src_type.id ()==ID_unsignedbv ||
1839
1839
src_type.id ()==ID_c_bool ||
1840
1840
src_type.id ()==ID_fixedbv ||
1841
- src_type.id ()==ID_pointer)
1841
+ src_type.id ()==ID_pointer ||
1842
+ src_type.id ()==ID_integer)
1842
1843
{
1843
1844
out << " (not (= " ;
1844
1845
convert_expr (src);
@@ -2283,6 +2284,17 @@ void smt2_convt::convert_typecast(const typecast_exprt &expr)
2283
2284
else
2284
2285
UNEXPECTEDCASE (" Unknown typecast " +src_type.id_string ()+" -> float" );
2285
2286
}
2287
+ else if (dest_type.id ()==ID_integer)
2288
+ {
2289
+ if (src_type.id ()==ID_bool)
2290
+ {
2291
+ out << " (ite " ;
2292
+ convert_expr (src);
2293
+ out <<" 1 0 )" ;
2294
+ }
2295
+ else
2296
+ UNEXPECTEDCASE (" Unknown typecast " +src_type.id_string ()+" -> integer" );
2297
+ }
2286
2298
else if (dest_type.id ()==ID_c_bit_field)
2287
2299
{
2288
2300
std::size_t from_width=boolbv_width (src_type);
@@ -3079,7 +3091,15 @@ void smt2_convt::convert_minus(const minus_exprt &expr)
3079
3091
{
3080
3092
assert (expr.operands ().size ()==2 );
3081
3093
3082
- if (expr.type ().id ()==ID_unsignedbv ||
3094
+ if (expr.type ().id ()==ID_integer)
3095
+ {
3096
+ out << " (- " ;
3097
+ convert_expr (expr.op0 ());
3098
+ out << " " ;
3099
+ convert_expr (expr.op1 ());
3100
+ out << " )" ;
3101
+ }
3102
+ else if (expr.type ().id ()==ID_unsignedbv ||
3083
3103
expr.type ().id ()==ID_signedbv ||
3084
3104
expr.type ().id ()==ID_fixedbv)
3085
3105
{
You can’t perform that action at this time.
0 commit comments