General satisfiability (with a few exceptions such as Horn Clauses) is not believed to have an algorithmic solution. However, the following algorithm appears to be a solution for general satisfiability. What exactly is the flaw with the following algorithm?
- Let $W$ be an empty set which will contain all variables that necessarily have to be true or false.
- Let $L$ be the set of clauses.
- Loop through $L$.
- Every time a non-conditional variable† is found, remove it from $L$ and insert it into $W$.
- If this leaves an empty AND implication‡, remove all variables in that empty implication from $L$ and insert into $W$.
- If this leaves an empty OR implication‡, create new instances of the algorithm, where each instance deals with one variable in the implication (i.e. if the implication is: $x V \implies y$, create one instance where $x$ is inserted into $W$, one where $y$ is inserted into $W$ and one where $x$ and $y$ are inserted into $W$).
- Set all variables in $W$ to the value they necessarily have to be.
- Reinsert the variables in $W$ in $L$ with their changed values and check if all clauses are satisfied.
- If satisfiability is met, then return $L$, else return "Not Satisfiable".
† A non conditional variable is defined as a variable that is necessary true or false, e.g. $\implies x$ or $\implies \neg y$.
‡ An empty implication is defined as an implication where one side is empty (e.g. $\implies x \wedge y$) or the other side is necessarily true (e.g. $\mathrm{true} \vee a \implies b$.
To get a more intuitive understanding of the algorithm consider the following set of clauses $L$:
$$\begin{align} a \wedge b &\implies c & \text{(i)} \\ &\implies f \wedge g & \text{(ii)} \\ f &\implies \neg a & \text{(iii)} \\ f \vee a &\implies b & \text{(iv)} \\ &\implies c & \text{(v)} \\ \end{align}$$
The algorithm will do the following:
1) Since $c$, $f$, $g$ are non-conditional variables, the algorithm will insert them into $W$. $W = \{c, f, g\}$.
2) Removing $c$, $f$ and $g$ will leave the empty clauses: $\implies \neg a, a \wedge b, b$. These will be added to $W$. $W = \{c, f, g, b, \neg a\}$.
3) Reinserting the variables into $L$ will result in the first clauses being violated: $a \wedge b \implies c$. Since $a$ is false, $c$ is false, meaning clause (v) is violated. The algorithm will return "Not Satisfiable"
I am aware that the algorithm appears confusing. Please feel free to ask for clarification.
From comments I now realize that there is no known efficient general satisfiability algorithm. I'm still interested in feedback about my algorithm. Does it work? How does it compare with common algorithms?