Skip to content

Error handling cleanup in solvers/flattening 4 #2934

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

Conversation

danpoe
Copy link
Contributor

@danpoe danpoe commented Sep 11, 2018

No description provided.

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passed Diffblue compatibility checks (cbmc commit: 1161a36).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/84460365

@@ -18,29 +18,33 @@ bvt boolbvt::convert_replication(const replication_exprt &expr)
return conversion_failed(expr);

mp_integer times;
if(to_integer(expr.op0(), times))
throw "replication takes constant as first parameter";
bool error = to_integer(expr.op0(), times);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd just replace this with numeric_cast_v


// we allow a constant as shift distance

if(expr.op1().is_constant())
{
mp_integer i;
if(to_integer(expr.op1(), i))
throw "convert_shift: failed to convert constant";
bool error = to_integer(expr.op1(), i);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const

{
mp_integer from=string2integer(expr.op0().type().get_string(ID_from));
mp_integer to=string2integer(expr.op0().type().get_string(ID_to));
mp_integer from=string2integer(expr.op().type().get_string(ID_from));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-format

@danpoe danpoe force-pushed the refactor/error-handling-solvers-flattening-from-boolbv-quantifier branch 2 times, most recently from b9a4258 to 1fde831 Compare September 21, 2018 09:25
Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passed Diffblue compatibility checks (cbmc commit: 1fde831).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/85546545

assert(expr.op0().id()==ID_symbol);
DATA_INVARIANT(
expr.operands().size() == 2,
"quantifier expressions shall have two operands");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we have to_quantifier_expr by now, and that method should actually take a quantifier_exprt.

@@ -203,6 +204,8 @@ bool instantiate_quantifier(exprt &expr,

literalt boolbvt::convert_quantifier(const exprt &src)
{
PRECONDITION(src.id() == ID_forall || src.id() == ID_exists);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method should take a quantifier_exprt


bvt bv;
bv.resize(width);

std::size_t offset=0;
//std::size_t offset=0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete?

@danpoe danpoe force-pushed the refactor/error-handling-solvers-flattening-from-boolbv-quantifier branch from 1fde831 to f971997 Compare September 23, 2018 19:50
Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passed Diffblue compatibility checks (cbmc commit: f971997).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/85672302

@danpoe danpoe force-pushed the refactor/error-handling-solvers-flattening-from-boolbv-quantifier branch from f971997 to 213bfeb Compare September 24, 2018 19:41
Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passed Diffblue compatibility checks (cbmc commit: 213bfeb).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/85784112

@danpoe danpoe force-pushed the refactor/error-handling-solvers-flattening-from-boolbv-quantifier branch from 213bfeb to 44503dd Compare September 25, 2018 12:47
Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passed Diffblue compatibility checks (cbmc commit: 44503dd).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/85871012

@danpoe danpoe merged commit ffe62af into diffblue:develop Sep 27, 2018
@danpoe danpoe deleted the refactor/error-handling-solvers-flattening-from-boolbv-quantifier branch June 2, 2020 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants