File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -111,8 +111,8 @@ string_exprt string_constraint_generatort::add_axioms_for_string_expr(
111
111
else if (unrefined_string.id ()==ID_typecast)
112
112
{
113
113
exprt arg=to_typecast_expr (unrefined_string).op ();
114
- assert (refined_string_typet::is_unrefined_string_type (
115
- unrefined_string.type ()));
114
+ // assert(refined_string_typet::is_unrefined_string_type(
115
+ // unrefined_string.type())); // its type could be simply Object
116
116
exprt res=add_axioms_for_string_expr (arg);
117
117
assert (res.type ()==refined_string_typet (get_char_type ()));
118
118
s=to_string_expr (res);
Original file line number Diff line number Diff line change @@ -136,6 +136,19 @@ bool string_refinementt::boolbv_set_equality_to_true(const equal_exprt &expr)
136
136
debug () << " string_refinementt " << from_expr (expr.lhs ()) << " <- "
137
137
<< from_expr (expr.rhs ()) << eom;
138
138
139
+
140
+ if (expr.rhs ().id ()==ID_typecast)
141
+ {
142
+ exprt uncast=to_typecast_expr (expr.rhs ()).op ();
143
+ if (refined_string_typet::is_unrefined_string_type (uncast.type ()))
144
+ {
145
+ debug () << " (sr) detected casted string" << eom;
146
+ symbol_exprt sym=to_symbol_expr (expr.lhs ());
147
+ generator.set_string_symbol_equal_to_expr (sym, uncast);
148
+ return false ;
149
+ }
150
+ }
151
+
139
152
if (refined_string_typet::is_unrefined_string_type (type))
140
153
{
141
154
symbol_exprt sym=to_symbol_expr (expr.lhs ());
You can’t perform that action at this time.
0 commit comments