-
Notifications
You must be signed in to change notification settings - Fork 277
Cleanup error handling in solvers/qbf #2961
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
There was a problem hiding this 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: 6a24c2c).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/84858721
src/solvers/qbf/qbf_bdd_core.cpp
Outdated
@@ -80,7 +80,7 @@ qbf_bdd_coret::~qbf_bdd_coret() | |||
|
|||
tvt qbf_bdd_coret::l_get(literalt a) const | |||
{ | |||
assert(false); | |||
UNREACHABLE; | |||
return tvt(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this required here and not below, eg in m_get
?
src/solvers/qbf/qbf_bdd_core.cpp
Outdated
{ | ||
INVARIANT( | ||
it->type == quantifiert::UNIVERSAL, | ||
"Only handles quantified variables."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
start with lower case (several occurrences)
Lower cases and full stops fixed, redundant return statements removed. |
There was a problem hiding this 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: fb13b74).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/85159051
src/solvers/qbf/qbf_bdd_core.cpp
Outdated
@@ -310,7 +312,9 @@ const exprt qbf_bdd_certificatet::f_get(literalt l) | |||
|
|||
// no cached function, so construct one | |||
|
|||
assert(model_bdds[l.var_no()]!=NULL); | |||
INVARIANT( | |||
model_bdds[l.var_no()] != NULL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While at it: please use nullptr
instead of NULL
src/solvers/qbf/qbf_quantor.cpp
Outdated
#include <cstdlib> | ||
#include <fstream> | ||
#include <util/invariant.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit-pick: add a blank line before this include.
src/solvers/qbf/qbf_qube.cpp
Outdated
#include <cstdlib> | ||
#include <fstream> | ||
#include <util/invariant.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit-pick: add a blank line before this include.
src/solvers/qbf/qbf_qube_core.cpp
Outdated
#include <cstring> | ||
#include <fstream> | ||
#include <util/invariant.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move one line down to group with the mp_arith.h
include
src/solvers/qbf/qbf_qube_core.h
Outdated
@@ -11,6 +11,7 @@ Author: CM Wintersteiger | |||
#define CPROVER_SOLVERS_QBF_QBF_QUBE_CORE_H | |||
|
|||
#include "qdimacs_core.h" | |||
#include <util/invariant.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit-pick: add a blank line before this include.
src/solvers/qbf/qbf_skizzo.cpp
Outdated
#include <cstdlib> | ||
#include <fstream> | ||
#include <util/invariant.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit-pick: add a blank line before this include.
src/solvers/qbf/qbf_skizzo_core.cpp
Outdated
#include <fstream> | ||
#include <util/invariant.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit-pick: add a blank line before this include.
src/solvers/qbf/qbf_skizzo_core.cpp
Outdated
@@ -234,8 +236,7 @@ bool qbf_skizzo_coret::get_certificate(void) | |||
e_lists=e_lists.substr(space+1); | |||
} | |||
|
|||
if(!result) | |||
throw "existential mapping from sKizzo missing"; | |||
INVARIANT(!result, "existential mapping from sKizzo missing"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the negation, i.e., the invariant is result
, not !result
src/solvers/qbf/qdimacs_cnf.cpp
Outdated
@@ -9,7 +9,7 @@ Author: Daniel Kroening, kroening@kroening.com | |||
#include "qdimacs_cnf.h" | |||
|
|||
#include <iostream> | |||
#include <cassert> | |||
#include <util/invariant.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit-pick: add a blank line before this include.
Added blank lines before |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, please squash and rebase.
Squashed and rebased. |
There was a problem hiding this 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: 706a529).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/85264387
No description provided.