File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -4065,6 +4065,22 @@ void smt2_convt::convert_minus(const minus_exprt &expr)
4065
4065
" unsupported operand types for -: " + expr.op0 ().type ().id_string () +
4066
4066
" and " + expr.op1 ().type ().id_string ());
4067
4067
}
4068
+ else if (expr.type ().id () == ID_range)
4069
+ {
4070
+ auto &range_type = to_range_type (expr.type ());
4071
+
4072
+ // sub: lhs + from - (rhs + from) - from = lhs - rhs - from
4073
+ mp_integer from = range_type.get_from ();
4074
+ const auto size = range_type.get_to () - range_type.get_from () + 1 ;
4075
+ const auto width = address_bits (size);
4076
+
4077
+ out << " (bvsub (bvsub " ;
4078
+ convert_expr (expr.op0 ());
4079
+ out << ' ' ;
4080
+ convert_expr (expr.op1 ());
4081
+ out << " ) (_ bv" << range_type.get_from () << ' ' << width
4082
+ << " ))" ; // bv, bvsub
4083
+ }
4068
4084
else
4069
4085
UNEXPECTEDCASE (" unsupported type for -: " +expr.type ().id_string ());
4070
4086
}
You can’t perform that action at this time.
0 commit comments