# CS 343 Artificial Intelligence Homework 2: Logic and Deduction

Due: Oct. 6, 2010
1. Represent the following in first-order logic Make sure to use a reasonable set of primitive predicates that capture the basic concepts, not ones like FAILED-BOTH, BEST-SCORE, or VEGETARIAN.
1. Only one student failed both History and Biology.
2. The highest score in History was higher than the highest score in Biology.
3. There is a woman who likes all men who don't eat meat.
4. Every department at UT has a faculty member who owns both a Prius and a Kindle.

2. Consider the following definite Horn-clause KB:
Notation: A: for all, E: exists, &: and, =>: implication, <=>: biconditional, ~: not

AxAy Smoker(x) & Friends(y,x) => Smoker(y)
AxAy Friends(x,y) => Friends(y,x)
Friends(Carl,David)
Friends(Eddie,David)
Smoker(Eddie)

Assume we perform forward-chaining starting from this KB (with all of the rules and facts already loaded) and show the specific conclusions added in their exact order as rules are matched and fired. Assume rules and facts are always matched in the exact order given above and that newly inferred facts are immediately added to the end of the list.

3. Consider the following definite Horn-clause KB:

AxAyAz Parent(x,y) & Parent(x,z) & y!=z => Sibling(y,z)
AxAyAz Sibling(v,w) & Parent(w,u) & Male(u) => Nephew(u,v)
Parent(Bob,Mary), Male(Bob), Female(Mary), Parent(Bob,Fred), Male(Fred), Parent(Mary,Tom), Male(Tom), Parent(Mary,Ann), Female(Ann)

Assume backward-chaining rule-based inference is used to try to answer the query: Nephew(s,Fred). Show the trace of the search conducted and the subgoals generated like that shown on page 16 of the lecture notes on "Inference in First Order Logic," giving all answers retrieved. Assume that the infix predicate "!=" (not equal) is evaluated procedurally (i.e. handled externally by a program that directly computes the correct truth value).

4. Given the following representation of "There is a barber in town who shaves all and only men in town who do not shave themselves" (assuming all barbers are men)

Ex (Barber(x) & In(x,Town) & Ay [(Man(y) & In(y,Town) & ~Shave(y,y)) <=> Shave(x,y)])
Ax (Barber(z) => Man(z))

Show this statement is contradictory using resolution. See the previous year's Homework 2 solution for the format to present the proof.