-
Notifications
You must be signed in to change notification settings - Fork 36
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
Pycosat doesn't work with tuples #13
Comments
"duplicates are sorted out automatically" --> actually, this sounds trivial, but it's a bit reinventing the wheel. Modern SAT solvers (e.g. precosat) will do better than that: shorter clauses will even subsume longer clauses. So |
Sure, but my issue is that I want to store a bunch (a bunch) of clauses before sending them to the SAT solver. Storing duplicates means using a lot more memory. In general, generating clauses can take longer and use more memory than the solving itself, so it really is something that you have to optimize on. |
On a related point, you could use an API like this:
This would mean that pycosat is storing the clauses which is more efficient, as pycosat trims the clauses immediately of variables that have already been set: e.g. if |
Does picosat have this functionality built in? If not, what is the best kind of data structure to do this? |
Picosat has implicit 2-long, but not 3-long I think. However, typically 2-longs are the most prevalent. It does have the auto-propagation and auto-literal-removal/auto-clause-removal inside. It probably doesn't have subsumption ( By the way, precosat should have exactly the same interface as picosat, so you can substitute one for the other and it's done. Nothing important needs to be changed, just the .cpp copied over and the #include fixed. Then it would be pyprecosat or something :) |
I would just add precosat support in pycosat. |
Sounds good. Also you might want to add the interface with the |
@ilanschnell this is causing a serious slowdown in conda. Converting a set of 5434776 tuples to lists takes about 20 seconds. If I understand #4 correctly this is already fixed, so a release just needs to be made. |
In the current PIP version this doesn't work :( and python is crashing when I pass my list of clauses... I guess it is too big
|
Well, I am not a developer of pycosat. I develop cryptominisat. I suggest you use pycryptominisat. It will work out of the box. Also, I promise to fix it asap. I have >300 closed issues on CryptoMiniSat: https://github.com/msoos/cryptominisat/issues and over 9000 commits. |
Hi there, thank you for your contribution! This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs. If you would like this issue to remain open please:
NOTE: If this issue was closed prematurely, please leave a comment. Thanks! |
This is particularly annoying because it's often convenient to put clauses in a set, (and even have the clauses themselves be frozensets), so that duplicates are sorted out automatically.
The text was updated successfully, but these errors were encountered: