# CS2710 / ISSP 2160: Homework 4

## Logic (Chapters 7-9)

Assigned: October 6, 2010

Due: October 20, 2010 (NOTE: no late acceptances as answers will be posted)

#### 1. Propositional Logic (20 pts)

(a) R&N 7.1 (p. 279) To save space, you can show the list of models as a table rather than a collection of diagrams.

(b) Verify the first (commutativity of conjunction) and sixth (contraposition) equivalences in Figure 7.11 (p. 249), using truth tables and the other equivalence rules in that figure, respectively.

#### 2. Propositional Logic: Resolution (20 pts)

Knowledge Base:

• Either (I have a sweet tooth and I like chocolate) or (I like chocolate and I like cake)

Rules:

• If I like cake, then I also like Danish.
• If I like Danish, that implies I have a sweet tooth.
• If I have a sweet tooth and I like chocolate, then I am a chocoholic.

Goal: I am a chocoholic

(a) Convert these sentences to propositional logic.

(b) Put the resulting sentences into Conjunctive Normal Form.

(c) Using proof by refutation and resolution as the single inference rule, show the resolution proof that proves the goal.

#### 3. First-Order Logic (20 pts)

(a) R&N 8.24 f, h (p. 319)

(b) Write an axiom defining the binary predicate Grandchild

(c) R&N 9.4 (p. 361)

#### 4. FOL: Forward and Backward Chaining (20 pts)

Premise: GameX says it is criminal for a programmer to provide emulators to people. My friends don't have a GameX, but they use software EMULATOR1 that runs GameX games on their PC, which is written by SuperProgrammer, who is a programmer.

(a) Write a knowledge base that formally represents the premise using FOL, in a way that allows you to use forward and backward chaining as your inference mechanism. Number each statement in the KB.

(b) Use forward chaining to determine that SuperProgrammer is a Criminal. Write out all steps. If several rules apply, use the one with the smallest number (from part(a).)

(c) Use backward chaining to determine that SuperProgrammer is a criminal. Write out all steps. If several rules apply, again use the one with the smallest number.

#### 5. FOL: Resolution (20 pts)

Consider the following story: "Anyone passing his history exams and winning the lottery is happy. But anyone who studies or is lucky can pass all his exams. John did not study but he is lucky. Anyone who is lucky wins the lottery. There exists a person who is wealthy."

(a) Represent the story using FOL. To start you off, use the following predicates:

• binary predicates: pass, win
• unary predicates: happy, study, lucky, wealthy

For example, "John did not study but he is lucky" would be represented as ~study(john) AND lucky(john)

(b) Put the resulting FOL sentences into Conjunctive Normal Form.

(c) Using proof by refutation and resolution as the single inference rule, prove that "John is happy"