File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -241,4 +241,18 @@ inline const refined_string_exprt &to_string_expr(const exprt &expr)
241241 return static_cast <const refined_string_exprt &>(expr);
242242}
243243
244+ template <>
245+ inline bool can_cast_expr<refined_string_exprt>(const exprt &base)
246+ {
247+ return base.id () == ID_struct && base.operands ().size () == 2 ;
248+ }
249+
250+ inline void validate_expr (const refined_string_exprt &x)
251+ {
252+ INVARIANT (x.id () == ID_struct, " refined string exprs are struct" );
253+ validate_operands (x, 2 , " refined string expr has length and content fields" );
254+ INVARIANT (x.length ().type ().id () == ID_signedbv, " length is an unsigned int" );
255+ INVARIANT (x.content ().type ().id () == ID_array, " content is an array" );
256+ }
257+
244258#endif
You can’t perform that action at this time.
0 commit comments