@@ -818,6 +818,17 @@ class r_or_w_ok_exprt : public binary_predicate_exprt
818
818
}
819
819
};
820
820
821
+ template <>
822
+ inline bool can_cast_expr<r_or_w_ok_exprt>(const exprt &base)
823
+ {
824
+ return base.id () == ID_r_ok || base.id () == ID_w_ok || base.id () == ID_rw_ok;
825
+ }
826
+
827
+ inline void validate_expr (const r_or_w_ok_exprt &value)
828
+ {
829
+ validate_operands (value, 2 , " r_or_w_ok must have two operands" );
830
+ }
831
+
821
832
inline const r_or_w_ok_exprt &to_r_or_w_ok_expr (const exprt &expr)
822
833
{
823
834
PRECONDITION (
@@ -837,6 +848,17 @@ class r_ok_exprt : public r_or_w_ok_exprt
837
848
}
838
849
};
839
850
851
+ template <>
852
+ inline bool can_cast_expr<r_ok_exprt>(const exprt &base)
853
+ {
854
+ return base.id () == ID_r_ok;
855
+ }
856
+
857
+ inline void validate_expr (const r_ok_exprt &value)
858
+ {
859
+ validate_operands (value, 2 , " r_ok must have two operands" );
860
+ }
861
+
840
862
inline const r_ok_exprt &to_r_ok_expr (const exprt &expr)
841
863
{
842
864
PRECONDITION (expr.id () == ID_r_ok);
@@ -855,6 +877,17 @@ class w_ok_exprt : public r_or_w_ok_exprt
855
877
}
856
878
};
857
879
880
+ template <>
881
+ inline bool can_cast_expr<w_ok_exprt>(const exprt &base)
882
+ {
883
+ return base.id () == ID_w_ok;
884
+ }
885
+
886
+ inline void validate_expr (const w_ok_exprt &value)
887
+ {
888
+ validate_operands (value, 2 , " w_ok must have two operands" );
889
+ }
890
+
858
891
inline const w_ok_exprt &to_w_ok_expr (const exprt &expr)
859
892
{
860
893
PRECONDITION (expr.id () == ID_w_ok);
0 commit comments