Assignment 2
Assignment 2
1 DNF
Put (x → y) ∧ (z ↔ x) into disjunctive normal form.
2 CNF
Let f be the DNF formula (u ∧ v) ∨ (w ∧ x).
x y x⊗y
F F T
F T T
T F T
T T F
(a) Produce a formula equivalent to ¬x using only the connective ⊗ and variable x.
(b) Produce a formula equivalent to x ∧ y using only the connective ⊗ and the variables x
and y.
(c) Produce a formula equivalent to x ∨ y using only the connective ⊗ and variables x and
y.
(d) Briefly explain how this shows that {⊗} is a universal set of connectives.
4 Davis-Putnam
In this problem you will run the Davis-Putnam algorithm by hand showing the value of the input
variable S and the return value for each call to Satisfiable.
1
15-414 HW 2 2
What You Must Do. Run the function Satisfiable by hand when called with value of
[[¬x, y], [x, ¬y], [y, z], [x, ¬z]] for S. Since Satisfiable is a recursive function (see lines
13 and 14), it will call itself. To prove that you ran the function by hand, show the value of the
input S at the beginning of each of these recursive calls to Satisfiable. Also, note the return
value of each call.
Examples. For example, if the problem asked you to run Satisfiable with the initial value of
[[¬x, y], [y, ¬z], [¬y, x]] for S instead of [[¬x, y], [x, ¬y], [y, z], [x, ¬z]], a valid solution to this
problem would be (with optional comments explaining the solution in parentheses):
(Satisfiable is initially called with S = [[¬x, y], [y, ¬z], [¬y, x]]. It selects ¬x for L on line
12 for the first recursive call on line 13.)
On the first and only recursive call of Satisfiable, S = [[¬x, y], [y, ¬z], [¬y, x], [¬x]]. ([¬x]
is a unit clause so Satisfiable deletes every clause containing ¬x, and x is deleted from every
remaining clause. This yields [[y, ¬z], [¬y]]. Now [¬y] is a unit clause so every clause containing
¬y is deleted, and y is deleted from every remaining clause. This yields [[¬z]]. Since [¬z] is a
unit clause it is deleted leaving []. Since S is now empty,) true is returned by this recursive call.
Another example: if the problem instead asked you to run Satisfiable with the initial value of
[[¬x, y, z], [x, ¬y, ¬z], [y, z], [x, y, ¬z]] for S, a valid solution would be:
(Satisfiable is initially called with S = [[¬x, y, z], [x, ¬y, ¬z], [y, z], [x, y, ¬z]]. It selects
¬x as L for the first recursive call.)
On the first recursive call, S = [[¬x, y, z], [x, ¬y, ¬z], [y, z], [x, y, ¬z], [¬x]]. ([¬x] is a unit
clause so every clause containing ¬x is deleted, and x is deleted from every remaining clause.
This yields [[¬y, ¬z], [y, z], [y, ¬z]]. ¬y is selected as L for the second recursive call.) True is
returned by this recursive call. (The reason being that true is returned the third recursive call,
which is described below.)
On the second recursive call, S = [[¬y, ¬z], [y, z], [y, ¬z], [¬y]]. ([¬y] is a unit clause so this
yields [[z], [¬z]] after the removals. z is a unit clause yielding [[]]. Thus, S contains the null
clause.) False is returned by this recursive call. (y is now tried by the first recursive call since
[¬y] lead to false.)
On the third and final recursive call, S = [[¬y, ¬z], [y, z], [y, ¬z], [y]]. ([y] is a unit clause
yielding [[¬z]]. Since [[¬z]] is a unit clause, it is removed leaving [].) True is returned by this
call.