Skip to content

Do not unnecessary follow tag types when storing the boolbv mapping #4364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/solvers/flattening/boolbv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -573,11 +573,11 @@ bool boolbvt::boolbv_set_equality_to_true(const equal_exprt &expr)
if(!equality_propagation)
return true;

const typet &type=ns.follow(expr.lhs().type());
const typet &type = expr.lhs().type();

if(expr.lhs().id()==ID_symbol &&
type==ns.follow(expr.rhs().type()) &&
type.id()!=ID_bool)
if(
expr.lhs().id() == ID_symbol && type == expr.rhs().type() &&
type.id() != ID_bool)
{
// see if it is an unbounded array
if(is_unbounded_array(type))
Expand Down
5 changes: 5 additions & 0 deletions src/solvers/flattening/boolbv_get.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ exprt boolbvt::get(const exprt &expr) const
if(it!=map.mapping.end())
{
const boolbv_mapt::map_entryt &map_entry=it->second;
// an input expression must either be untyped (this is used for obtaining
// the value of clock symbols, which do not have a fixed type as the clock
// type is computed during symbolic execution) or match the type stored in
// the mapping
PRECONDITION(expr.type() == typet() || expr.type() == map_entry.type);

if(is_unbounded_array(map_entry.type))
return bv_get_unbounded_array(expr);
Expand Down