# CS 1571: Homework 3 (written)

## Logic (100 pts)

Assigned: October 25, 2017

Due: November 3, 2017

#### 1. Entailment (25 pts)

Let KB be a knowledge base consisting of the following sentence:
- (A OR C) AND (B OR (NOT C))

  Prove that (A OR B) holds using the truth-table approach.

  Grading Criteria: To get full credit, you first need to show the truth table, making sure you have columns for all intermediate steps. You then need to explain how you interpret the truth table to prove (A OR B), either by highlighting rows, or by using one or two sentences to explain the process.

  #### 2. Resolution - Propositional (25 pts)

  Knowledge Base:
  (P AND Q) OR (Q AND R)

  Rules:
  R => S
  S=>P
  (P AND Q) => G

  Goal: G

  (a) Put the above into Conjunctive Normal Form.

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

  Grading Criteria: For part(b), you can either use a graph or show the resolution process step by step. Even if the first step is wrong, you can get credit, if we think you did the correct resolution.

  #### 3. FOL Translation for Forward and Backward Chaining (10 pts)

  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.

  Write a knowledge base that formally represents the above using FOL, in a way that would allow you to use forward or backward chaining as your inference mechanism.

  Grading Criteria: Clearly explain the predicates, functions and objects in your FOL representations, if they are not obvious. Also be sure to specify any relevant domains. You are required to introduce predicates in your answer, that is, an answer expressed in propositional logic is not acceptable.

  #### 4. Unification (10 pts)

  R&N problem 9.4 (page 361)

  #### 5. Resolution - FOL (30 pts)

  Consider the following story:

  1. Anyone passing his history exams and winning the lottery is happy
  Forall x pass(x,History) AND win(x,Lottery) => happy(x)

  2. But anyone who studies or is lucky can pass all his exams
  Forall x Forall y study(x) OR lucky(x) => pass(x,y)

  3. John did not study but he is lucky
  ~study(John) AND lucky(John)

  4. Anyone who is lucky wins the lottery
  Forall x lucky(x) => win(x,Lottery)

  5. There exists a person who is wealthy
  Exists x wealthy(x)

  Goal:
  happy(John)

  (a) Put the above FOL sentences into Conjunctive Normal Form.

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

  Grading Criteria: For part (b), you can either use a graph or show the resolution process step by step. Show your unifications. Even if part (a) is wrong, you can get credit, if we think you did the correct resolution.