Professional Documents
Culture Documents
KBS - 3 - Knowledge Representation (Part 2)
KBS - 3 - Knowledge Representation (Part 2)
Representation (Part 2)
Logic, Rules, Frame
1
Logika
Frame Based
2
3
LOGIKA
4
What is a logic?
5
Logika
Proposisional
KR in
Logic
Logika Predikat
(FOPL)
6
Syntax of Propositional Logic
7
Logika Predikat /
First Order Logic
8
First-order logic
• Propositional logic assumes the world contains facts that are true or
false.
9
First Order Logic Syntax
Predicate (Object1,[object2],[object3])
Contoh :
10
Syntax of FOL : Basic elements
11
Models for FOL: Example
12
Quantifiers
• There are two quantifiers:
- “for all”
• xy eats(x, y) likes(x, y)
- “there exits”
• x person(x) likes(x, apples)
• x y loves(x,y)
• (xy eats(x, y) likes(x, y)) (x = penguin) (y=fish)
13
Unification
• Unification: The process of finding all legal substitutions that make
logical expressions look identical
14
Contoh Logika Predikat
Semua laki-laki menyukai apel. Semua Laki-laki pasti membeli semua
yang dia sukai. Toni adalah laki-laki.
Logika Predikat :
laki-laki(Toni)
15
Pertanyaan ?
16
Rule-Based
17
Bagaimana Manusia berpikir ?
Proses berpikir manusia terlalu komplek untuk direpresentasikan dalam sebuah
algoritma
Sebagian besar pakar mampu untuk mengekspresikan pengetahuan mereka dalam
bentuk aturan / rules
IF [condition] Then [action]
18
Contoh Rule
• IF Traffic light red THEN stop
• IF Traffic light green THEN move
• IF the temperature exceeds 90 degrees
THEN turn on the cooling fan.
• IF the ball red THEN I like the ball
• IF I like the ball THEN I will buy the ball
19
Rule sebagai KR Method
Rule consists of two parts: IF <antecedent/premise/condition>
THEN <consequent/conclusion/action>
20
Rule sebagai KR Method (2)
•The antecedent (IF part) and the consequent (Then part) incorporate two parts:
1.Linguistic object
2.Value
•Operator :
link the object and its value
Example: is, are, is not, are not, mathematical operators(>, <, =, etc.)
•Examples:
IF ‘age of the customer’ < 18
AND ‘cash withdrawal’ > Rp. 100.000,-
THEN ‘signature of the parent’ is required
21
Rule sebagai KR Method (3)
22
Rule sebagai KR Method (4)
23
Rules Example
1. IF hewan berambut or hewan menyusui THEN hewan adalah mamalia
2. IF hewan berbulu dan hewan bertelur THEN hewan adalah burung
3. IF hewan adalah mamalia and hewan makan daging THEN hewan adalah karnivora
4. IF hewan adalah karnivora and hewan berwarna kuning kecoklatan and hewan
berbintik hitam THEN hewan adalah cheetah
5. IF hewan adalah karnivora and hewan berwarna kuning kecoklatan and hewan
bergaris hitam THEN hewan adalah macan
6. IF hewan adalah burung and hewan tidak bisa terbang and hewan bisa berenang THEN
hewan adalah pinguin
7. IF hewan adalah burung and hewan memiliki sayap yang besar dan lebar THEN hewan
adalah elang laut.
24
Pertanyaan ?
25
Frame Based
26
Frame
• Frame biasa digunakan untuk merepresentasikan pengatahuan yang
bersifat umum (dimiliki oleh Sebagian besar orang).
• Sebuah frame terdiri dari sekumpulan slot dan value (Filler). Kedua
elemen ini merepresentasikan pengetahuan umum/spesifik dari
sebuah objek.
• Pewarisan properti (Property inheritance) berlaku untuk fram eyang
berbentuk hirarki.
27
Frame (2)
28
29
Frames Example
30
Class, Subclass, Instance
CLASS: Humans
Subclasses: Men, Women
Age: Unknown
Number of legs: 2
Residence: Unknown
Life expectancy: 72
31
Frame World of Humans
Class Humans
32
CLASS: Name-1
Superclass
Property-1: Value-1
Property-2: Procedure-1
Class
CLASS: Name-2
Superclass: Name-1
Property-1: Value-1 Instances
Property-2: Procedure-1
Property-3: Procedure-2
INSTANCE: Name-3
CLASS: Name-2
Property-1: Value-1
Property-2: Procedure-1
Property-3: Procedure-2
33
33
Types of Relationship
1.Generalization
• ‘a-kind-of’ or ‘is-a’ relationship between a superclass and its subclasses
CLASS: Vehicle
is- a
i s-a is-a
34
Types of Relationship (2)
2. Aggregation
• ‘a-part-of’ or ‘part-whole’ relationship
• Subclasses (components) are associated with a superclass (whole)
CLASS: Car
a-p
t-of art-
p ar o f
a- a-part-of
35
Types of Relationship (3)
3. Association
• Describe some semantic relationship between different classes
• Usually appear as verbs and inherently bi-directional
36
Properties
Properties:
Describe the major features or attributes of some concept or object
Form a set of object-attribute-value (OAV)
Rich representation of the object
Properties value:
Data assigned to a given property
Numeric, symbolic, boolean
37
Properties Values
ISNTANCE: Refrigerator
CLASS: Home Appliances
Age: 10 Initialize
Service No.: +62274797979 Database
Volume: 16 Procedure
Condition: Good Expert system
Location: Kitchen User
Power: Electricity Inheritance
Defrost cycle: On Other object
38
Inheritance
The process by which all characteristics of a class-frame are assumed by the instance-
frame
• Multiple inheritance
In many problems it is natural to discuss objects as they relate to different worlds
A frame inherit information from its parent, grandparent, great-grandparent, etc.
39
CLASS: ZE vehicle
[N] Weight, kg:
Inheritance
[N] Top speed, km/h:
INSTANCE: Jack
Age:
Weight :
Phone number :
Salary :
42
Exception Handling
• Exception handling
Handling an exception frame from the norm one
When the frame has some property value unique to itself
43
CLASS: Humans
Age: Unknown
Exception Handling
Number of legs: 2
Residence: Unknown
Life expectancy: 72
CLASS: Men
Superclass: Humans
Age: Unknown
Number of legs: 2
Residence: Unknown INSTANCE: Jack
Life expectancy: 72 CLASS: Men
Mustache: True Age: 40
Number of legs: 1
Residence: Pittsburgh
Life expectancy: 72
Mustache: True
44
Pertanyaan ?
45
Tugas/Latihan 1 (Representasi
Pengetahuan)
46
Next week
47
Proposal
Proposal proyek disusun mahasiswa dengan mengikui struktur proposal sebagai berikut :
1. Judul dan identitas kelompok
2. Latar belakang
3. Tujuan
4. Metode pengembangan sistem
5. Proses akusisi pengetahuan
6. Sumber Pengetahuan
7. Basis Pengetahuan sistem
8. Algoritma inferensi yang akan digunakan
9. Jadwal kegiatan
10. Deskripsi tugas dan tanggung jawab tiap anggota
48
Bobot Penilaian
49