@@ -39,14 +39,14 @@ bool operator!=(const exprt &lhs, bool rhs)
3939 return !lhs.is_constant () || to_constant_expr (lhs) != rhs;
4040}
4141
42- bool operator ==(const constant_exprt &lhs, bool rhs)
42+ bool constant_exprt:: operator ==(bool rhs) const
4343{
44- return lhs. is_boolean () && (lhs. get_value () != ID_false) == rhs;
44+ return is_boolean () && (get_value () != ID_false) == rhs;
4545}
4646
47- bool operator !=(const constant_exprt &lhs, bool rhs)
47+ bool constant_exprt:: operator !=(bool rhs) const
4848{
49- return !lhs. is_boolean () || (lhs. get_value () != ID_false) != rhs;
49+ return !is_boolean () || (get_value () != ID_false) != rhs;
5050}
5151
5252bool operator ==(const exprt &lhs, int rhs)
@@ -57,94 +57,94 @@ bool operator==(const exprt &lhs, int rhs)
5757 return false ;
5858}
5959
60- bool operator ==(const constant_exprt &lhs, int rhs)
60+ bool constant_exprt:: operator ==(int rhs) const
6161{
6262 if (rhs == 0 )
6363 {
64- const irep_idt &type_id = lhs. type ().id ();
64+ const irep_idt &type_id = type ().id ();
6565
6666 if (type_id == ID_integer)
6767 {
68- return integer_typet{}.zero_expr () == lhs ;
68+ return integer_typet{}.zero_expr () == * this ;
6969 }
7070 else if (type_id == ID_natural)
7171 {
72- return natural_typet{}.zero_expr () == lhs ;
72+ return natural_typet{}.zero_expr () == * this ;
7373 }
7474 else if (type_id == ID_real)
7575 {
76- return real_typet{}.zero_expr () == lhs ;
76+ return real_typet{}.zero_expr () == * this ;
7777 }
7878 else if (type_id == ID_rational)
7979 {
8080 rationalt rat_value;
81- if (to_rational (lhs , rat_value))
81+ if (to_rational (* this , rat_value))
8282 CHECK_RETURN (false );
8383 return rat_value.is_zero ();
8484 }
8585 else if (
8686 type_id == ID_unsignedbv || type_id == ID_signedbv ||
8787 type_id == ID_c_bool || type_id == ID_c_bit_field)
8888 {
89- return lhs. value_is_zero_string ();
89+ return value_is_zero_string ();
9090 }
9191 else if (type_id == ID_fixedbv)
9292 {
93- return fixedbvt (lhs ).is_zero ();
93+ return fixedbvt (* this ).is_zero ();
9494 }
9595 else if (type_id == ID_floatbv)
9696 {
97- return ieee_float_valuet (lhs ).is_zero ();
97+ return ieee_float_valuet (* this ).is_zero ();
9898 }
9999 else if (type_id == ID_pointer)
100100 {
101- return lhs == nullptr ;
101+ return * this == nullptr ;
102102 }
103103 else
104104 return false ;
105105 }
106106 else if (rhs == 1 )
107107 {
108- const irep_idt &type_id = lhs. type ().id ();
108+ const irep_idt &type_id = type ().id ();
109109
110110 if (type_id == ID_integer)
111111 {
112- return integer_typet{}.one_expr () == lhs ;
112+ return integer_typet{}.one_expr () == * this ;
113113 }
114114 else if (type_id == ID_natural)
115115 {
116- return natural_typet{}.one_expr () == lhs ;
116+ return natural_typet{}.one_expr () == * this ;
117117 }
118118 else if (type_id == ID_real)
119119 {
120- return real_typet{}.one_expr () == lhs ;
120+ return real_typet{}.one_expr () == * this ;
121121 }
122122 else if (type_id == ID_rational)
123123 {
124124 rationalt rat_value;
125- if (to_rational (lhs , rat_value))
125+ if (to_rational (* this , rat_value))
126126 CHECK_RETURN (false );
127127 return rat_value.is_one ();
128128 }
129129 else if (
130130 type_id == ID_unsignedbv || type_id == ID_signedbv ||
131131 type_id == ID_c_bool || type_id == ID_c_bit_field)
132132 {
133- const auto width = to_bitvector_type (lhs. type ()).get_width ();
133+ const auto width = to_bitvector_type (type ()).get_width ();
134134 mp_integer int_value =
135- bvrep2integer (id2string (lhs. get_value ()), width, false );
135+ bvrep2integer (id2string (get_value ()), width, false );
136136 return int_value == 1 ;
137137 }
138138 else if (type_id == ID_fixedbv)
139139 {
140- fixedbv_spect spec{to_fixedbv_type (lhs. type ())};
140+ fixedbv_spect spec{to_fixedbv_type (type ())};
141141 fixedbvt one{spec};
142142 one.from_integer (1 );
143- return one == fixedbvt{lhs };
143+ return one == fixedbvt{* this };
144144 }
145145 else if (type_id == ID_floatbv)
146146 {
147- return ieee_float_valuet (lhs ) == 1 ;
147+ return ieee_float_valuet (* this ) == 1 ;
148148 }
149149 else
150150 return false ;
@@ -175,10 +175,10 @@ bool operator==(const exprt &lhs, std::nullptr_t rhs)
175175 return lhs.is_constant () && to_constant_expr (lhs).is_null_pointer ();
176176}
177177
178- bool operator ==(const constant_exprt &lhs, std::nullptr_t rhs)
178+ bool constant_exprt:: operator ==(std::nullptr_t rhs) const
179179{
180180 (void )rhs; // unused parameter
181- return lhs. is_null_pointer ();
181+ return is_null_pointer ();
182182}
183183
184184void constant_exprt::check (const exprt &expr, const validation_modet vm)
0 commit comments