We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a61ea38 commit 20b5366Copy full SHA for 20b5366
src/util/string_expr.h
@@ -241,4 +241,18 @@ inline const refined_string_exprt &to_string_expr(const exprt &expr)
241
return static_cast<const refined_string_exprt &>(expr);
242
}
243
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
258
#endif
0 commit comments