Category Archives: Appendix-Logic

First Order Theory of Equality

LO11 is QBF

This next problem is related to QBF and is proved in a similar way.

The problem: First Order Theory of Equality.  This is problem LO12 in the appendix.

The description: Given a set U of variables {u1..un}, and a sentence S over U in the first order theory of equality.  Is S true in all models of the theory?

The first order theory of equality defines logical operations for equality (on variables), and the standard ∧, ∨, ¬, → operations (on expressions).  It also lets us define ∀ and ∃ quantifiers on variables outside of an expression.

Example: My lack of mathematical logic knowledge is again letting me down as I’m not entirely sure what the difference between “models of the theory” and “assignments of truth values” is.  It seems to me that this is very similar to QBF, with the addition of equality. So I think we can ask whether an expression like:

∀x ∀y ∀z (x=y) → (x = z) is always true.  (It is).

I think, at least, this is the meaning that the Stockmeyer and Meyer paper use.

Reduction: Stockmeyer and Meyer again do a “generic transformation” using Turing Machines.  What they do is the generic transformation for QBF (it’s Theorem 4.3), and then show this problem is a corollary to it because it follows from the “well-known fact that a first-order formula with n quantifiers and no predicates other than equality is valid iff it is valid for domains of all cardinalities between 1 and n”.

It’s not a well-known fact to me, so I guess I’ll just trust them.

Difficulty: I guess it depends on just how “well-known” that fact is for your class.  If I gave the QBF reduction a 3, maybe this is a 5?  But if you have to tell them the fact, maybe it’s too obvious?  I don’t know.

Truth-Functionally Complete Connectives

This is another “private communication” problem that I couldn’t find an obvious reduction for online.  I’ve used the holidays as an excuse to not put up a post so I could work on this problem, but even with the extra time, this problem has stumped me.

The problem: Truth-Functionally Complete Connectives.  This is problem LO10 in the appendix.

The description: Given a set U of variables, and a set C of well-formed Boolean expressions over U, is C truth-functionally complete?  In other words, can we find a finite set of unary and binary operators D = {θ1..θk} such that for each θi we can find an expression E in C, and a substitution s: U->{a,b} such that s(E) ≡ aθib (if θi is binary) or s(E) ≡ θia (if θi is unary)?

Example: So, “Truth-Functionally Complete” means that you can use the operations in D to generate all possible truth tables.  So some possible candidates for D are {AND, NOT} or just {NAND}.

So, if U = {x,y} and C = {~x, x∧y}, then I can just choose D to be {NOT, AND} and use the obvious substitution.  I think the hard part here is that the problem asks if such a D exists- I think the substitutions are probably always straightforward, once you get the functionally complete set D that gives you the best mapping..

Reduction: As I said above, this is a “Private Communication” problem, and so after a lot of searching, I found this paper by Statman, which I’m honestly am not even sure is the correct one. It at least talks about substitutions and deterministic polynomial time algorithms and things, but it very quickly goes into advanced Mathematical Logic that I wasn’t able to follow.  If someone out there knows more about this than I do and wants to chime in, let me know!

Difficulty: 10.  This is why we have the level 10 difficulty- for problems I can’t even follow.

Minimum Disjunctive Normal Form

LO7 is Satisfiability of Boolean Expressions, which is what we now call Cook’s Theorem. It’s related to the “regular” (clause-based) Satisfiability we’ve done all along because it’s possible to turn any Boolean expression into CNF form.

LO8 is DNF Non-Tautology.

The next problem’s paper was written in 1965, so before NP-Completeness was a concept.  As a result, the paper doesn’t line up exactly with what we want to do, and I think I’m misunderstanding something.

The problem: Minimum Disjunctive Normal Form.  This is problem LO7 in the appendix.)

The description: Given a set u1 through un of variables, a set A of n-tuples containing T or F symbols (possible truth assignments of the variables), and an integer K, can we create a DNF form expression E that is true for the variable set exactly for the truth assignments in A (everything in A and nothing more) using K clauses or less?

Example: Suppose we had 3 variables, and A was {(T,T,F), (T,F,F)}.

Then the DNF expression (u1 ∧ u2 ∧ ~u3) ∨ (u1 ∧~u2 ∧ ~u3) will be true only on the truth assignments listed in A.

We can get away with less than “one clause for each element of A” though.  For example, if A = {(T,T,T), (T,T,F), (T,F,T), (F,T,T), (T,F,F), (F,T,F)}  then we can just use u1 ∨ u2 to cover exactly those truth assignments.

