Skip to content

Commit 028ac2c

Browse files
committed
prop_conv_solvert: remove let conversion
This removes the handling of let expressions from prop_conv_solvert to prevent duplicating this functionality in boolbvt.
1 parent 58df539 commit 028ac2c

File tree

1 file changed

+1
-36
lines changed

1 file changed

+1
-36
lines changed

src/solvers/prop/prop_conv_solver.cpp

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ literalt prop_conv_solvert::convert(const exprt &expr)
172172
literalt literal = convert_bool(expr);
173173

174174
// insert into cache
175-
176175
result.first->second = literal;
176+
177177
if(freeze_all && !literal.is_constant())
178178
prop.set_frozen(literal);
179179

@@ -295,41 +295,6 @@ literalt prop_conv_solvert::convert_bool(const exprt &expr)
295295
return equal ? prop.lequal(tmp1, tmp2) : prop.lxor(tmp1, tmp2);
296296
}
297297
}
298-
else if(expr.id() == ID_let)
299-
{
300-
const let_exprt &let_expr = to_let_expr(expr);
301-
const auto &variables = let_expr.variables();
302-
const auto &values = let_expr.values();
303-
304-
// first check whether this is all boolean
305-
const bool all_boolean =
306-
let_expr.where().type().id() == ID_bool &&
307-
std::all_of(values.begin(), values.end(), [](const exprt &e) {
308-
return e.type().id() == ID_bool;
309-
});
310-
311-
if(all_boolean)
312-
{
313-
for(auto &binding : make_range(variables).zip(values))
314-
{
315-
literalt value_converted = convert(binding.second);
316-
317-
// We expect the identifier of the bound symbols to be unique,
318-
// and thus, these can go straight into the symbol map.
319-
// This property also allows us to cache any subexpressions.
320-
const irep_idt &id = binding.first.get_identifier();
321-
symbols[id] = value_converted;
322-
}
323-
324-
literalt result = convert(let_expr.where());
325-
326-
// remove again
327-
for(auto &variable : variables)
328-
symbols.erase(variable.get_identifier());
329-
330-
return result;
331-
}
332-
}
333298

334299
return convert_rest(expr);
335300
}

0 commit comments

Comments
 (0)