The boolean satisfiability problem (also called SAT problem) is a decision problem in propositional logic that asks if a proposition or its equivalent boolean expression is satisfiable. That is, it asks if there is some configuration of boolean values that can be substituted to make the expression true. It is NP-Complete. In fact, it was the first problem proven to be NP-Complete (by the Cook–Levin theorem)
Almost all propositions are expressed in conjunctive normal form (CNF) to simplify them into a consistent form.
Naïve Satisfiability Algorithm
- Convert formula to CNF
- Brute-force resolutions by choosing any two clauses and trying to obtain a resolution from them.
This algorithm will always terminate.
Horn Clause Satisfiability Algorithm
If the problem can be converted into CNF and every clause is a Horn clause, then a faster algorithm exists:
Let be the formula that we are evaluating:
- Create a list of all atoms in , plus and
- ‘Mark’ any occurrences of (initially, one will be marked)
- While there exists a definite Horn clause :
- If are all marked and is unmarked:
- Mark
- If are all marked and is unmarked:
- If is marked, return unsatisfiable, else return satisfiable