Skip to content

Document SAT API. #4096

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 2 commits into from
Feb 7, 2019
Merged

Conversation

NlightNFotis
Copy link
Contributor

Add some basic explanation of how the SAT api we are working with is implemented.

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

The interface supports the following operations by default:
1. Boolean operations on literals (like `and`, `or`, `xor`), etc.
These take as input two [literal](\ref literalt) and return as
output another [literal](\ref literalt).
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should likely reference https://en.wikipedia.org/wiki/Tseytin_transformation or some more original description of it.

as variables to the formula and returning the number of variables
or clauses the solver is operating with (with `no_variables`).
3. Simulate gate operations on literals, applying Tseitin's
transformation on them. Tseitin's transformation converts a
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, I thought 1. was describing the same?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's weird if I'm honest, I don't know how to describe it better. At least from the preexisting function documentation, the gate_x functions seem to be implementing tseitin's transformation, and the literal_x functions are just setup functions that end up calling equivalent the gate_x ones. Both are part of the interface of cnft, and I don't know which ones are to be favoured (they seem to be doing the same thing, but with a different interface).

I'm open to suggestions on how to rephrase it in a way that makes more sense.

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 the gate_* simply should not be part of the public interface, AFAIK they aren't actually used outside the class! They are concrete implementations of the lx functions, which the propt interface prescribes. Would you mind adding a commit to this PR that shifts the protected up to line 45 of cnf.h?

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

@NlightNFotis
Copy link
Contributor Author

@hannes-steffenhagen-diffblue @tautschnig Outstanding comments have been addressed. Can I get another review on this please?

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

@NlightNFotis
Copy link
Contributor Author

@tautschnig This is ready for another review now.

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

@tautschnig
Copy link
Collaborator

@NlightNFotis This needs a rebase to pick up the Windows CI fix.

Add some basic explanation of how the SAT api
we are working with is implemented.
@NlightNFotis NlightNFotis merged commit 0ae8677 into diffblue:develop Feb 7, 2019
@NlightNFotis NlightNFotis deleted the sat_solver_api_doc branch February 7, 2019 17:15
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: 1d3aa5c).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/100119505
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants