CPT 317 - AI Week 7 FOL (Question and Answer)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

First order Logic

Exercise 1:

For each of the following formulas indicate:

(a) whether it is a negation, a conjunction, a disjunction, an implication, a universal formula, or an


existential formula.
(b) the scope of the quanti ers
(c) the free variables
(d) whether it is a sentence (closed formula)

1. 9x(A(x; y) ^ B(x))
2. 9x(9y(A(x; y) ! B(x))
3. :9x(9y(A(x; y))) ! B(x)
4. 8x(:9y(A(x; y)))
5. 9x(A(x; y)) ^ B(x)
6. 9x(A(x; x)) ^ 9y(B(y))

Exercise 2: Translation from English into FoL

Translate the following sentences into FOL.

1. Everything is bitter or sweet


2. Either everything is bitter or everything is sweet
3. There is somebody who is loved by everyone
4. Nobody is loved by no one
5. If someone is noisy, everybody is annoyed

1
6. Frogs are green.
7. Frogs are not green.
8. No frog is green.
9. Some frogs are not green.
10. A mechanic likes Bob.
11. A mechanic likes herself.
12. Every mechanic likes Bob.
13. Some mechanic likes every nurse.
14. There is a mechanic who is liked by every nurse.

Exercise 3: Models

(a) and (c) done in class on Monday. (b) to be done at home by Wednesday.

(a) Check whether the formulas below are true within the model M with domain fItalo Calvino, Roberto
Baggio, torre Ei el g and interpretation:

I(c) =
I(e) =
I(b) =

I(P ) = fc; bg
I(S) = fcg
I(A) = f(c; b); (e; c); (e; b)g

I(C) = fbg

1. P (c)
2. P (e)
3. S(e)
4. A(c; e)
5. A(e; c)
6. A(e; e)

7. (P (c) ^ A(c; e)) _ (:P (c) ^ A(e; c))


8. 8x:S(x)
9. 9x:S(x)
10. 8x(P (x) ! S(x))

2
11. 9x(:P (x) _ S(x))
12. 9x(:P (x) ^ S(x))

13. 8x:P (x) _ 8x:S(x)


14. 8x:P (x) _ 8z:S(z)

15. 8x(P (x) _ S(x))

(b) Given the model M de ned by D = f0; 1g, and the interpretation:

I(P ) = f0; 1g

I(R) = f(0; 0); (0; 1)g

Verify whether the following formulas are true in M:

1. 8xP (x)
2. P (0)

3. :R(0; 0)
4. 9xR(x; x)

5. 8xR(x; x)
6. 8xR(x; x) ! P (x)

7. 8x:R(x; x) ! P (x)
8. 8x(P x ! :R(x; x))

(c) Find a model in which the following formula is true and a model in which it is false:

9y( P (y) ^ :Q(y) ) ^ 8z( P (z) _ Q(z) )

3
1 Solutions

Exercise 1

Kind of formula Scope for Free var. Sentence


1. Existential 9x : A(x; y) ^ B(x) y no
2. Existential 9x : 9y(A(x; y) ! B(x)) none yes
9y : A(x; y)
3. Implication 9x : 9y(A(x; y)) x in B(x) no
9y : A(x; y)
4. Universal 8x : :9y(A(x; y)) no yes
9y : A(x; y)
5. Conjunction 9x : A(x; y) x free in B(x) no
6. Conjunction 9x : A(x; x) no yes
9y : B(y)

Exercise 2
1. 8x(B(x) _ S(x))

2. 8x(B(x) _ 8x(S(x))
3. 9x(8y(L(y; x)))

4. :9x(:9y(L(y; x)))
5. 9x(N(x) ! 8y(A(y)))

6. 8x(F x ! Gx)

7. 8x(F x ! :Gx) = :9x(F x ^ Gx)


8. :9x(F x ^ Gx) = 8x(F x ! Gx)

9. 9x(F x ^ :Gx)
10. 9X(M x ^ L(x; b))

11. 9x(M x ^ L(x; x))

12. 8x(M x ! L(x; b))

13. 9x(M x ^ 8y(N y ! L(x; y)))


14. 9x(M x ^ 8y(N y ! L(y; x)))

Exercise 3
(a) 1. true
2. false
3. false
4. false
5. true

4
6. false
7. false
8. false
9. true, x = c
10. false
11. true, x = e
12. false
13. false
14. false
15. false

(b) 1. true
2. true
3. false
4. true
5. false, x = 1
6. true
7. true
8.

(c) The formula is true in the following M:


D = (a), I(P ) = fag, I(Q) = fg
The formula is false in the following M:

D = (a), I(P ) = fag, I(Q) = fag

You might also like