@@ -778,7 +778,7 @@ inline bool can_cast_expr<binary_exprt>(const exprt &base)
778
778
779
779
inline void validate_expr (const binary_exprt &value)
780
780
{
781
- validate_operands (value, 2 , " Binary expressions must have two operands " );
781
+ binary_exprt::check (value);
782
782
}
783
783
784
784
// / \brief Cast an exprt to a \ref binary_exprt
@@ -789,18 +789,14 @@ inline void validate_expr(const binary_exprt &value)
789
789
// / \return Object of type \ref binary_exprt
790
790
inline const binary_exprt &to_binary_expr (const exprt &expr)
791
791
{
792
- DATA_INVARIANT (
793
- expr.operands ().size ()==2 ,
794
- " Binary expressions must have two operands" );
792
+ binary_exprt::check (expr);
795
793
return static_cast <const binary_exprt &>(expr);
796
794
}
797
795
798
796
// / \copydoc to_binary_expr(const exprt &)
799
797
inline binary_exprt &to_binary_expr (exprt &expr)
800
798
{
801
- DATA_INVARIANT (
802
- expr.operands ().size ()==2 ,
803
- " Binary expressions must have two operands" );
799
+ binary_exprt::check (expr);
804
800
return static_cast <binary_exprt &>(expr);
805
801
}
806
802
@@ -921,7 +917,7 @@ inline bool can_cast_expr<binary_relation_exprt>(const exprt &base)
921
917
922
918
inline void validate_expr (const binary_relation_exprt &value)
923
919
{
924
- validate_operands (value, 2 , " Binary relations must have two operands " );
920
+ binary_relation_exprt::check (value);
925
921
}
926
922
927
923
// / \brief Cast an exprt to a \ref binary_relation_exprt
@@ -932,18 +928,14 @@ inline void validate_expr(const binary_relation_exprt &value)
932
928
// / \return Object of type \ref binary_relation_exprt
933
929
inline const binary_relation_exprt &to_binary_relation_expr (const exprt &expr)
934
930
{
935
- DATA_INVARIANT (
936
- expr.operands ().size ()==2 ,
937
- " Binary relations must have two operands" );
931
+ binary_relation_exprt::check (expr);
938
932
return static_cast <const binary_relation_exprt &>(expr);
939
933
}
940
934
941
935
// / \copydoc to_binary_relation_expr(const exprt &)
942
936
inline binary_relation_exprt &to_binary_relation_expr (exprt &expr)
943
937
{
944
- DATA_INVARIANT (
945
- expr.operands ().size ()==2 ,
946
- " Binary relations must have two operands" );
938
+ binary_relation_exprt::check (expr);
947
939
return static_cast <binary_relation_exprt &>(expr);
948
940
}
949
941
@@ -1457,7 +1449,7 @@ inline bool can_cast_expr<equal_exprt>(const exprt &base)
1457
1449
1458
1450
inline void validate_expr (const equal_exprt &value)
1459
1451
{
1460
- validate_operands (value, 2 , " Equality must have two operands " );
1452
+ equal_exprt::check (value);
1461
1453
}
1462
1454
1463
1455
// / \brief Cast an exprt to an \ref equal_exprt
0 commit comments