Skip to content

implement flattening for +/- for the range type #8396

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
Jul 26, 2024
Merged
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
9 changes: 9 additions & 0 deletions src/solvers/flattening/boolbv_add_sub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,15 @@
}
}
}
else if(type.id() == ID_range)
{
// add: lhs + from + rhs + from - from = lhs + rhs + from
// sub: lhs + from - (rhs + from) - from = lhs - rhs - from
mp_integer from = to_range_type(type).get_from();
bv = bv_utils.add_sub(bv, op, subtract);
bv = bv_utils.add_sub(
bv, bv_utils.build_constant(from, op.size()), subtract);

Check warning on line 134 in src/solvers/flattening/boolbv_add_sub.cpp

View check run for this annotation

Codecov / codecov/patch

src/solvers/flattening/boolbv_add_sub.cpp#L130-L134

Added lines #L130 - L134 were not covered by tests
}
else if(type.id()==ID_floatbv)
{
// needs to change due to rounding mode
Expand Down
Loading