Reduction: The paper by Gimpel was written in 1965 (before Cook’s 1971 paper), so wasn’t conceived of as an NP-Completeness reduction.  But it does show how to translate from Set Covering.

The basic idea is that we will represent a covering instance as a 0/1 table A.  We start with an m by n table, with variables representing the rows and sets representing the columns (aij = 1 means that variable i is in set j)

We’re now going to build some boolean expressions over m+n variables:

pi = u1 ∧ u2 ∧ … ∧ ~ui ∧ … ∧ um+n

(All of the positive variables and-ed together, except the negation of ui)

f1 = p1 ∨ p1 ∨ … pn

Fi = {j | aij = 0}  (The set of all variables not in set i)

Pi = un+i ∧ uj (the conjunct of all uj where j ∈ Fi)

f2 = P1 ∨ … Pn

Then he proves that f1 and f2 form a pair of functions for which A is the prime implicant table of those functions.  By which he means that aij = 1 if and only if pj ∈ Pi.

Then we build a table B that represents the prime implicant table of a related function.  If we remove the last r rows and 2r columns from B (I think this is related to K somehow), we get a table that is equivalent to our A.

Difficulty: 9.  I’m pretty sure I’m missing something here.  I don’t see how these tables relate.  I don’t see how you can take f1 and f2 and make a single DNF formula out of them.  I don’t see where K shows up- I guess it’s a limit on n?  But how does it relate to the covering matrix?

Generalized Satisfiability

We’re starting a new section and a lot of the introductory problems have been covered elsewhere.

LO1 is Satisfiability

LO2 is 3-Satisfiability

LO3 is Not all Equal 3SAT

LO4 is One-In-Three 3SAT

LO5 is Maximum 2SAT

After that we finally get to a new problem:

The Problem: Generalized Satisfiability.  This is problem LO6 in the appendix.

The description: Given a list of positive integers k1 through km and a sequence S = <R1..Rm>, where each Ri is a set of strings of ki “T” or “F” symbols.  We’re also given a set U of variables, and a set of collections C1 through Cm.  Each Ci contains a ki-tuple of variables from U.

Can we assign a truth value (“T” or “F”) to each variable in  U such that for each tuple in Ci the truth value of each variable in the tuple matches the sequence of true and false values in Ri?

Example: Let all ki = 3, and m = 2.  R1 = {(T,T,T), (F,F,F)}  R2 = {(T,F,F). (F,T,T)}

U = {x1, x2, x3}.  C1 = (x1, x2, x3}.  C2 = {x1, x2, x3}

So, the question is: Can we assign truth values to x1 x2 and x3 so that the truth values map to a sequence in both R0 and R1?  Since we have the same sequences of the same variables in both sets, the answer is no.

But, suppose we change C2 to (x4, x2, x3).  Then we can set x1, x2, and x3 to true and x4 to false.  This will let the sequence in C1 map to the (T,T,T) sequence in R1, and the sequence in C2 map to the (F,T,T) sequence in R2.

Reduction: This reduction is in Shaefer’s paper, and it reduces from 3SAT.  The idea is that we will build 4 R sets, thinking of them as functions.  So:

R0 = {R(x,y,z) | x or y or z is true} = {(T,T,T), (T,T,F), (T,F,T), (T,F,F), (F,T,T), (F,T,F), (F,F,T)}

R1 =Same idea, but  “~x or y or z is true”

R2 = “~x or ~y or z is true”

R3 = ” ~x or ~y or ~z is true”

Once we’re given a CNF instance, we replace each clause in the formula with one of the Ri formulas.  Then build a C set that uses the variables in the clause.  So, for example, if a clause in the CNF formula was ~x2 ∨ x5 ∨ ~x7, we’d make the element in R corresponding to the clause R2, and we’d use the C formula (x2, x7, x5).  Notice that we changed the order of the variables in the C set because R2 expects its negated literals first.

Notice that we can find a way to assign the variables truth values to make each Ci map to its R set, we have satisfied the clause.  So this new construction is satisfiable if and only if the 3SATinstance was satisfiable.

Difficulty: Making the construction is probably a 5, mostly because you need a good way to explain how you’re making the R sets.  The hardest thing here though is understanding what the problem says.

Protected: Quantified Boolean Formulas

This content is password protected. To view it please enter your password below:

Protected: Planar 3-Satisfiability

This content is password protected. To view it please enter your password below:

Monotone EQSat

Today I’m posting 2 problems relating to my student Dan Thornton’s independent study work.  I’m out of town this week and next, so I have these posts set to automatically go up on Tuesday afternoon.

