You are on page 1of 37

2

Assignment 5. Due Date: 03/03/14 1. Consider axioms from Assignment 4. Prove that John likes peanuts using resolution. 2. Consider the following facts: The members of the Elm St. Bridge Club are Joe, Sally, Bill, and Ellen. Joe is married to Sally. Bill is Ellens brother. The spouse of every married person in the club is also in the club. The last meeting of the club was at Joes house. (a) Represent these facts in the predicate logic. (b) From the facts given above, most people would be able to decide on the truth of the following additional statements: The last meeting of the club was at Sallys house. Ellen is not married. Can you construct resolution proofs to demonstrate the truth of each of these statements given the five listed above? Do so if possible. Otherwise, add the facts you need and then construct the proofs. Assume the following facts: Steve only likes easy courses. Science courses are hard. All the courses in the basketweaving department are easy. BK 301 is a basketweaving course. Use resolution to answer the question, What course would Steve like? (read pp. 160-164 of the handout)

3.

Conversion to Clause Form: All Romans who know Marcus either hate Caesar or think that anyone who hates anyone is crazy. Problem: x: [Roman(x) know(x, Marcus)] [hate(x, Caesar) (y: z: hate(y, z) thinkcrazy(x, y))] Solution: Flatten Separate out quantifiers Conjunctive Normal Form: Roman(x) know(x, Marcus) hate(x, Caesar) hate(y, z) thinkcrazy(x,z) Clause Form: Conjunctive normal form No instances of

Algorithm: Convert to Clause Form


1. 2. 3. 4. 5. 6. 7. 8. Eliminate , using: a b = a b. Reduce the scope of each to a single term, using: (p) = p de Morgans laws: (a b) = a b (a b) = a b x: P(x) = x: P(x) x: P(x) = x: P(x) Standardize variables: x: P(x) x: Q(x) should be replaced with x: P(x) y: Q(y) (y is a unique variable) Move all quantifiers to the left of the formula without changing their relative order. Eliminate existential quantifiers by inserting Skolem functions. Drop the prefix. Convert the matrix into a conjunction of disjuncts, using associativity and distributivity. Create a separate clause for each conjunct. Standardize apart the variables in the set of clauses generated in step 8, using the fact that (x: P(x) Q(x)) = x: P(x) x: Q(x), thus we have two clauses P(x) Q(y)

Examples of Conversion to Clause Form


Example: x: [Roman(x) know(x, Marcus)] [hate(x, Caesar) (y: z: hate(y, z) thinkcrazy(x, y))] 1. Eliminate x: [Roman(x) know(x, Marcus)] [hate(x, Caesar) (y: (z: hate(y,z)) thinkcrazy(x, y))] Reduce scope of x: [Roman(x) know(x, Marcus)] [hate(x, Caesar) (y: z: hate(y,z) thinkcrazy(x, y))] Standardize variables. x: P(x) x: Q(x) will be converted to x: P(x) y: Q(y) Move quantifiers prefix matrix x: y: z: [Roman know(x, Marcus)] [hate(x, Caesar) (hate(y, z) thinkcrazy(x, y))]

2.

3.

4.

Examples of Conversion to Clause Form


5. Eliminate existential quantifiers. y: President(y) will be converted to President(S1) while x: y: father-of(y, x) will be converted to x: father-of(S2(x), x)) Drop the prefix [Roman(x) know(x, Marcus)] [hate(x, Caesar) (hate(y, z) thinkcrazy(x, y))] Convert to a conjunction of disjuncts. Roman(x) know(x, Marcus) hate(x, Caesar) hate(y, z) thinkcrazy(x, y)

6.

7.

Examples of Conversion to Clause Form


Distribution Law (a b) c = (a c) (b c) The formula (winter wearingboots) (summer wearingsandals) becomes [winter (summer wearingsandals)] [wearingboots (summer wearingsandals)] and then becomes (winter summer) (winter wearingsandals) (wearingboots summer) (wearingboots wearingsandals) and finally (winter summer) (winter wearingsandals) (wearingboots summer) (wearingboots wearingsandals)

A Set of Facts about Marcus


1. 2. 3. 4. 5. 6. 7. man(Marcus) Pompeian(Marcus) born(Marcus, 40) x: man(x) mortal(x) x: Pompeian(x) died(x, 79) erupted(volcano, 79) x: t1: t2: mortal(x) born(x, t1) gt(t2 - t1, 150) dead(x, t2) 8. now = 2012 9. x: t: [alive(x, t) dead(x, t)] [dead(x, t) alive(x, t)] 10. x: t1: t2: died(x, t1) gt(t2, t1) dead(x, t2)

Axioms in clause form:


1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. man(Marcus) Pompeian(Marcus) born(Marcus, 40) man(x1) mortal(x1) Pompeian(x2) died(x2, 79) erupted(volcano, 79) mortal(x3) born(x3, t1) gt(t2 - t1, 150) dead(x3, t2) now = 2012 alive(x4, t3) dead(x4, t3) dead(x 5, t4) alive(x5, t4) died(x6, t5) gt(t6, t5) dead(x6, t6)

10

The Basis of Resolution


Given: winter summer winter cold We can conclude: summer cold Two clauses winter and winter produce the empty clause.

11

Algorithm: Propositional Resolution


Convert all the propositions of F to clause form. Negate P and convert the result to clause form. Add it to the set of clauses obtained in step 1. 3. Repeat until either a contradiction is found or no progress can be made: (a) Select two clauses. Call these the parent clauses. (b) Resolve them together. The resolvent will be the disjunction of all the literals of both of the parent clauses with the following exception: If there are any pairs of literals L and L such that one of the parent clauses contains L and the other contains L. then select one such pair and eliminate both L and L from the resolvent. (c) If the resolvent is the empty clause, then a contradiction has been found. If it is not, then add it to the set of clauses available to the procedure. 1. 2.

12

Propositional Resolution
We want to prove R. Given Axioms Clause Form P P (P Q) R P Q R (2) (S T) Q S Q (3) T Q (4) T T

(1)

(5)

P Q R P Q T Q T Q

R P

13

Herbrands Theorem

To show that a set of clauses S is unsatisfiable, it is necessary to consider only interpretations over a particular set, called the Herbrand universe of S. A set of clauses S is unsatisfiable if and only if a finite subset of ground instances (in which all bound variables have had a value substituted for them) of S is unsatisfiable.

You might also like