### Backward Chaining

```1
Lecture 7
Backward Chaining
Erick Pranata
» Menentukan konklusi berdasarkan fakta
» Perolehan fakta:
˃ Dengan “perhitungan”
˃ Menanyakan ke user
2
» Semisal terdapat beberapa rule yang
berkaitan dengan hewan peliharaan
sebagai berikut:
˃ If aksi = berkicau and makanan =
kacang Then jenis = kenari
˃ If aksi = ngorék and makanan =
lalat Then jenis = kodok
˃ If jenis = kenari Then warna = kuning
˃ If jenis = kodok Then warna = hijau
» Tentukan warna jika aksi = ngorék dan
makanan = lalat!
Sumber: http://en.wikipedia.org/wiki/Backward_chaining, dengan
perubahan
3
warna
jenis
makanan
aksi
4
warna
jenis
lalat
ngorek
makanan
aksi
5
hijau
kodok
lalat
ngorek
warna
jenis
makanan
aksi
6
» Backward chaining berusaha mengisi
working memory
» Dilakukan dengan menginferensi rule
7
» Alur penelusuran konklusi
1. Working Memory
2. Rule
3. Interface
8
9
10
RULE 10
IF temperature = normal and
other_symptoms = yes
THEN problem = serious;
RULE 11
IF temperature = normal and
other_symptoms = no
THEN problem = non_serious;
RULE 12
IF temperature = abnormal
THEN problem = serious;
RULE 13
IF temperature = not_known
THEN problem = serious;
11
» Find problem!
1. Jika temperatur = normal dan
other_symptoms = no
2. Jika temperatur = abnormal dan
other_symptoms = yes
12
» Find support!
˃
˃
˃
˃
˃
member = yes
valid_id = yes
reason = follow_up_case
temperature = normal
other_symptoms = yes
13
14
» Menyatakan tingkat keyakinan konklusi
» Input dari user pun dapat memiliki CNF
15
CNF of premise * CNF of rule / 100
IF diagnosis = measles
THEN treatment = penicillin CNF 90
Jika CNF untuk diagnosis = measles adalah
70, maka CNF konklusi adalah 70*90/100
= 63
16
» Premis AND
˃ min(C1,C2)
» Premis OR
˃ C1 + C2 - (C1 * C2)/100
if temperature = very_high with confidence 90
and spots = yes with confidence 75
=> 75
if spots = yes with confidence 75
or rash = yes with confidence 80
=> 75+80-(75*80)/100 = 95
17
IF sore_throat = yes
AND temperature = high
OR temperature = very_high
THEN diagnosis = flu CNF 90;
sore_throat = yes CNF 70
temperature = high CNF 80
temperature = very_high CNF 60
18
» 63
19