Dan’s independent study was based on the “Automaton Identification” problem, but to show that reduction, he needs to use a variant of 3SAT, which he shows here:

The problem: Monotone EQ SAT. This is a specific instance of Monotone SAT.

The description:
We are given a conjunction of clauses F = \wedge_{i=1}^{l} C_{i} where each clause in F contains all negated or non-negated variables z_{j} and the number of clauses and variables are equal, is there an assignment of the variables so that F is satisfied? Our instance will have l clauses and variables.

Example:
Here is an F that has 4 variables and 4 clauses.

F =( \neg x_{1} \vee \neg x_{2} \vee \neg x_{3} \vee \neg x_{4} ) \wedge ( x_{1} \vee x_{2} \vee x_{4} ) \wedge ( \neg x_{2} \vee \neg x_{3} \vee \neg x_{4} ) \wedge ( x_{1} )

The above F may be satisfied by the following assignment:
x_{1} \rightarrow True
x_{2} \rightarrow False
x_{3} \rightarrow False
x_{4} \rightarrow True

The reduction:
We will reduce from Monotone SAT. So we are given an instance of Monotone  SAT with the clauses F = \wedge_{i=1}^{n} C_{i} here each clause is of the form C_{i} = (x_{i1} \vee ... \vee x_{ik_i} ) where each clause has all negated or non-negated variables. This is different from Monotone EQ SAT as we do not require the number of variables and clauses to be equal.
From this F we must build an instance of Monotone EQ SAT.
We may transform our instance of Monotone SAT, F, into one of Monotone EQ SAT by the following iterative procedure. New variables will be denoted by z'_{j} and new clauses by C'_{i}.

 F' = F;
 i = 1;
 j = 1;
 While{number of clauses != number of variables}{
   introduce two new variables z'_{j} \ , \ z'_{j+1};
   If{number of variables < number of clauses}{
     Create the new clause C'_{i} = (z'_{j} \vee z'_{j+1});
     F' = F' \wedge C'_{i};
     i = i+1;
   }
   else {
     Create three new clauses:
      C'_{i} = z'_{j} \ ,
      C'_{i+1} = z'_{j+1} \ ,
      C'_{i + 2} = (z'_{j} \vee z'_{j+1} );
     F' = F' \wedge C'_{i} \wedge C'_{i+1} \wedge C'_{i+2};
     i = i + 3;
   }
 j = j+2;
 }

The above algorithm will produce an equation F' that is in Monotone EQ  SAT. This may be shown by induction. Notice that before the procedure if number \ of \ variables > number \ of \ clauses that we will add 2 new variables and 3 new clauses.

If number \ of \ variables < number \ of \ clauses then we will add 2 new variables but only a single new clause. Either way the difference between the number of variables and clauses, dif =| number \ of \ clauses \ - \ number \ of \ variables | will decrease by 1. So in O(dif) steps we will obtain an formula where dif = 0. Such an formula is an instance of Monotone EQ SAT.

True{Monotone SAT \Rightarrow True{Monotone EQ SAT}
Here we assume that there is a truth assignment function \theta: z_{j} \rightarrow \lbrace True,False \rbrace that maps every variable to a truth value, such that F is satisfied. Then after we preform the above algorithm we have an instance of F', now our instance of F' will be of the form F \wedge ( \wedge_{i=1}^{k} C'_{i}) for some k \geq 1. Now notice that \theta above will satisfy F in F' and we may trivially satisfy \wedge_{i=1}^{k} C'_{i} by simply assigning all new variables z'_{j} to true.
This will give us a new truth assignment function \theta' that will satisfy F'

True{Monotone EQ SAT} \Rightarrow True{Monotone SAT}
Here we assume that there is a truth assignment function theta' that will satisfy F' then obviously as F' = F \wedge ( \wedge_{i=1}^{k} C'_{i}) then theta' must also satisfy F.

(Back to me)

Difficulty: 3.  The logical manipulations aren’t hard, but it is possible to mess them up.  For example, it’s important that the algorithm above reduces the difference in variables and clauses by 1 each iteration.  If it can reduce by more, you run the risk of skipping over the EQ state.

Protected: DNF Non-Tautology

This content is password protected. To view it please enter your password below:

Monotone 3-Satisfiability

I told Daniel when he gave me his Monotone Satisfiability reduction that the actual problem mentioned in G&J was Monotone 3-Satisfiability.  So he went off and did that reduction too.
The Problem:
Monotone 3 SAT. This is a more restrictive case of Monotone SAT

The Description:
Given an formula of clauses F' = \wedge_{i=1}^{n} C'_{i} where each clause in F' contains all negated or non-negated variables, and each clause C_{i} contains at most 3 variables. Does there exist an assignment of the variables so that F' is satisfied?

Example:

\\ F_{1} = (x_{1} \vee x_{3}) \wedge \\ (\neg x_{2} \vee \neg x_{3} \vee \neg x_{4}) \wedge  \\ (x_{3} \vee x_{2} \vee x_{4}) \wedge \\ ( \neg x_{3} \vee \neg x_{5} \vee \neg x_{1})
the following assignment satisfies F'_{1}:
\\  x_{1} \mapsto True\\ x_{2} \mapsto False\\ x_{3} \mapsto True\\ x_{4} \mapsto True\\ x_{5} \mapsto False
However:
\\ F_{2} = (\neg x_{1} \vee \neg x_{2} \vee \neg x_{3}) \wedge \\ (x_{1} \vee \neg x_{2} \vee \neg x_{3}) \wedge\\ (\neg x_{1} \vee x_{2} \vee \neg x_{3})\wedge \\ (\neg x_{1} \vee \neg x_{2} \vee x_{3})\wedge\\ (x_{1} \vee x_{2} \vee \neg x_{3})\wedge\\ (\neg x_{1} \vee x_{2} \vee x_{3})\wedge\\ (x_{1} \vee \neg x_{2} \vee x_{3})\wedge\\ (x_{1} \vee x_{2} \vee x_{3})
And the following is F_{2}' in Monotone  3SAT form:
\\ F_{2}' = (\neg x_{1} \vee \neg x_{2} \vee \neg x_{3}) \wedge \\ (\neg y_{1} \vee \neg x_{2} \vee \neg x_{3}) \wedge\\ (\neg x_{1} \vee \neg y_{2} \vee \neg x_{3})\wedge \\ (\neg x_{1} \vee \neg x_{2} \vee \neg y_{3})\wedge \\ (x_{1} \vee x_{2} \vee y_{3})\wedge\\ (y_{1} \vee x_{2} \vee x_{3})\wedge\\ (x_{1} \vee y_{2} \vee x_{3})\wedge\\ (x_{1} \vee x_{2} \vee x_{3}) \wedge \\ (y_{1} \vee x_{1}) \wedge (\neg y_{1} \vee \neg x_{1}) \wedge \\ (y_{1} \vee x_{2}) \wedge (\neg y_{2} \vee \neg x_{2})\wedge \\ (y_{1} \vee x_{3}) \wedge (\neg y_{3} \vee \neg x_{3})
are both unsatisfiable.

The reduction:
In the following reduction we are given an instance of 3SAT,
F = \wedge_{i=1}^{n} C_{i}. Here each clause is of the form:
C_{i} = x_{i1} \vee ... \vee x_{ik_i} where
k_{i} < 4
and each x_{ik_i} is a literal of the form \neg z_{l} \ or \ z_{l} .
We use the following construction to build an instance of Monotone  3 SAT out of the above instance of 3SAT :
In each clause C_{i} we have at most one literal, z_{l} \ or \ \neg z_{l} that is not of the same parity as the rest of the literals in the clause. For every such literal, we may preform the following substitution:
z_{l} \rightarrow \neg y_{l} \ or \ \neg z_{l} \rightarrow y_{l} this yields a modified clause C'_{i}.
Now we must be able to guarantee that z_{l} and y_{l} are mapped to opposite truth values, so we introduce the new clause:
C''_{i} \ = \ ( z_{l} \vee y_{l}) \wedge ( \neg z_{l} \vee \neg y_{l}) and conjunct it onto our old formula F producing a new formula F'.

For example:
C_{i} \ = \ (z_{l_1} \vee z_{l_2} \vee \neg z_{l_3}) so we preform the substitution
\neg z_{l_3} \rightarrow y_{l_3}
so C'_{i} \ = \ (z_{l_1} \vee z_{l_2} \vee y_{l_3}) and C''_{i} \ = \ (z_{l_3} \vee y_{l_3}) \wedge ( \neg z_{l_3} \vee \neg y_{l_3})

Now repeating this procedure will result in a new formula: F' = (\wedge_{i=1}^{n} C'_{i}) \wedge (\wedge_{k=1}^{m} C''_{k}).
We claim logical equivalence between the C_{i} \wedge C''_{i} and C'_{i} \wedge C''_{i} This is semantically intuitive as the C''_{i} clause requires all substituted literal y_{l} in C'_{i} to take the value opposite of z_{l} this was the stipulation for the substitution initially. It is also verifiable by truth table construction for:
\\ (z_{l_1} \vee z_{l_2} \vee \neg z_{l_3}) \wedge (z_{l_3} \vee y_{l_3}) \wedge ( \neg z_{l_3} \vee \neg y_{l_3}) \Leftrightarrow \\  (z_{l_1} \vee z_{l_2} \vee y_{l_3}) \wedge (z_{l_3} \vee y_{l_3}) \wedge ( \neg z_{l_3} \vee \neg y_{l_3})

True_{3SAT} \Rightarrow True_{Monotone \ 3 \ SAT}:
If there exists a truth assignment \phi_{F} that satisfies F, then we may extent this truth assignment to produce \phi_{G} which will satisfy
G = F \wedge (\wedge_{k=1}^{m} C''_{k}) by letting \phi_{G} (z_{l}) = \phi_{F} (x_{l}) for all l and letting \phi_{G}(y_{l}) = \neg \phi_{F}(z_{l}) for all l.
Obviously if F is satisfiable G must be by the above construction of \phi_{G}. So by the above claim we have that \phi_{G} will satisfy F'.
True_{Monotone \ 3 \ SAT} \Rightarrow True_{3SAT}:
Continuing from the above, if we have a truth assignment \phi_{F'} that satisfies F', then by the claim above it also must satisfy G. And F is a sub-formula of G so any truth assignment that satisfies G must also satisfy F.

(Back to me)

Difficulty: 4, since it’s a little harder than the regular Monotone Sat one.

Monotone Satisfiability

This semester I’m doing an independent study with a student, Daniel Thornton, looking at NP-Complete problems.  He came up with a reduction for Monotone Satisfiability, and since I hadn’t gotten to that problem yet, I told him if he wrote it up, I’d post it.

So, here it is.  Take it away, Daniel!

The Problem: Monotone SAT. This is mentioned in problem LO2 in the book.

The description:
Given an set of clauses F' = \wedge_{i=1}^{n} C_{i} where each clause in F contains all negated or non-negated variables, is there an assignment of the variables so that F' is satisfied?

Example:
F' = (x_{1} \vee x_{3} \vee x_{4}) \wedge (\neg x_{2} \vee \neg x_{3} \vee \neg x_{4}) \wedge (x_{3} \vee x_{2} \vee x_{4})
the following assignment satisfies F':
x_{1} \mapsto False
x_{2} \mapsto False
x_{3} \mapsto False
x_{4} \mapsto True

The reduction:
In the following reduction we are given an instance of SAT, with the clauses:
F = \wedge_{i=1}^{n} C_{i}. Here each clause is of the form C_{i} = x_{i1} \vee x_{i2} \vee ... \vee x_{ik_i}and each x_{ij} is a literal of the form \neg z_{ij} \ or \ z_{ij}
Now we build an instance of Monotone SAT from the instance of SAT given above:
For each C_{i} we construct two new clauses \\ C'_{2i} = z_{i l_1} \vee ... \vee z_{il_k } \vee z'_{i} and  \ C'_{2i-1}= \neg z_{il_k+1} \vee ... \vee \neg z_{il_m} \vee \neg z'_{i}, such that all elements of C'_{2i} are non-negated literals and all terms in C'_{2i-1} are negated literals with the addition of the new special term z'_{i}. Now let us build a new formula F' = \wedge_{i'=1}^{2n} C'_{i'} this is our instance of Monotone SAT, clauses are either all non-negated or negated.

True_{Monotone SAT} \Rightarrow True_{SAT}:
Notice how we added the extra literal z'_{i} or \neg z'_{i} to each of the clauses C'_{2i} or C'_{2i-1} respectfully. Now if there is an assignment that satisfies all of the clauses of F' then as only C_{2i} or C_{2i-1} may be satisfied by the appended extra literal, one of the clauses must be satisfied by it’s other literals. These literals are also in C_{i} so such an assignment satisfies all C_{i} \in F.

True_{SAT} \Rightarrow True_{Monotone SAT}:
Using an argument similar to the one above, For F to be satisfied there must be at least one literal assignment say z_{iy} that satisfies each clause C_{i} Now z_{iy} is in either C'_{2i} or C'_{2i-1}. This implies that at least one of C'_{2i} or C'_{2i -1} is also satisfied by z_{iy}, so simply assign the new term z'_{i} accordingly to satisfy the clause in F' not satisfied by z_{iy}

(back to me again)

Difficulty: 3.  I like that the reduction involves manipulating the formula, instead of applying logical identities.