0% found this document useful (0 votes)
11 views6 pages

Activity 2 Week 2-3 February 2024 Computer Theory Solutions

The document contains a lab activity for CIT3711 on February 21, 2024 from 14h30 to 17h30. It provides answers to translating statements into first-order predicate logic. Some examples include: "Nangula loves everyone" translated as "∀x love(Nangula, x)"; "No one talks" as "¬∃x talk(x)"; and "Everyone loves everyone except himself" as "∀x∀y(¬x=y → love(x, y))". The document discusses handling ambiguous statements and the proper use of quantifiers and variables.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views6 pages

Activity 2 Week 2-3 February 2024 Computer Theory Solutions

The document contains a lab activity for CIT3711 on February 21, 2024 from 14h30 to 17h30. It provides answers to translating statements into first-order predicate logic. Some examples include: "Nangula loves everyone" translated as "∀x love(Nangula, x)"; "No one talks" as "¬∃x talk(x)"; and "Everyone loves everyone except himself" as "∀x∀y(¬x=y → love(x, y))". The document discusses handling ambiguous statements and the proper use of quantifiers and variables.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

CIT3711 Lab Activity 2 14h30 – 17h30 21st February 2024

Activity 2 Answers
Activity in 1st-order predicate logic
1. Nangula loves everyone. [assuming D contains only humans]
∀x love (Nangula, x)
2. Nangula loves everyone. [assuming D contains both humans and non-
humans, so
we need to be explicit about ‘everyone’ as ‘every person’]
∀x (person(x) → love (Nangula, x))
3. No one talks. [assume D contains only humans unless specified
otherwise.]
¬∃x talk(x) or equivalently, ∀x¬talk(x)
4. Everyone loves himself.
∀x love (x, x)
5. Everyone loves everyone.
∀x∀y love (x, y)
6. Everyone loves everyone except himself. (= Everyone loves everyone
else.)
∀x∀y(¬ x = y → love (x, y)) or ∀x∀y( x ≠ y → love (x, y))
7. Every student smiles.
∀x (student(x) → smile( x))
8. Every student except Thikushu smiles.
∀x ((student(x) & x ≠ Thikushu) → smile( x))
9. Everyone walks or talks.
∀x (walk (x) ∨ talk (x))
10. Every student walks or talks.
∀x (student(x) → (walk (x) ∨ talk (x)))
11. Every student who walks talks.
∀x ((student(x) & walk (x)) → talk (x))) or
∀x (student(x) → (walk (x) → talk (x)))
12. Every student who loves Nangula is happy.
∀x ((student(x) & love (x, Nangula)) → happy (x)))
13. Every boy who loves Nangula hates every boy whom Nangula loves.
∀x((boy(x) & love (x, Nangula)) → ∀y((boy(y) & love(Nangula, y))→ hate
(x,y)))
14. Every boy who loves Nangula hates every other boy whom Nangula
loves.
(So, if Petrus loves Nangula and Nangula loves Petrus, sentence 13
requires that
Petrus hates himself, but sentence 14 doesn’t require that.)
∀x((boy(x) & love (x, Nangula)) → ∀y((boy(y) & love(Nangula, y) & y ≠
x) →
hate (x,y)))
Activity #1, Answers.
1. Everyone loves Nangula.
∀x love (x, Nangula)
2. Petrus does not love anyone. (Not ambiguous, but there are two
equivalent and equally good formulas for it, one involving negation and
the existential quantifier, the other involving negation and the universal
quantifier. Give both.)
¬∃x love(Petrus, x) or equivalently, ∀x¬ love(Petrus, x)
3. Everyone who sees Nangula loves Nangula.
∀x (see (x, Nangula) → love (x, Nangula))
4. Everyone loves someone. (Ambiguous)
(i) ∀x∃y love (x, y) (For every person x, there is someone whom x loves.)
(ii) ∃y∀x love (x, y) (There is some person y whom everyone loves, i.e.
everyone loves some one specific person.)
5. Someone loves everyone. (Ambiguous)
(i) ∃x∀y love (x, y) (There is some person x who loves everyone.)
(ii) ∀y∃x love (x, y) (For every person y, there is someone who loves them
i.e., no one is totally unloved.)
6. Someone walks and talks.
∃x(walk (x) & talk (x))
7. Someone walks and someone talks.
(∃x walk (x) & ∃x talk (x)) or (∃x walk (x) & ∃y talk (y))
Because neither quantifier is inside the scope of the other – i.e. their
scopes are independent – it doesn’t matter whether we use different
variables here or use the same variable twice. But if one quantifier is
inside the scope of the other, then it matters a great deal. When one
quantifier is inside the scope of another, as in questions 4 and 5 above,
always give them different variables!
8. Everyone who walks is calm.
∀x (walk(x) → calm( x))
9. No one who runs walks. (Not ambiguous, but same note as for number
2.)
(i) ¬∃x (run (x) & walk (x)) or equivalently,
(ii) ∀x (run(x) → ¬ walk(x))
10. Everyone who Nangula loves loves someone who is happy.
∀x(love (Nangula, x)→ ∃y(love(x,y) & happy( y)))
11. If anyone cheats, he suffers.
∀x (cheat(x) → suffer( x))
12. If anyone cheats, everyone suffers.
∀x (cheat(x) → ∀y suffer(y))
13. Anyone who loves everyone loves himself.
∀x(∀y love (x,y)→ (love(x,x))
note: NOT this: ∀x∀y (love (x,y)→ (love(x,x)) What this one says is
“Anyone who loves anyone loves himself” What the correct one says is
IF you love everyone, THEN you love yourself. So, the ∀y quantifier has
to be inside the scope of the →.
14. Nangula loves everyone except Petrus. (For this one, you need to add
the two-place predicate of identity, “=”. Think of “everyone except
Petrus” as “everyone who is not identical to Petrus”.)
∀x (¬ x = Petrus → love (Nangula, x)) or equivalently
∀x (x ≠ Petrus → love (Nangula, x))
15. Redo the translations of sentences 1, 4, 6, and 7, making use of the
predicate person, as we would have to do if the domain D contains not
only humans but cats, robots, and other entities.
1’. Everyone loves Nangula.
∀x (person(x) → love (x, Nangula))
4’. Everyone loves someone. (Ambiguous)
(i) ∀x(person(x) → ∃y(person(y) & love (x, y))) (For every person x, there
is some person y whom x loves.)
(ii) ∃y(person(y) & ∀x(person(x) → love (x, y))) (There is some person y
whom every person x loves.)
6’. 6. Someone walks and talks.
∃x(person(x) & walk (x) & talk (x))
Note: technically, we need more parentheses – either
∃x(person(x) & (walk (x) & talk (x))) or
∃x((person(x) & walk (x)) & talk (x))
But since it’s provable that & is associative, i.e. the grouping of a
sequence of &’s doesn’t make any difference, it is customary for Nangula
to allow expressions like (p & q & r). And similarly for big disjunctions, (p
∨ q ∨ r). But not with →!
7’. Someone walks and someone talks.
(∃x (person(x) & walk (x)) & ∃x(person(x) & talk (x))) or equivalently.
(∃x (person(x) & walk (x)) & ∃y (person(y) & talk (y)))
Note: both in the original 7 and in this 7’, it would be OK and Nangula to
drop outermost parentheses, i.e. the very first left parenthesis and the
very last right parenthesis may be dropped. (But no parentheses can be
dropped in 6; they are not “outermost”. Only when a pair of parentheses
contains the entire formula can it be dropped under the “drop outermost
parentheses” convention.

You might also like