Skip to content

Commit 723eba1

Browse files
Accepting string expressions that are typecasts in solver
During the constraint generation for string expressions we now deal with the case where it is a typecast to a string.
1 parent 445d236 commit 723eba1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/solvers/refinement/string_constraint_generator.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,15 @@ string_exprt string_constraint_generatort::add_axioms_for_string_expr(
108108
{
109109
// We ignore non deterministic symbols and struct
110110
}
111+
else if(unrefined_string.id()==ID_typecast)
112+
{
113+
exprt arg=to_typecast_expr(unrefined_string).op();
114+
assert(refined_string_typet::is_unrefined_string_type(
115+
unrefined_string.type()));
116+
exprt res=add_axioms_for_string_expr(arg);
117+
assert(res.type()==refined_string_typet(get_char_type()));
118+
s=to_string_expr(res);
119+
}
111120
else
112121
{
113122
throw "add_axioms_for_string_expr:\n"+unrefined_string.pretty()+

0 commit comments

Comments
 (0)