Skip to content

Use propt::lcnf instead of propt::l_set_to{true,false} #2033

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
Feb 25, 2019

Conversation

tautschnig
Copy link
Collaborator

@tautschnig tautschnig commented Apr 9, 2018

Some code cleanup to avoid redundant clauses. Still needs proper evaluation, thus marking do-not-merge.

Copy link
Collaborator

@martin-cs martin-cs left a comment

Choose a reason for hiding this comment

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

Will approve with some kind of confirmation of issues around memory usage and performance and some kind of discussion of the lcnf issue.

simplify(implication, ns);
const bvt &bv2 = convert_bv(implication);
CHECK_RETURN(bv2.size() == 1);
prop.l_set_to_true(bv2[0]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I recall changing uncached converts to cached ones here and it having a strange impact on performance. It might be worth checking this.

@@ -253,7 +253,7 @@ void arrayst::add_array_constraint(const lazy_constraintt &lazy, bool refine)
else
{
// add the constraint eagerly
prop.l_set_to_true(convert(lazy.lazy));
prop.lcnf(bvt(1, convert(lazy.lazy)));
Copy link
Collaborator

Choose a reason for hiding this comment

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

This rather assumes that CNF's are cheaper than assignments, which may not always be true. For example, the AIG back-end prefers avoiding CNF. Is there another way this can be done? Do we need a 'set disjunct to true / false' method?

Copy link
Member

Choose a reason for hiding this comment

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

Also much harder to read. There are many people who don't know what "CNF" is.

Avoids the lower-level l_set_to(..., {true,false}) and may then
highlight opportunities for further optimisation.
@tautschnig tautschnig changed the title Cleanup of Boolean encoding Use propt::lcnf instead of propt::l_set_to{true,false} Feb 25, 2019
@tautschnig tautschnig assigned martin-cs and unassigned tautschnig Feb 25, 2019
@tautschnig
Copy link
Collaborator Author

This is now just the first, (I believe) uncontroversial and very small commit. @martin-cs would you mind taking another look?

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.

🚫
This PR failed Diffblue compatibility checks (cbmc commit: 8c5303a).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/102145374
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.

Common spurious failures:

  • the cbmc commit has disappeared in the mean time (e.g. in a force-push)
  • the author is not in the list of contributors (e.g. first-time contributors).

The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.

@tautschnig tautschnig dismissed martin-cs’s stale review February 25, 2019 17:31

Dismissing as the comments only concerned commits no longer in this PR.

@tautschnig tautschnig merged commit 98f33a7 into diffblue:develop Feb 25, 2019
@tautschnig tautschnig deleted the lcnf-cleanup branch February 25, 2019 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants