You are on page 1of 5

# Anupam Garg (garga) CMPS203; 04/2006 Assignment 3.

Prolog

Exercises 12.1 - 12.12, 12.17, 12.18. -------------------12.1: A standard method for analyzing logical statements is the truth table: Assigning truth values to elementary statements allows us to determine the truth value of a compound statement, and statements with the same truth tables are logically equivalent. Thus the statement "p and not p" is equivalent to "false" by the following truth table: p false true not p true false p and not p false false false false false

Use truth tables to show that p->q is equivalent to (not p) or q (remember that p->q is false only if p is true and q is false). p true true false false not p false false true true q true false true false not q false true false true p->q true false true true (not p) or q true false true true

-------------------12.2: A tautology is a statement that is always true, no matter what the truth values of its components. Use a truth table to show that false->p is a tautology for any statement p. false false false p true false false->p true true

-------------------12.3: A refutation system is a logical system that proves a statement by assuming it is false and then deriving a contradiction. Show that Horn clause logic with resolution is a refutation system. (Hint: The empty clause is assumed to be false, so a goal <-a is equivalent to a->false. Show that this is equivalent to not(a).) a true false false false false a->false false true not a false true

-------------------12.4: Write the following statements in the first-order predicate calculus: If it is raining or snowing, then there is precipitation. If it is feezing and there is precipitation, then it is snowing. If it is not freezing and there is precipitation, then it is raining. It is snowing.