@@ -766,7 +766,7 @@ inline bool can_cast_expr<binary_exprt>(const exprt &base)
766
766
767
767
inline void validate_expr (const binary_exprt &value)
768
768
{
769
- validate_operands (value, 2 , " Binary expressions must have two operands " );
769
+ binary_exprt::check (value);
770
770
}
771
771
772
772
// / \brief Cast an exprt to a \ref binary_exprt
@@ -777,18 +777,14 @@ inline void validate_expr(const binary_exprt &value)
777
777
// / \return Object of type \ref binary_exprt
778
778
inline const binary_exprt &to_binary_expr (const exprt &expr)
779
779
{
780
- DATA_INVARIANT (
781
- expr.operands ().size ()==2 ,
782
- " Binary expressions must have two operands" );
780
+ binary_exprt::check (expr);
783
781
return static_cast <const binary_exprt &>(expr);
784
782
}
785
783
786
784
// / \copydoc to_binary_expr(const exprt &)
787
785
inline binary_exprt &to_binary_expr (exprt &expr)
788
786
{
789
- DATA_INVARIANT (
790
- expr.operands ().size ()==2 ,
791
- " Binary expressions must have two operands" );
787
+ binary_exprt::check (expr);
792
788
return static_cast <binary_exprt &>(expr);
793
789
}
794
790
@@ -904,7 +900,7 @@ inline bool can_cast_expr<binary_relation_exprt>(const exprt &base)
904
900
905
901
inline void validate_expr (const binary_relation_exprt &value)
906
902
{
907
- validate_operands (value, 2 , " Binary relations must have two operands " );
903
+ binary_relation_exprt::check (value);
908
904
}
909
905
910
906
// / \brief Cast an exprt to a \ref binary_relation_exprt
@@ -915,18 +911,14 @@ inline void validate_expr(const binary_relation_exprt &value)
915
911
// / \return Object of type \ref binary_relation_exprt
916
912
inline const binary_relation_exprt &to_binary_relation_expr (const exprt &expr)
917
913
{
918
- DATA_INVARIANT (
919
- expr.operands ().size ()==2 ,
920
- " Binary relations must have two operands" );
914
+ binary_relation_exprt::check (expr);
921
915
return static_cast <const binary_relation_exprt &>(expr);
922
916
}
923
917
924
918
// / \copydoc to_binary_relation_expr(const exprt &)
925
919
inline binary_relation_exprt &to_binary_relation_expr (exprt &expr)
926
920
{
927
- DATA_INVARIANT (
928
- expr.operands ().size ()==2 ,
929
- " Binary relations must have two operands" );
921
+ binary_relation_exprt::check (expr);
930
922
return static_cast <binary_relation_exprt &>(expr);
931
923
}
932
924
@@ -1420,7 +1412,7 @@ inline bool can_cast_expr<equal_exprt>(const exprt &base)
1420
1412
1421
1413
inline void validate_expr (const equal_exprt &value)
1422
1414
{
1423
- validate_operands (value, 2 , " Equality must have two operands " );
1415
+ equal_exprt::check (value);
1424
1416
}
1425
1417
1426
1418
// / \brief Cast an exprt to an \ref equal_exprt
0 commit comments