Open michael-veksler opened 1 week ago
First step is to implement a poly-time translation from mvSAT to Bool-SAT. The complexity if the translation (to bool-sat and back) is O(N+M), where N is the sum of domain sizes of all variables and M is the sizes of all signed-literals of all clauses. The size of a literal $q\in S$ (or $S:q$ in the notation of the first citation) is the size of the set S.
The translation goes this way:
i\in D_k \setminus \{min(D_k)\}
$ bool clauses $\neg r{k,i} \vee r{k,i-1}$ .
Note that if there are gaps in $D_k$, like in $D_7=\{1,2,4\}
$, then we avoid defining the values in the gap. In this example we get $\neg r{7,4}\vee r{7,2}$ .
For such cases, for $(i\in D_k) \wedge i > \min(D_k) \wedge prev(D_k,i) > \min(D_k)
$ the bool-clause becomes $\neg r{k,i} \vee r{k,prev(D_k, i)}$, where $prev(D_k, i)\triangleq \max(\{j\in D_k\vert j < i\})
$ .
Reminder: $r_{k,\max(Dk)}\equiv p{k,\max(D_k)}$ .next(D_k,i)\triangleq \min(\{j\in D_k\vert j > i\})
$ .
Relevant publications:
There is a nice overview of signed-CNF in The SAT Problem of Signed CNF Formlas by Bernhard Beckert, Reiner Hähnle, and Felip Manyà.
They define a signed literal as $S:q$, where S is a set of values and q is a variable, so that the literal is satisfied if $L$, the interpretation of $q$, assigns a value to $q$, such that $L(q) \in S$. They also define special cases of $S$ such as $i\uparrow$ and $j\downarrow$, which for numeric ordering of
\le
mean $\{ k\in N\vert k\ge i\}
$ and $\{k\in N\vert k\le j\}
$.This is a also a CDCL based algorithm for unrestricted signed-CNF in A Proof-Producing CSP Solver by Michael Veksler and Ofer Strichman.
To support mvSAT efficiently, implement 4 types of signed-clauses.
S=\{k\vert lb\le k \le ub\}
$