CIS603 S03: Homework 3

1. Resolution Theorem Proving

(25 points)

Consider the following information:

  1. Animals can outrun any animals that they can eat.
  2. Carnivores eat other animals.
  3. Outrunning is transitive: if x can outrun y and y can outrun z, then x can outrun z.
  4. Lions eat zebras.
  5. Zebras can outrun dogs.
  6. Dogs are carnivores.
Use resolution theorem proving to find three animals that lions can outrun.

Solution: The following are the corresponding FOL expressions:

  1. forall x, y:[ eats(x, y) --> outruns(x, y)]
  2. forall x:[carnivorous(x) --> thereis y:[eats(x,y)]
  3. forall x,y,z; [(outruns(x, y) and outruns(y, z) --> outruns(x, z)]
  4. eats(Lions, Zebras)
  5. outruns(Zebras, dogs)
  6. carnivorous(Dogs)
The following are the corresponding CNF expressions:
  1. not eats(x1, y1) or outruns(x1, y1)
  2. not carnivorous(x2) or eats(x2, food(x2)
  3. not outruns(x3, y2) or not outruns(y2, z1) or outruns(x3, z1)
  4. eats(Lions, Zebras)
  5. outruns(Zebras, dogs)
  6. carnivorous(Dogs)
Now the three animals that lions can outrun are Zebras, Dogs, and food(Dogs).

This can be shown using resolution as follows:

2. First Order Logic

(25 points)

This problem can be solved in different ways, depending on the predicates you choose. Here is a sample solution.

  1. Not all students take both History and Biology

    not forall x:[student(x) --> (takes(x, History) and takes(x, Biology))

  2. Only one student failed history.

    thereis x forall y: [(student(x) and fails(x, History) and student(y) and fails(y, History)) --> x = y]

  3. Only one student failed both History and Biology.

    thereis x forall y: [(student(x) and fails(x, History) and and fails(x, Biology) student(y) and fails(y, History) and fails(y, Biology)) --> x = y]

  4. The best score in History was better than the best score in Biology.

    thereis x forall y: [score(x, History) > score(y, Biology)]

  5. Every person who dislikes all vegetarians is smart.

    forall x forall y: [person(x) and (vegetarian(y) --> dislikes(x,y)) --> smart(y)]

  6. No person likes a smart vegetarian.

    forall x forall y: [(person(x) and smart(y) and vegetarian(y)) --> not likes(x,y)

  7. There is a woman who likes all men who are not vegetarian.

    thereis x foall y: [(woman(x) and man(y) and not vegetarian(y)) --> likes(x,y)]

  8. There is a barber who shaves all men in town who are not vegetarian.

    thereis x forall y: [(barber(x) and man(y) and not shaves(y)) --> shaves(x,y)]

  9. No person likes a professor unless the professor is smart.

    forall x forall y: [(person(x) and professor(y) and not smart(y)) --> not likes(x,y)]

  10. Politicians can fool some of the people all of the time and they can fool all the people some of the time, but they can't fool all the people all of the time.

    forall x: [ politician(x) --> (thereis y forall t: [person(y) and fools(x,y,t)) and (thereis t forall y: [person(y) --> fools(x,y,t)]) and not ( forall t forall y: [person(y) --> fools(x,y,t)])]

3. Problem 9.4 from the textbook, p. 316.

(25 points)

The most general unifier (mgu) for the pairs of sentences are:

Unification

(25 points)

What is the most general unifier for the expressions, where letters early in the alphabet are object constants, and letters late in the alphabet are variables.


p= f(x1, g(x2, x3), x2, b) and q = f(g(h(a, x5), x2), x1, h(a, x4), x4)

p = j(f(x, g(x,y)), h(z,y)) and q = j(z, h(f(u,v), f(a,b)))

We must unify each argument of the function f at the top level. Unifying the first arguments gives x1 = g(h(a, x5), x2).

Unifying the second arguments gives x1 = g(x2, x3), so we have x2 = h(a, x5) = x3.

The third argument gives x2 = h(a, x4). Combining this with the previous result for x2 gives x4 = x5. The fourth argument gives x4 = b. By composing these substitutions we obtain the final set of bindings:

x1 = g(h(a,b),h(a,b))
x2 = h(a,b)
x3 = h(a,b)
x4 = b
x5 = b

p = j(f(x, g(x,y)), h(z,y)) and q = j(z, h(f(u,v), f(a,b)))

In this problem we need to unify arguments of arguments. Unifying the first arguments of each j gives z = f(x,g(x,y)). Unifying the first argument of the h expressions, which are second arguments to j, gives z = f(u,v). Therefore we have z = f(u,v)= f(x, g(x,y)), so we conclude that u = x and v = g(x,y).

Unifying the second arguments of h (which are the second arguments of j, we get y = f(a,b). Now we compose all these substitutions to get

u = x
v = g(x, f(a, b))
z = f(x, g(x,f(a,b)))
y = f(a,b)


vasilis@cis.temple.edu