Professional Documents
Culture Documents
Logika Informatika (Logika Proposisional)
Logika Informatika (Logika Proposisional)
Logika Informatika (Logika Proposisional)
Propositional Logic
Propositional logic
• Logical constants: true, false
• Propositional symbols: P, Q, S, ...
(atomic sentences)
• Wrapping parentheses: ( … )
• Literal: atomic sentence or negated
atomic sentence
2
• Syntactics Rule
is a rule necessary to combine between
propositions and propositional connectives to
produce sentences (sentences logic).
Conventional Notation :
(( p ˅ q) ^ (q → r)) → ( (p ^ q) →~ r)
Examples of PL sentences
• P means “It is hot.”
• Q means “It is humid.”
• R means “It is raining.”
• (P Q) R
“If it is hot and humid, then it is raining”
• QP
“If it is humid, then it is hot”
• A better way:
Hot = “It is hot”
Humid = “It is humid”
Raining = “It is raining”
6
Interpretation
• It is the provision of a truth value (true or
false) at every proposition symbol from a
logic sentence.
p ← True
p ← False
atau
q ← True
q ← False
Semantic Rule
True False
False True
• Conjunction Rule (Aturan AND)
p q p and q
True True True
True False False
False True False
False False False
• Disjunction Rule (Aturan OR)
p q p or q
True True True
True False True
False True True
False False False
a. Hukum Idempoten
pvp =ppʌp =p
b. Hukum Komutatif
p v q= q v p
p ʌ q= q ʌ p
c. Hukum Assosiatif
(pvq) v r = pv(qvr)
(pʌq) ʌ r = pʌ(qʌr)
d.Hukum Distributif
pv(qʌr) = (pvq) ʌ (pvr)
pʌ(qvr) = (pʌq) v (pʌr)
e.Hukum Identitas
pv False = p
pʌTrue = p
pv True = True
pʌ False = False
f.Hukum Komplemen
pv not p = True
pʌnot p = False
not (not p) = p
g.Hukum De Morgan
Negasi dari konjungsi dan disjungsi:
not (pvq) = not p ʌ not q
not (pʌq) = not p v not q
• Implication Rule (Aturan IF-THEN)
Implikasi bernilai “salah” bila anteseden benar
dan konsekuen salah
p q If p then q
True True True
True False False
False True True
False False True
Jika (pq) adalah implikasi,
maka :
(qp) adalah konvers
(not pnot q) adalah invers
(not qnot p) adalah
kontraposisi
p q p if and only if q
True True True
True False False
False True False
False False True
• Conditional Rule (Aturan IF–THEN-ELSE)
Jika p bernilai benar maka q berlaku
Jika p bernilai salah maka r berlaku
p q r if p then q else r
True True True True
True True False True
True False True False
True False False False
False True True True
False True False False
False False True True
False False False False
LATIHAN
Ubahlah kalimat logika berikut ke dalam simbol
konvensional:
1.(if p then q) or (if q then p)
2.(not q) or not (if p then (not q) and p)
3.(if p then (not q)) if and only if not (p and q)
4.(if (p or q) then r) if and only if ((if p then r) and (if q then r))
5.(p if and only if (q if and only if r)) if and only if (( p if and only
if q) if and only if r)
1. Tentukan nilai kebenaran (truth value) dari
sentence berikut, dengan menggunakan truth
table :
a. F: (f and g) if and only if (g and g)
b. G: if (if p then q) then q
c. H: ((p or q) and not r) if and only if (if
p then r) and (if q then r)
2. Jika diberikan suatu nilai (interpretasi) True
untuk p dan s dan False untuk q dan r, maka
tentukanlah nilai kebenaran untuk kalimat
berikut:
a. ((if p then q) and (if q then p) if and only if (q
or not p)
b. (p and (if r then s)) if and only if ((if r then s)
and p)
Diskusi kelompok
• Tentukan proposisi atomic dan proposisi
majemuk dari kalimat berikut :
1. Setiap mahasiswa warga Negara
Indonesia
2. Budi kaya raya, demikian juga Ani
3. Budi kaya raya atau banyak harta
4. Proposisi atau proposisional memiliki
kesamaan makna.
Diskusi kelompok
• Tentukan kalimat berikut merupakan
proposisi atau bukan proposisi serta nilai
benar atau salah jika proposisi :
1. Angka 9 adalah angka ganjil
2. Jangan lewati jalan ini!
3. 2 + 6 = 8
4. y + 5 = 12
5. x + 1 = 2, jika x = 1
6. Bentuk Negara Indonesia ialah monarki
7. Sang pemimpi sekuel laskar pelangi
TERIMA KASIH