@@ -28,9 +28,11 @@ void convert(const bvt &bv, Glucose::vec<Glucose::Lit> &dest)
28
28
{
29
29
dest.capacity (bv.size ());
30
30
31
- forall_literals (it, bv)
32
- if (!it->is_false ())
33
- dest.push (Glucose::mkLit (it->var_no (), it->sign ()));
31
+ for (const auto &literal : bv)
32
+ {
33
+ if (!literal.is_false ())
34
+ dest.push (Glucose::mkLit (literal.var_no (), literal.sign ()));
35
+ }
34
36
}
35
37
36
38
template <typename T>
@@ -103,13 +105,16 @@ void satcheck_glucose_baset<T>::lcnf(const bvt &bv)
103
105
{
104
106
add_variables ();
105
107
106
- forall_literals (it, bv)
108
+ for ( const auto &literal : bv)
107
109
{
108
- if (it-> is_true ())
110
+ if (literal. is_true ())
109
111
return ;
110
- else if (!it->is_false ())
112
+ else if (!literal.is_false ())
113
+ {
111
114
INVARIANT (
112
- it->var_no () < (unsigned )solver->nVars (), " variable not added yet" );
115
+ literal.var_no () < (unsigned )solver->nVars (),
116
+ " variable not added yet" );
117
+ }
113
118
}
114
119
115
120
Glucose::vec<Glucose::Lit> c;
@@ -171,9 +176,11 @@ propt::resultt satcheck_glucose_baset<T>::do_prop_solve()
171
176
// if assumptions contains false, we need this to be UNSAT
172
177
bool has_false = false ;
173
178
174
- forall_literals (it, assumptions)
175
- if (it->is_false ())
179
+ for (const auto &literal : assumptions)
180
+ {
181
+ if (literal.is_false ())
176
182
has_false = true ;
183
+ }
177
184
178
185
if (has_false)
179
186
{
@@ -271,8 +278,11 @@ void satcheck_glucose_baset<T>::set_assumptions(const bvt &bv)
271
278
{
272
279
assumptions=bv;
273
280
274
- forall_literals (it, assumptions)
275
- INVARIANT (!it->is_constant (), " assumption literals must not be constant" );
281
+ for (const auto &literal : assumptions)
282
+ {
283
+ INVARIANT (
284
+ !literal.is_constant (), " assumption literals must not be constant" );
285
+ }
276
286
}
277
287
278
288
satcheck_glucose_no_simplifiert::satcheck_glucose_no_simplifiert (
0 commit comments