@@ -833,6 +833,17 @@ class r_or_w_ok_exprt : public binary_predicate_exprt
833
833
}
834
834
};
835
835
836
+ template <>
837
+ inline bool can_cast_expr<r_or_w_ok_exprt>(const exprt &base)
838
+ {
839
+ return base.id () == ID_r_ok || base.id () == ID_w_ok || base.id () == ID_rw_ok;
840
+ }
841
+
842
+ inline void validate_expr (const r_or_w_ok_exprt &value)
843
+ {
844
+ validate_operands (value, 2 , " r_or_w_ok must have two operands" );
845
+ }
846
+
836
847
inline const r_or_w_ok_exprt &to_r_or_w_ok_expr (const exprt &expr)
837
848
{
838
849
PRECONDITION (
@@ -852,6 +863,17 @@ class r_ok_exprt : public r_or_w_ok_exprt
852
863
}
853
864
};
854
865
866
+ template <>
867
+ inline bool can_cast_expr<r_ok_exprt>(const exprt &base)
868
+ {
869
+ return base.id () == ID_r_ok;
870
+ }
871
+
872
+ inline void validate_expr (const r_ok_exprt &value)
873
+ {
874
+ validate_operands (value, 2 , " r_ok must have two operands" );
875
+ }
876
+
855
877
inline const r_ok_exprt &to_r_ok_expr (const exprt &expr)
856
878
{
857
879
PRECONDITION (expr.id () == ID_r_ok);
@@ -870,6 +892,17 @@ class w_ok_exprt : public r_or_w_ok_exprt
870
892
}
871
893
};
872
894
895
+ template <>
896
+ inline bool can_cast_expr<w_ok_exprt>(const exprt &base)
897
+ {
898
+ return base.id () == ID_w_ok;
899
+ }
900
+
901
+ inline void validate_expr (const w_ok_exprt &value)
902
+ {
903
+ validate_operands (value, 2 , " w_ok must have two operands" );
904
+ }
905
+
873
906
inline const w_ok_exprt &to_w_ok_expr (const exprt &expr)
874
907
{
875
908
PRECONDITION (expr.id () == ID_w_ok);
0 commit comments