@@ -91,12 +91,12 @@ bool simplify_exprt::simplify_if_recursive(
91
91
}
92
92
}
93
93
94
- bool result = true ;
94
+ bool no_change = true ;
95
95
96
96
Forall_operands (it, expr)
97
- result = simplify_if_recursive (*it, cond, truth) && result ;
97
+ no_change = simplify_if_recursive (*it, cond, truth) && no_change ;
98
98
99
- return result ;
99
+ return no_change ;
100
100
}
101
101
102
102
bool simplify_exprt::simplify_if_conj (exprt &expr, const exprt &cond)
@@ -110,12 +110,12 @@ bool simplify_exprt::simplify_if_conj(exprt &expr, const exprt &cond)
110
110
}
111
111
}
112
112
113
- bool result = true ;
113
+ bool no_change = true ;
114
114
115
115
Forall_operands (it, expr)
116
- result = simplify_if_conj (*it, cond) && result ;
116
+ no_change = simplify_if_conj (*it, cond) && no_change ;
117
117
118
- return result ;
118
+ return no_change ;
119
119
}
120
120
121
121
bool simplify_exprt::simplify_if_disj (exprt &expr, const exprt &cond)
@@ -129,49 +129,49 @@ bool simplify_exprt::simplify_if_disj(exprt &expr, const exprt &cond)
129
129
}
130
130
}
131
131
132
- bool result = true ;
132
+ bool no_change = true ;
133
133
134
134
Forall_operands (it, expr)
135
- result = simplify_if_disj (*it, cond) && result ;
135
+ no_change = simplify_if_disj (*it, cond) && no_change ;
136
136
137
- return result ;
137
+ return no_change ;
138
138
}
139
139
140
140
bool simplify_exprt::simplify_if_branch (
141
141
exprt &trueexpr,
142
142
exprt &falseexpr,
143
143
const exprt &cond)
144
144
{
145
- bool tresult = true ;
146
- bool fresult = true ;
145
+ bool tno_change = true ;
146
+ bool fno_change = true ;
147
147
148
148
if (cond.id () == ID_and)
149
149
{
150
- tresult = simplify_if_conj (trueexpr, cond) && tresult ;
151
- fresult = simplify_if_recursive (falseexpr, cond, false ) && fresult ;
150
+ tno_change = simplify_if_conj (trueexpr, cond) && tno_change ;
151
+ fno_change = simplify_if_recursive (falseexpr, cond, false ) && fno_change ;
152
152
}
153
153
else if (cond.id () == ID_or)
154
154
{
155
- tresult = simplify_if_recursive (trueexpr, cond, true ) && tresult ;
156
- fresult = simplify_if_disj (falseexpr, cond) && fresult ;
155
+ tno_change = simplify_if_recursive (trueexpr, cond, true ) && tno_change ;
156
+ fno_change = simplify_if_disj (falseexpr, cond) && fno_change ;
157
157
}
158
158
else
159
159
{
160
- tresult = simplify_if_recursive (trueexpr, cond, true ) && tresult ;
161
- fresult = simplify_if_recursive (falseexpr, cond, false ) && fresult ;
160
+ tno_change = simplify_if_recursive (trueexpr, cond, true ) && tno_change ;
161
+ fno_change = simplify_if_recursive (falseexpr, cond, false ) && fno_change ;
162
162
}
163
163
164
- if (!tresult )
164
+ if (!tno_change )
165
165
trueexpr = simplify_rec (trueexpr); // recursive call
166
- if (!fresult )
166
+ if (!fno_change )
167
167
falseexpr = simplify_rec (falseexpr); // recursive call
168
168
169
- return tresult && fresult ;
169
+ return tno_change && fno_change ;
170
170
}
171
171
172
172
bool simplify_exprt::simplify_if_cond (exprt &expr)
173
173
{
174
- bool result = true ;
174
+ bool no_change = true ;
175
175
bool tmp = false ;
176
176
177
177
while (!tmp)
@@ -201,10 +201,10 @@ bool simplify_exprt::simplify_if_cond(exprt &expr)
201
201
if (!tmp)
202
202
expr = simplify_rec (expr); // recursive call
203
203
204
- result = tmp && result ;
204
+ no_change = tmp && no_change ;
205
205
}
206
206
207
- return result ;
207
+ return no_change ;
208
208
}
209
209
210
210
bool simplify_exprt::simplify_if_preorder (if_exprt &expr)
@@ -213,14 +213,14 @@ bool simplify_exprt::simplify_if_preorder(if_exprt &expr)
213
213
exprt &truevalue = expr.true_case ();
214
214
exprt &falsevalue = expr.false_case ();
215
215
216
- bool result = true ;
216
+ bool no_change = true ;
217
217
218
218
// we first want to look at the condition
219
219
auto r_cond = simplify_rec (cond);
220
220
if (r_cond.has_changed ())
221
221
{
222
222
cond = r_cond.expr ;
223
- result = false ;
223
+ no_change = false ;
224
224
}
225
225
226
226
// 1 ? a : b -> a and 0 ? a : b -> b
@@ -240,7 +240,7 @@ bool simplify_exprt::simplify_if_preorder(if_exprt &expr)
240
240
tmp.swap (cond.op0 ());
241
241
cond.swap (tmp);
242
242
truevalue.swap (falsevalue);
243
- result = false ;
243
+ no_change = false ;
244
244
}
245
245
246
246
#ifdef USE_LOCAL_REPLACE_MAP
@@ -264,7 +264,7 @@ bool simplify_exprt::simplify_if_preorder(if_exprt &expr)
264
264
if (r_truevalue.has_changed ())
265
265
{
266
266
truevalue = r_truevalue.expr ;
267
- result = false ;
267
+ no_change = false ;
268
268
}
269
269
270
270
local_replace_map = map_before;
@@ -287,7 +287,7 @@ bool simplify_exprt::simplify_if_preorder(if_exprt &expr)
287
287
if (r_falsevalue.has_changed ())
288
288
{
289
289
falsevalue = r_falsevalue.expr ;
290
- result = false ;
290
+ no_change = false ;
291
291
}
292
292
293
293
local_replace_map.swap (map_before);
@@ -296,13 +296,13 @@ bool simplify_exprt::simplify_if_preorder(if_exprt &expr)
296
296
if (r_truevalue.has_changed ())
297
297
{
298
298
truevalue = r_truevalue.expr ;
299
- result = false ;
299
+ no_change = false ;
300
300
}
301
301
auto r_falsevalue = simplify_rec (falsevalue);
302
302
if (r_falsevalue.has_changed ())
303
303
{
304
304
falsevalue = r_falsevalue.expr ;
305
- result = false ;
305
+ no_change = false ;
306
306
}
307
307
#endif
308
308
}
@@ -312,17 +312,17 @@ bool simplify_exprt::simplify_if_preorder(if_exprt &expr)
312
312
if (r_truevalue.has_changed ())
313
313
{
314
314
truevalue = r_truevalue.expr ;
315
- result = false ;
315
+ no_change = false ;
316
316
}
317
317
auto r_falsevalue = simplify_rec (falsevalue);
318
318
if (r_falsevalue.has_changed ())
319
319
{
320
320
falsevalue = r_falsevalue.expr ;
321
- result = false ;
321
+ no_change = false ;
322
322
}
323
323
}
324
324
325
- return result ;
325
+ return no_change ;
326
326
}
327
327
328
328
simplify_exprt::resultt<> simplify_exprt::simplify_if (const if_exprt &expr)
@@ -334,8 +334,8 @@ simplify_exprt::resultt<> simplify_exprt::simplify_if(const if_exprt &expr)
334
334
if (do_simplify_if)
335
335
{
336
336
#if 0
337
- result = simplify_if_cond(cond) && result ;
338
- result = simplify_if_branch(truevalue, falsevalue, cond) && result ;
337
+ no_change = simplify_if_cond(cond) && no_change ;
338
+ no_change = simplify_if_branch(truevalue, falsevalue, cond) && no_change ;
339
339
#endif
340
340
341
341
if (expr.type () == bool_typet ())
0 commit comments