Na Me: Nim: Cla SS:: Akbar Muhammad Prakoso 1301213225 IF4509
Na Me: Nim: Cla SS:: Akbar Muhammad Prakoso 1301213225 IF4509
Na Me: Nim: Cla SS:: Akbar Muhammad Prakoso 1301213225 IF4509
Instructions:
1. This assignment is due Wednesday, November 10, 2021 at 5:00 p.m.. Please submit
your work to the corresponding submission slot in LMS CeLOE. You need to submit a
readable .pdf file of this assignment to the provided submission slot in CeLOE . You
can contact your class instructor for more detailed information. Please make sure
that your file size do not exceed the maximum file size allowed.
2. Please upload your assignment to the LMS CeLOE under the file name: A2 -cstudent
ID>.pdf, for example: A2-1301218888.pdf.
a.You print this assignment and write your answer using HB/2B pencil or pen with
blue/black ink (handwritten answer). You may add additional A4-sized papers.
Afterwards you submit the scan/photograph of this assignment.
b.You use a .pdf editing tools and write your answer directly using blue/black colored writing.
c.You copy the problem from this assignment to a text/word processing program and
type your answer neatly.
d.You rewrite the problem from this assignment in an A4-sized paper and submit the
scan/photograph of your work.
4. All problems in this assignment are adapted from the textbooks. The problems are
written in English. If you are a student in a regular class, you may answer the
problems in Bahasa Indonesia. However, if you are a student in international class,
your answers must be written in English—otherwise your assignment will not be
graded. You may ask your class instructor or teaching assistant for helping you
understanding the problem, but you should not ask them to give the solution of any
problem.
5. Be neat and write legibly. You will be graded not only on the correctness of your
answers, but also on the clarity with which you express them.
6. This assignment consists of 8 problems, each but Problems 6 and 7 are worth 10
points. Problems 6 and 7 are worth 20 points each.
7. Please retain yourself from copying answers from elsewhere without understanding
the steps. Such an attitude will not enhance your knowledge. This assignment is an
individual evaluation.
Truth Value
Part Formula (circle either T or F) Reason [1 point]
[0.25 points]
a. P (0) T/F P(0)=02 − 3 ≤ 3.0 = −3 ≤ 0 = 𝑇
page 2 of 9
Name:Akbar Muhammad Prakoso NIM: 1301213225 Class: IF4509
Problem 2 (10 points) Let 𝑄(𝑥) ≝ (𝑥 2 + 3 > 4𝑥). If the domain consists of all
integers, what are the truth value of these formulas? Explain your reasoning.
(a ). [1 point] Q (0)
(b ). [1 point] Q (1)
(d ). [2 points] ∀ 𝑥𝑄(𝑥)
(e ). [2 points] ∃𝑥 ¬𝑄(𝑥)
(f ). [2 points] ∀ 𝑥¬𝑄(𝑥)
page 3 of 9
Problem 3 (10 points) Suppose R (x, y) is the predicate x ‡ 2y > 2x — y. Determine
the truth of the following predicate formulas.
page 4 of 9
Name:Akbar Muhammad Prakoso NIM: 1301213225 Class: IF4509
ANSWER: ¬∃x ( G( x ) Λ S( x ))
(c ). [2.5 points] Someone who is participated in the game does not cheat.
ANSWER: ∃x ( G( x ) Λ -C( x ))
page 5 of 9
Problem 5 (10 points) Translate each of these statements into logical expression using
only the specified domain and predicates.
(b ). [2 points] “Everyone in your class has studied mathematical logic and programming”.
page 6 of 9
Name:Akbar Muhammad Prakoso NIM: 1301213225 Class: IF4509
Problem 6 (20 points) Verify whether each of these arguments is valid or not. Explain
which rules of inference are used for each step.
(a ). [5 points] “Linda, a student in this class, owns a red car. Everyone who owns a red
car has gotten at least one speeding ticket. Therefore, someone in this class has
gotten a speeding ticket.” Use the following predicates: C (x) := x is a student in
this class, R (x) := x owns red car, T (x) := x has gotten a speeding ticket. Suppose
the domain for x is the set of all persons.
ANSWER:
1. C (Linda) ∧ R (Linda) (premis)
2. ∀x (R (x) → T (x)) (premis)
3. R (Linda) → T (Linda) (universal instantiation dari (2))
4. R (Linda) (simplifikasi dari (1))
5. T (Linda) (modus ponens dari (3) dan (4))
6. C (Linda) (simplikasi dari (1))
7. C (Linda) ∧ T (Linda) (konjungsi (5) dan (6))
8. ∃x (C (x) ∧ T (x)) (existential generalization dari (7))
Jadi kesimpulan yang dapat ditarik dari pernyataan ∃x (C (x) ∧ T (x)), atau “seseorang di
kelas punya tiket tilang” adalah Terbukti kesimpulan bernilai Benar/ True(T).
(b ). [5 points] “All good players are expensive. Jack Grealish is not a good player.
Therefore, Jack Grealish is not expensive”. Use the following predicates: G (x) :=
x is a a good player and E (x) := x is expensive. Suppose the domain of x is the set
of all players.
ANSWER:
Jadi kesimpulan yang dapat ditarik adalah ¬𝐸 tidak dapat dtitentukan, sehingga dapat
dikatakan Kesimpulan bernilai Salah/ False(F).
page 7 of 9
(c ). [5 points] “All movies produced by Steven Spielberg are exciting. Steven
Spielberg produced a movie about dinosaurs. Therefore, there is an exciting
movie about dinosaurs.” Use the following predicates: S (x) := x is a movie
produced by Steven Spielberg, E (x) := x is an exciting movie, D (x) := x is a
movie about dinosaurs. Suppose the domain of x be the set of all movies.
ANSWER:
Jadi kesimpulan yang dapat ditarik dari pernyataan “ ada film menarik tentang
dinosaurus” atau ∀x (E (x) ∧ D (x)) adalah Terbukti kesimpulan bernilai Benar/
True(T).
(d ). [5 points] “There is someone in this class who has been to France. Everyone who
goes to France visit the Louvre. Therefore, someone in this class has visited the
Louvre.” Use the following predicates: C (x) := x is in this class, F (x) := x has
been to France, G (x) := x has visited Louvre. Suppose the domain of x be the set
of all persons.
ANSWER:
Jadi kesimpulan yang dapat ditarik dari pernyataan “ada seseorang yang pernah ke
Louvre” atau ∃x (C (x) ∧ L(x)) adalah Terbukti kesimpulan bernilai Benar/
True(T).
page 8 of 9
Name:Akbar Muhammad Prakoso NIM: 1301213225 Class: IF4509
Problem 7 (20 points) Mowgli lives in an Indian rainforest and recently he learned following facts:
(b ). [10 points] Mowgli thinks only one of the following conclusion is correct:
What is the correct conclusion? Explain your reasoning using rule of inference in
predicate logic. ANSWER:
1. ∀x (T(x) → C (x)) (premis)
2. T(Sherkan) ^ P (Sherkan) (premis)
3. ∀x (P (x) → L (x)) (premis)
4. T(Sherkan) → C (Sherkan) (instaniasi universal dari 1)
5. T(Sherkan) (simplifikasi dari 2)
6. C (Sherkan) (modus ponens dari 4 dan 5)
7. P (Sherkan) (simplifikasi dari 2)
8. P (Sherkan) → L (Sherkan) (instansiasi universal dari 3)
9. L (Sherkan) (modus ponens dari 7 dan 8)
10. C (Sherkan) ∧ L (Sherkan) (konjungsi dari 8 dan 9)
11. ∃x (C (x) ∧ L (x)) (generalisasi eksistensi dari 10)
Jadi kesimpulan yang benar dari pernyataan diatas adalah ada hewan karnivora yang memiliki usia
yang panjang (There is no carnivorous animal who has a long life span.)
page 9 of 9
Problem 8 (10 points) Suppose we have the following Prolog knowledge base.
plant(herbs). eats(deer,shrub).
plant(grass). eats(grasshopper,grass).
plant(shrub). eats(rabbit,herbs).
animal(caterpillar). eats(crow,caterpillar).
animal(deer). eats(crow,herbs).
animal(grasshopper). eats(crow,grasshopper).
animal(rabbit). eats(fox,rabbit).
animal(crow). eats(frog,caterpillar).
animal(fox). eats(frog,grasshopper).
animal(frog).
eats(snake,frog).
animal(snake).
eats(snake,rabbit).
animal(hawk).
animal(lion). eats(hawk,crow).
eats(hawk,snake).
eats(caterpillar,grass).
eats(lion,deer). eats(lion,fox).
eats(caterpillar,herbs).
eats(deer,herbs).
Suppose the above knowledge base is supplemented with the following rules:
page 10 of
9
Akbar Muhammad Prakoso 1301213225 IF4509
Name: NIM: Class:
Determine the output of the following queries if the program is run using SWI-Prolog:
(b ). [1 point] eats(X,caterpillar).
(f ). [2 points] prey(hawk).
(c ). [1 point] herbivore(frog).
(g). [2 points] prey(X), not(carnivore(X)).
(d ). [1 point] carnivore(crow).
ANSWER:
(a). eats(hawk,X)
X = crow ;
X = snake.
(b). eats(X,caterpillar)
X = crow;
X = frog.
page 11 of
9