michael-veksler / solver

0 stars 0 forks source link

Solve signed-CNF (Many Valued SAT). #41

Open michael-veksler opened 1 week ago

michael-veksler commented 1 week ago

Relevant publications:

  1. 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\}$.

  2. 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.

  1. The most generic clause - Each literal is a variable + set of legal values.
  2. Faster signed-clause: each literal is a pair of $lb<=ub$ values, with the semantics of $S=\{k\vert lb\le k \le ub\}$
  3. Fastest signed-clause - each literal is a variable and a single allowed, or banned value.
  4. Binary-clause - for the fastest case of false,true values.
michael-veksler commented 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: