程序代写代做代考 Slide 1
Slide 1
Answers to Some Predicate Logic
Formalisation Exercises from the
Predicate Logic Notes
1
Predicates to be used:
lecTheatre/1
office/1
contains/2
lecturer/1
has/2
same/2
phd/1
supervises/2
happy/1
completePhd/1
2
1.
311 is a lecture theatre and 447 is an office.
311 is a lecture theatre and 447 is an office
lecTheatre(311) office(447)
3
2. Every lecture theatre contains a projector.
Every lecture theatre contains a projector.
X ( → )
Every
Any Map to
All
Everyone
….
4
Every lecture theatre contains a projector.
X (lecTheatre(X) → )
X (lecTheatre(X) → contains(X, projector))
Alternatively:
X (lecTheatre(X) →
Y (projector(Y) contains(X, Y)))
5
A universally quantified wff is usually like this:
X ( → )
Or like this:
X ( )
That is their principle connective is
→ or .
6
3. Every office contains a telephone and either a desktop or a laptop
computer.
Every office contains a telephone and either a desktop or a laptop computer.
X (office(X) → …….)
… contains a telephone and either a desktop or a laptop computer.
X (office(X) →( …. …))
X (office(X) →(contains(X, telephone) (…)))
… either a desktop or a laptop computer.
X (office(X) →(contains(X, telephone) ( … …)))
X (office(X) →(contains(X, telephone)
(contains(X, desktop) contains(X, laptop))))
7
4. Every lecturer has at least one office.
Every lecturer has at least one office.
X (lecturer(X) → … )
… has at least one office.
X (lecturer(X) → Y (office(Y) has(X, Y)))
8
At least one
Some map to
One
….
9
An existentially quantified wff is usually like
this:
X ( )
Or like this:
X ( )
That is their principle connective is
or .
10
5. No lecturer has more than one office.
No lecturer has more than one office.
Not any lecturer has more than one office.
(There does not exist a lecturer who has more
than one office.)
¬L (lecturer(L) L has more than one office)
¬L (lecturer(L) L has at least 2 offices that are
not the same)
11
¬L (lecturer(L) there are at least 2 offices that
L has and are not the same)
¬L (lecturer(L)
O1 O2 (office(O1) office(O2)
has(L, O1) has(L, O2)
¬same(O1,O2)))
12
There are other ways of doing 5. For example:
L (lecturer(L) → ¬ (O1 O2 (office(O1)
office(O2) has(L, O1) has(L, O2)
¬same(O1,O2)))
L O1 O2 (lecturer(L) office(O1)
office(O2) has(L, O1) has(L, O2) →
same(O1,O2))
13
6. No lecturers share offices with anyone.
Try it …..
7. Some lecturers supervise PhD students and
some do not.
(L …..) (L …..) or
(L1 …..) (L2 …..)
14
Some lecturers supervise PhD students and
some do not.
(L (lecturer(L) there is at least one PhD
student that L supervises))
(L (lecturer(L) there is not at least one PhD
student that L supervises))
(L (lecturer(L) S (phd(S) supervises(L,S))))
(L (lecturer(L) ¬S (phd(S) supervises(L,S))))
15
(L (lecturer(L) S (phd(S) supervises(L,S))))
(L (lecturer(L) ¬S (phd(S) supervises(L,S))))
Drop some unneccesary brackets:
L (lecturer(L) S (phd(S) supervises(L,S)))
L (lecturer(L) ¬S (phd(S) supervises(L,S)))
16
8. Each PhD student has an office, but all PhD
students share their office with at least one
other PhD student.
Try it ……
17
9. A lecturer is happy if the PhD students
he/she supervises successfully complete their
PhD.
L (lecturer(L) his/her PhD students
successfully complete → happy(L))
L (lecturer(L) all his/her PhD students
successfully complete → happy(L))
L (lecturer(L) S if S is L’s PhD student then S
successfully completes→ happy(L))
18
L (lecturer(L)
S if S is L’s PhD student then S successfully
completes→ happy(L))
L (lecturer(L)
S (phd(S) supervises(L,S) → completePhD(S))
→ happy(L))
19
10.Not all PhD students complete their PhD.
Try it ….
20