Skip to content

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

Merged
merged 1 commit into from
Sep 19, 2018
Merged

Conversation

xbauch
Copy link
Contributor

@xbauch xbauch commented Sep 14, 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: 6a24c2c).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/84858721

@@ -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);
Copy link
Member

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?

{
INVARIANT(
it->type == quantifiert::UNIVERSAL,
"Only handles quantified variables.");
Copy link
Member

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)

@xbauch
Copy link
Contributor Author

xbauch commented Sep 18, 2018

Lower cases and full stops fixed, redundant return statements removed.

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: fb13b74).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/85159051

@@ -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,
Copy link
Collaborator

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

#include <cstdlib>
#include <fstream>
#include <util/invariant.h>
Copy link
Collaborator

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.

#include <cstdlib>
#include <fstream>
#include <util/invariant.h>
Copy link
Collaborator

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.

#include <cstring>
#include <fstream>
#include <util/invariant.h>
Copy link
Collaborator

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

@@ -11,6 +11,7 @@ Author: CM Wintersteiger
#define CPROVER_SOLVERS_QBF_QBF_QUBE_CORE_H

#include "qdimacs_core.h"
#include <util/invariant.h>
Copy link
Collaborator

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.

#include <cstdlib>
#include <fstream>
#include <util/invariant.h>
Copy link
Collaborator

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.

#include <fstream>
#include <util/invariant.h>
Copy link
Collaborator

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.

@@ -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");
Copy link
Collaborator

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

@@ -9,7 +9,7 @@ Author: Daniel Kroening, kroening@kroening.com
#include "qdimacs_cnf.h"

#include <iostream>
#include <cassert>
#include <util/invariant.h>
Copy link
Collaborator

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.

@xbauch
Copy link
Contributor Author

xbauch commented Sep 19, 2018

Added blank lines before util/invariant.h includes, fixed the skizzo invariant condition typo.

Copy link
Collaborator

@tautschnig tautschnig left a 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.

@xbauch
Copy link
Contributor Author

xbauch commented Sep 19, 2018

Squashed and rebased.

@xbauch xbauch merged commit 13d40b0 into diffblue:develop Sep 19, 2018
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: 706a529).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/85264387

@xbauch xbauch deleted the cleanup_qbf branch December 4, 2018 08:57
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.

4 participants