Questions tagged [sat]

In computer science, the Boolean Satisfiability Problem (or SAT) is the problem of determining if there exists an interpretation that satisfies a given boolean formula.

Mainly from Wikipedia:

In computer science, the Boolean Satisfiability Problem (sometimes called Propositional Satisfiability Problem and abbreviated as satisfiability or SAT) is the problem of determining if there exists an interpretation that satisfies a given Boolean formula.

In other words, it asks whether the variables of a given Boolean formula can be consistently replaced by the values true or false in such a way that the formula evaluates to true.

If this is the case, the formula is called satisfiable. On the other hand, if no such assignment exists, the function expressed by the formula is identically false for all possible variable assignments and the formula is unsatisfiable.

  • For example, the formula "a AND NOT b" is satisfiable because one can find the values a = TRUE and b = FALSE, which make "a AND NOT b" TRUE.

  • In contrast, "a AND NOT a" is unsatisfiable.

SAT is one of the first problems that was proven to be NP-complete. This means that all problems in the complexity class NP, which includes a wide range of natural decision and optimization problems, are in a technical sense equally difficult to solve as SAT.

There is no known algorithm that efficiently solves SAT, and it is generally believed that no such algorithm exists; yet this belief has not been proven mathematically, and resolving the question whether SAT has an efficient algorithm is equivalent to the P versus NP problem, which is the most famous open problem in the theory of computing.

Despite the fact that no algorithms are known that solve SAT efficiently, correctly, and for all possible input instances, many instances of SAT that occur in practice (such as in artificial intelligence, circuit design and automatic theorem proving) can actually be solved rather efficiently using heuristical SAT-solvers.

Such algorithms are not believed to be efficient on all SAT instances, but experimentally these algorithms tend to work well for many practical applications.

Nowadays, the research on the SAT theory continues, if you want to keep up to date with this research, feel free to visit: http://www.satlive.org/.

289 questions
2
votes
1 answer

Boolean unification in Prolog?

I am struggling alreay for a long time with the following problem. I want to make the usual unification of Prolog more smart. Basically I want that certain variables understand that for example 0 = ~1 and 1 = ~0. This doesn't work normally: ?-…
user502187
2
votes
1 answer

CNF by truth table

I have a boolean function that is presented by truth table. In total it is 10 variables and I'd like to get CNF with a reasonable length (not necessary the shortest, but short enough). How can I do it? Python script or any public available software…
knst
  • 523
  • 2
  • 16
2
votes
2 answers

Generating unsatisfiable test problems

I'm trying to generate some test problems for propositional satisfiability, in particular to generate some that are unsatisfiable, but according to a fixed pattern, so that for any N, an unsatisfiable problem of N variables can be generated. An easy…
rwallace
  • 31,405
  • 40
  • 123
  • 242
2
votes
1 answer

Rounding LinearExpr with google or-tools SAT solver

I'm creating a constraint (in Java) using or-tools SAT solver: IntVar x, y, z; IntVar[] variables = new IntVar{x, y, z}; int[] multiplier = new int{2, 3, 3}; LinearExpr expression = LinearExpr.scalProd(variables, multiplier); //2x + 3y +…
forhas
  • 11,551
  • 21
  • 77
  • 111
2
votes
0 answers

Why is z3 incremental performance so bad?

I have the following python code: from z3 import * import time s = Solver() p = Array("p", BitVecSort(11), BitVecSort(8)) for m in range(200): start_time = time.time() for i in range(20): s.add(Or([p[m*20 + i] % 72 ==…
lightning
  • 389
  • 1
  • 9
2
votes
1 answer

Incremental weakening Maxsat

I've an idea about MaxSat and have already implemented a naive Maxsat solver using MSU3 along with sequential encoding with minisat APIs I was wondering if there's a way to speed up this solver. I came with this…
2
votes
1 answer

SAT is NP complete, so why don't we have k-SAT is NP complete for arbitrary value of k

k-SAT is a special case of SAT. Since SAT is NP-complete, I don't understand why we don't have k-SAT is NP-complete for whatever values of k. In the class, my professor used polynomial reduction from SAT to prove that 3-SAT is NP-complete. I don't…
old man
  • 141
  • 4
2
votes
1 answer

How does the SCIP code treat SAT problems?

I am trying to find out how SCIP treats SAT problems. In the SCIP website, it is recommended to type 'set emphasis cpsolver' in the command line for SAT problems after reading the cnf file. The SCIP solver would then do its own thing after typing…
2
votes
1 answer

How to Solve Vertex Cover Problem by SAT and Optimization?

So right now I am working on using SAT to resolve the minimum vertex cover problem, and here is my encoding for the graph G = {V,E} has k vertex cover, and here are the clauses: Let n = sizeof(V); Firstly, at lease one vertex is in the vertex…
RobinXu
  • 23
  • 6
2
votes
2 answers

finding max of the numbers in z3 using SMTLIB2

I have 7 cups which contains some water. I need to program these cups to have different amounts of water. Once this is done I need to measure the cup which has the highest amount of water and then remove some quantity (say 2 units of water). c…
2
votes
2 answers

How to implement non chronological backtracking

I'm working on a CDCL SAT-Solver. I don't know how to implement non-chronological backtracking. Is this even possible with recursion or is it only possible in a iterative approach. Actually what i have done jet is implemented a DPLL Solver which…
man zet
  • 826
  • 9
  • 26
2
votes
1 answer

I understand 2 SAT can be solved in Polynomial time finding out Strongly Connected Components. What about doing the same for 3SAT?

In case of 3SAT instead of getting 2 implications for one clause, we'd get 12(3C2*2*2) maybe.and which will form a graph of 12m edges when m is the number of clauses in 3 CNF and we can still find out the Strongly Connected Components in that…
2
votes
2 answers

Why Z3Py does not provide all possible solutions

I ran into a problem where Z3Py does not enumerate all possible solutions for the given Boolean clauses. I was wondering if anyone knows why this is happening. Here is the code I use for the Z3Py. There are 5 booleans: 1 2 3 4 and 5. from z3 import…
szczocik
  • 1,293
  • 1
  • 8
  • 18
2
votes
0 answers

How to implement AND logic in Z3Py

I want to implement a constraint which requires AND logic in Z3Py. Suppose we have two variables a and b, I just want to add one constraint which requires a == 0 and b == 1. There should be several ways which can do this in Z3, like s.add(a == 0, b…
Francis
  • 189
  • 1
  • 11
2
votes
1 answer

Why a Boolean Logic Statement Needs to be in Conjunctive Normal Form (CNF)

Most things I've seen on processing boolean logic formulas says first to convert it to CNF or DNF form. Wikipedia says it is "useful in automated theorem proving", but not much more. Wondering why it is necessary to perform this step, what aspect of…
Lance
  • 75,200
  • 93
  • 289
  • 503