Skip to content
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

Add Exact Qrisp SAT Solver Variant #113

Draft
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

tubadzin
Copy link
Contributor

@tubadzin tubadzin commented Jan 13, 2025

exact_sat.py and the corresponding ExactQrispSatSolver class

This variant utilizes (almost) the same logic as the default QrispSatSolver. The key difference is that this version (in theory) avoids considering impossible variable assignments. For this, the Oracle needs to know the size of the solution space.

sharp-sat-solver

As mentioned above, exact_sat.py requires the size of the solution space to function correctly. To address this, I have added a Linux binary that, given a .cnf file, approximates the number of solutions. Unfortunately, this approximation fails in trivial cases where the .cnf file is unsatisfiable, such as:

p cnf 1 2
1 0
-1 0

This case should obviously return 0, but the solver instead returns 1 or 2 (if pre-processing is disabled). The issue arises because the solver simplifies contradictory clauses, and once removed, the remaining formula is interpreted as having no constraints, allowing x to take any value (both true and false).

Additionally, I attempted to compile this program for Windows, but to no avail. Both cross-compiling and building it on my Windows machine failed. This led me down a long rabbit hole where I replaced platform-dependent code iteratively. While I eventually managed to build an .exe, it still produced errors when running. I have yet to find another SharpSAT solver that works on Windows. Some alternatives I considered are:

@tubadzin tubadzin self-assigned this Jan 13, 2025
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
27.3% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@tubadzin tubadzin mentioned this pull request Jan 13, 2025
@tubadzin tubadzin linked an issue Jan 13, 2025 that may be closed by this pull request
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.

Add exact qrisp SAT solver
1 participant