# Monthly Archives: April 2019

## Pre-Partitioned Truth Assignment

The next game in the appendix is “Sift”, but the Schaefer paper we’ve been using has that reduction depend on two other problems, so we’ll do those first.   Schaefer calls this problem “G%free(CNF)”, I made up the name we’re using.

The problem: Pre-Partitioned Truth Assignment.  This problem is not in the appendix.

The description: Given a CNF formula A, where the variables in A are partitioned into two equal size sets, V1 and V2.   On player 1’s turn player 1 chooses a variable in V1 and chooses to make it true or false,  On player 2’s turn, player 2 chooses a variable in V2 and chooses to make it true or false.  Player 1 wins if the variable assignments made by both players make A true.  Does A have a forced win?

Example: Here’s the equation from last time: {(x1 ∨ x2 ∨ x3), (~x1 ∨~x2∨ ~x3), (~x4, x1, ~x2)}  Lets say that V1 = {x1, x2} and V2 = {x3. x4}.  Then player 1 can force a win by setting x2 to false on their first turn, making the second and third clauses true.  Since player 2 can only set x3 or x4 on their turn, they can’t stop player 1 from setting x1 to true on their next turn, making all clauses true.

Here’s another example where player 1 loses: {(x1  ∨ x3 ∨ x4), (~x1 ∨ x3 ∨ x4), (x2 ∨ ~x3 ∨ ~x4).  If we again have  V1 = {x1, x2} and V2 = {x3. x4}, then player 2 wins by setting both x3 and x4 to false because no matter what player 1 does, they have to set x1 somehow, which will make one of the first two clauses false.

Reduction: (This problem is Theorem 3.8 in Schaefer’s paper).  Just like in most of the reductions in the Schaefer paper, we start with an instance of QBF where we have variables x1 through xn (n is assumed to be even), and the formula alternates with “There exists” (starting with x1, on all of the odd-numbered variables up through xn-1) and “For all” (starting with x2, on all of the even-numbered variables up through xn) quantifiers on the variables, leading into a CNF formula A0.  We need to build up an instance of Pre-Partitioned Truth Assignment by creating a new formula A’ and the variable sets V1 and V2.  For each variable in the QBF formula xi, our formula has 3 variables: xi, yi, and zi.  V1 holds xi, yi, and zi+1 when i is odd, and V2 holds xi, yi, and zi-1 if  i is even.

The formula is pretty complicated but is built to force zi to be set by one player to the same value of either xi or yi by the other player (and so must be set after the corresponding xi or yi is chosen).  The optimal move will be to play zi immediately after the corresponding xi or yi, forcing the choice back on the other player.  So that player will play the other of xi or yi (rather than open up some other variable’s x or y, only to be responded with by the corresponding z).   Then it will be the other player’s turn to choose the next xi+1 or yi+1.

The values of xi correspond to the literals in the original QBF formula, so assuming players play “correctly”, player 1 takes the role of the “there exists” player in the QBF formula, and player 2 takes the role of the “for all” player in the formula.  And if there is a way to set the x variables in the new formula to make it satisfiable, then there is a way to make the original QBF formula satisfiable.

Difficulty: 9.  For this problem, even Schaefer admits the proof is hard to follow, so he spends a page explaining what the goal of the construction is before diving into the proof.  I do like the reappearance of the “triples” of moves where a meaningful decision by a player is followed by 2 forced moves, making the next meaningful decision be placed on the other player.

## Variable Partition Truth Assignment

We’re going to dive into a couple of logic games for the next couple of posts before we come out with I think of as more “game-like” games.

The problem: Variable Partition Truth Assignment.  This is problem GP5 in the appendix.

The description: Given a set U of variables, and a set C of clauses over U, players play a game where they alternate choosing variables from U.  The variables Player 1 chooses will be set true, and the variables Player 2 chooses will be set to false.  Player 1 wins if all clauses in C are satisfied.  Can player 1 force a win?

Example: Here is a small example: The clauses will be: {(x1 ∨ x2 ∨ x3), (~x1 ∨~x2∨ ~x3), (~x4, x1, ~x2)}

Player 1 can force a win by choosing x1, which will be set to true.  This satisfies both clauses 1 and 3.  Player 2 does not want to choose x2 or x3 (since any variable player 2 chooses will be set to false, making clause 2 true), so they’ll choose x4.  Then player 1 picks either of x2 or x3 (clause 2 is still not satisfied, because the variable must be set to true by player 1), then player 2 must set the other one to false, satisfying clause 2.

Reduction: The paper by Schaefer that we’ve been going through calls this “GPOS (POS CNF)” and focuses on the subcase where we’re given a formula where all of the variables are positive.  If even that case is NP-Complete, then the generalized case where we allow negated literals is also NP-Complete.  The reduction in the paper is from Sequential Truth Assignment, specifically the case where the problem has 3 variables per clause.  So we’re given an input that is a set of 2n variables, which we can view as alternating between ∃ and ∀, and a set of m clauses with at most 3 literals per clause.  We’re going to build a new formula A’ out of many pieces.  The variables are all positive, but some of the variable names will correspond to negated literals.  We’ll have 2n “x” variables, 2n “~x” variables, and 2n “u” variables.  He then builds up a pretty crazy formula.  The point of the formula is to force a 6-move sequence between the players:

• On move 6k+1 (so the first move of “round” k), player 1 chooses either x2n-2k or ~x2n-2k to become true.
• The next move, player 2 chooses the other of that pair to become false.
• The next move, player 1 chooses u2n-2k to become true
• On moves 6k+4 through 6k+6, we repeat the same sequence, but this time, player 2 can choose whether to make x2n-2k-1 or ~x2n-2k-1 false.  Then we end with player 2 choosing u2n-2k-1 to become false.

Notice how each set of 3 moves corresponds to one truth assignment of one variable in the Sequential Truth Assignment game (which alternates between player 1 and player 2 choosing the assignment).  Also, notice how player 1 choosing a variable xi corresponds to setting it true in the Sequential Truth Assignment game, and player 1 choosing a ~xi variable to be set to true corresponds to making the corresponding Sequential Truth Assignment variable false. (The opposite assignments occur when player 2 chooses)

The hard part of the proof (and of the formula) involves all of the various ways the other player can force a win if the sequence above is not followed.

Difficulty: 9.  The formula in the paper is very hard to follow, which is why I didn’t go into it here- I think the important part is how it all works out.  Since I couldn’t think of a way to explain it without going on for pages, I figured just explaining the idea was a better strategy.