Docsity

CPSC 625 Homework 3: First-Order Logic Exercises, Assignments of Computer Science

Toggle sidebar
bg1
CPSC 625 – Homework 3
due: Mon, April 9, 2007
1. Do problem 8.6 in the textbook (translating sentences into first-order logic).
2. Determine whether or not the following pairs of predicates are are unifiable. If they are, give
the most-general unifier and show the result of applying the substitution to each predicate. If they
are not unifiable, indicate why. Variables are in capital letters; constants are lowercase.
a) P(a, X, f (g(Y))) and P(Z, f (Z), f (U))
b) Q(f(a), g(X)) and Q(Y , Y )
c) R(f(Y), Y, X ) and R(X, f (a), f (V))
d) P(a, Y, f (X)) and P(X, f (b), f (b))
e) Q(g(f(a)), g(X), Z) and Q(Y, Y , f(X))
f) P(a, X , g(f(f(a))), X) and P(Z, f (Z), g(Y), f (Z))
g) Q(f(a, a), Y, Z ) and Q(X, f (Z, Z ), Y )
3. Using first-order rules of inference, prove that “there exists a vegetarian” from the following pieces
of knowledge: anyone who does not eat meat is a vegetarian, tomatoes are not meat, carrots are not
meat, and there is someone who eats only tomatoes and carrots. The initial sentences (premises)
are translated into first-order logic for you below. The goal is to generate: ∃X vegetarian(X).
Be sure to explicitly label each new sentence with the one(s) it was derived from, along with the
inference rule and any substitution used. (Hint: try existential elimination, implication elimination,
and resolution.)
1. ∀P(∀X eat(P, X)→ ¬meat(X)) →vegetarian(P)
2. ∀X tomato(X)→ ¬meat(X)
3. ∀X carrot(X)→ ¬meat(X)
4. ∃P∀X eat(P, X)→(tomato(X)∨car rot(X))
1

Partial preview of the text

Download CPSC 625 Homework 3: First-Order Logic Exercises and more Assignments Computer Science in PDF only on Docsity!

CPSC 625 – Homework 3

due: Mon, April 9, 2007

  1. Do problem 8.6 in the textbook (translating sentences into first-order logic).
  2. Determine whether or not the following pairs of predicates are are unifiable. If they are, give the most-general unifier and show the result of applying the substitution to each predicate. If they are not unifiable, indicate why. Variables are in capital letters; constants are lowercase.

a) P (a, X, f (g(Y ))) and P (Z, f (Z), f (U )) b) Q(f (a), g(X)) and Q(Y, Y ) c) R(f (Y ), Y, X) and R(X, f (a), f (V )) d) P (a, Y, f (X)) and P (X, f (b), f (b)) e) Q(g(f (a)), g(X), Z) and Q(Y, Y, f (X)) f) P (a, X, g(f (f (a))), X) and P (Z, f (Z), g(Y ), f (Z)) g) Q(f (a, a), Y, Z) and Q(X, f (Z, Z), Y )

  1. Using first-order rules of inference, prove that “there exists a vegetarian” from the following pieces of knowledge: anyone who does not eat meat is a vegetarian, tomatoes are not meat, carrots are not meat, and there is someone who eats only tomatoes and carrots. The initial sentences (premises) are translated into first-order logic for you below. The goal is to generate: ∃X vegetarian(X). Be sure to explicitly label each new sentence with the one(s) it was derived from, along with the inference rule and any substitution used. (Hint: try existential elimination, implication elimination, and resolution.)
    1. ∀P (∀X eat(P, X) → ¬meat(X)) → vegetarian(P )
    2. ∀X tomato(X) → ¬meat(X)
    3. ∀X carrot(X) → ¬meat(X)
    4. ∃P ∀X eat(P, X) → (tomato(X) ∨ carrot(X))