Supplementary exercises in propositional logic The purpose of these exercises is to train your ability to manipulate and analyze logical formulas. Familiarize yourself with chapter 7.3-7.5 in the course book before starting. This kind of questions might appear in the final exam. 1. Construct truth tables for the following formulas. Use the truth tables to see if each formula is valid or at least satisfiable. (a) P (P Q) (b) ((P Q) Q) P 2. Prove the following equivalences using truth tables. (a) (P Q) P Q (b) P (Q R) (P Q) (P R) 3. Prove the following equivalences by rewriting the formulas according to the standard logical equivalences on page 210 in the course book. (a) P Q (P Q) (b) (P Q) R P (Q R) 4. Check if the following entailments hold by constructing truth tables for each formula. (a) P Q P Q (b) P (P Q) P Q (c) P P Q 5. Convert the following formulas to CNF (conjunctive normal form) using the method on page 215 in the course book. (a) ((P Q) Q) P (b) ( Q P) (P Q) (c) (P Q) ( P Q) 6. Prove the following using resolution. (Negate the conclusion, convert all formulas to CNF and then try to prove a contradiction.) (a) P Q P Q (b) {P Q, Q (R S), (P R) U} U
Solutions If you think you have found an error, please contact me via e-mail on petda@ida.liu.se 1. Using the defintion of each connective we can construct truth tables for whole formulas (see page 207). It is often easier to take it step by step and start by constructing a truth table for a subformula. When we are finished, each row in the truth table corresponds to an interpretation. If the formula is true in an interpretation, we say that it is a model. If the formula is true in some row, it is satisfiable. If it is true in all rows, it is valid. Then we call the formula a tautology. P Q P Q P (P Q) T T T T T F T T F T T T F F F T P Q P Q (P Q) Q ((P Q) Q) P T T T F T T F F F T F T T F T F F T T T 2. Two formulas are equivalent if they have the same truth value in all interpretations (all rows in the truth table). P Q (P Q) P Q T T F F T F T T F T F F P Q R (Q R) P (Q R) (P Q) (P R) (P Q) (P R) T T T T T T T T T T F F T T T T T F T F T T T T T F F F T T T T F T T T T T T T F T F F F T F F F F T F F F T F
3. There are of course many ways to rewrite a formula, but here are some suggestions. P Q P Q P Q (P Q) (P Q) R (P Q) R ( P Q) R P ( Q R) P (Q R) implication elimination double negation introduction De Morgan implication elimination De Morgan associativity implication introduction 4. The definition of entailment is that A B means that whenever A is true, B should also be true. The truth value of B in all other interpretations is not interesting. We only have to check the rows in the truth table where A is true. (a) Entailment holds. (b) Entailment does not hold. (c) Entailment holds (left hand side has no models at all). P Q P Q P Q T T T T Yes T F F T F T F T P Q P Q P (P Q) P Q T T T T T Yes T F F F T F T F T F No! F F F T T Yes P Q P P Q T T F T T F F F F T F T 5. Using the method from the book we rewrite the formulas in the following way: ((P Q) Q) P (( P Q) Q) P ( ( P Q) Q) P (( P Q) Q) P (P Q) (Q P) (P Q P) ( Q Q P) eliminate eliminate double negation and regroup distributivity law
( Q P) (P Q) ( Q P) ( P Q) ( Q P) ( P Q) ( Q P) ( P Q) ( Q P Q) (P P Q) eliminate eliminate double negations distributivity law (P Q) ( P Q) (P Q) (( P Q) (Q P)) eliminate (P Q) (( P Q) ( Q P)) eliminate ( P Q) ((P Q) ( Q P)) move in and eliminate double negations ( P Q P Q) ( P Q Q P) distributivity law P Q simplify (left clause is always true and there are two identical literals in the right one) 6. First we negate the conclusion (right hand side). Then we convert all formulas to CNF. Finally we do resolution and try to prove a contradiction (see page 215). Exericse (a) There is only one formula to the left, P Q, which is already in CNF, giving us the two clauses P and Q. We negate the right hand side, which gives us (P Q). This is equivalent to P Q, which gives us the two clauses P and Q. From this we can easily draw a resolution tree, e.g. combining P with P, which leads to a contradiction. Thus the original claim is proven. Exercise (b) We start by converting all formulas to CNF to find the clauses: P Q Q (R S) Q (R S) ( Q R) ( Q S) (P R) U (P R) U ( P R) U ( P U ) ( R U) which gives us the clause P Q which gives us the clauses Q R, Q S which gives us the clauses P U, R U To these clauses we add the negated conclusion which is simply U. Now we draw a resolution tree, trying to prove a contratiction (an empty clause).
P Q Q R Q S P U U R U P R Q R