Artificial Intelligence: Knowledge Representation
Artificial Intelligence: Knowledge Representation
Knowledge
Representation
Applying AI Concepts
Computer
Knowledge Inference
Inputs base mechanism Outputs
2
Knowledge Base
• The first step in constructing an AI program is to build a
knowledge base
• Forming the system’s source of intelligence
• Will be used by the inference mechanism to reason and draw
conclusions
• Contains:
Ø concepts, theories, practical procedures, and their associations
Ø facts about objects (in the chosen domain) and their relationship
Knowledge Engineering
• Steps:
4
Knowledge Representation
6
Knowledge Representation (3)
• Some knowledge representation schemes:
1. Logic
2. List
3. Tree
4. Semantic Network
5. Production System
6. Frame
Logic
Input: Output:
premises inferences
Logical
or or
process
facts conclusions
8
Logic (2)
• Basic type of reasoning :
– Deductive
Ø general premises are used to reach specific inferences
Ø from general to particular
Ø Using rules and preconditions to make a conclusion
Ø It’s a method of verification
– Inductive
Ø specific premises are used to infer general inferences
Ø from particular to general
Ø The premises of an argument are believed to support the conclusion
Ø It’s a method of discovery
Logic (3)
• Computational Logic:
Ø Symbolic logic or mathematical logic
Ø A system of rules and procedures that permit the drawing of inferences
from various premises using a variety of logical techniques
10
Propositional Logic
• Example:
– All human are mortal.
– 5+3=8
– Call me now!
– Is it cold?
11
• Connectives:
– Combining two or more propositions
– Basic connectives: AND, OR, NOT, IMPLIES, EQUIVALENT
Connectives Symbol
AND ∧, ∩, &
OR ∨,∪, +
NOT ¬, ∼, !
IMPLIES ⇒, ➔, ⊃
EQUIVALENT ⇔, ≡, ↔
12
Propositional Logic (3)
• Variables
Ø Representing a proposition and relations
• Truth Table
Ø Tabulate the value of a proposition for all possible values of its variables
P Q P AND Q P Q P OR Q
T T T T T T
T F F T F T
F T F F T T
F F F F F F
P Q P Q P Q P Q
T T T T T T
T F F T F F
F T T F T F
F F T F F T
13
•Ex. reasoning:
p : I am in a good health
q : we have a class
Modus Ponens
(( p q)∧p) q
14
Propositional Logic (5)
• Inference Rule:
1. Modus Ponens (Implication-Elimination): (( p1 p2 ) ∧ p1 ) p2
2. And-Elimination: p1 ∧ p2 ∧ ... ∧ pn pi
4. Or-Introduction: pi p1 ∨ p2 ∨ ... ∨ pn
5. Double-Negation-Elimination: ¬ ¬ p p
15
Predicate Logic
16
Predicate Logic (2)
Proposition: THE CAR IS IN GARAGE
Argument Argument
(object) Predicate (object)
(assertion)
in (car, garage)
Predicate Argument
(assertion) (object)
17
Predicate Argument
(assertion) (object)
18
Predicate Logic (3)
Example: Variables
• John likes Mary John likes Mary
like(x,y)
x=John, y=Mary
• Quantifiers
∀ : for all, for any, for each à universal quantifier
∃ : there exists, some à existential quantifier
19
• List:
– A written series of related items
– Objects are grouped according to rank or relationship
• Tree:
– A graphical structure of a hierarchy
– Nodes : show the object/event
– Arc : show the relationship
20
List
List A
Element A.1
Element A.2
Element A.3
Element A.2
Element A.4
Subelement A.2.a
Subelement A.2.b
Element A.4
Subelement A.2.c
Subelement A.4.a
Subelement A.2.d
Subelement A.4.b
Subelement A.4.c Subelement A.2.c
Subelement A.4.d Sub-subelement A.2.c.1
Sub-subelement A.2.c.2
Sub-subelement A.2.c.3
21
Tree
Node
A
1 2 3 4 5 6
a b c d e f g
Arc
(1) (2)
22
Semantic Network
• Semantic network reflect the complex manner in which human
knowledge is structured
23
• Basic assumption:
Ø The meaning of word can be represented by the set of its
verbal associations
24
Semantic Network (3)
25
• Important:
– Graphic in nature, but in a computer it is stated in verbal terms
– There’s no standard set of relations
26
Semantic Network: Car Navigation System
27
Example of map:
28
Semantic Network: Car Navigation System (3)
29
Point(point_id, X, Y) titik1
Point(titik1, 36.59, 48.23) titik7
titik6
jalur6
• Path:
Path(path_id, [point_id1, point_id2], length)
30
Conceptual Graph
31
32
Production System
• Production system:
Øentire set of rules for executing a task
• Elements:
– Condition : state of affairs that must exist for the rule to be
applicable
– Action : thing to be done if rule is applied
33
34
Frame
• Suitable for the representation of more complex (or “deeper”)
knowledge => Nodes can have an internal structure
• When hierarchies of frames are used, then one frame may also inherit
the properties of another frame
35
Frame (2)
Name: Name-1
Attribute-1: Value-1
Attribute-2: Procedure-1
Slots
Attribute-3: Procedure-2 Fillers
......
Attribute-n: Value-m
36
Frame (3)
CLASS: Name-1 Inherit
values from
Inheritance
Property-1: Value-1
Property-2: Procedure-1
CLASS: Name-2
Superclass: Name-1 Inherit values
from
Property-1: Value-1
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
37
CLASS: ZE vehicle
[N] Weight, kg:
[N] Top speed, km/h:
38
CLASS: Sedan CLASS: Van CLASS: Truck
Superclass: Car Superclass: Car Superclass: Car
[N] Weight, kg:
[N] Top speed, km/h:
[Str] Motor:
[Str] Battery type:
[N] Range, km:
[N] Payload, kg:
39
Summary
• Knowledge base
1. Logic
2. List Inputs Knowledge Inference Outputs
base mechanism
3. Tree
4. Semantic network
5. Production system
6. Frame
40
Ontology: Philosophical Foundation
• Philosophy of being:
- Try to answer questions such as:
‣ What are things?
‣ What is the essence that remains inside things even
when they change (in color, size, etc.)?
‣ Do concepts (book, tree, table, etc.) exist outside our
mind?
‣ How can the entities of the world be classified?
41
• Essence:
‣ what this something is (Gambra, 1999)
• Existence:
‣ to be present among things in the real world (Gómez-Pérez,
2004)
42
Ontology: Definition in CS
43
Thesauri General
Catalog “narrower Formal Frames logical
/ID term” relation is-a (properties) constraints
44
Ontology Standards
45
Sikos, L. F. (2015). Mastering Structured Data on the Semantic Web: From HTML5
Mircodata to Linked Open Data. New York: Apress
46
Resource Description Framework (RDF) (2)
Sikos, L. F. (2015). Mastering Structured Data on the Semantic Web: From HTML5
Mircodata to Linked Open Data. New York: Apress
47
Sikos, L. F. (2015). Mastering Structured Data on the Semantic Web: From HTML5
Mircodata to Linked Open Data. New York: Apress
48
Sikos, L. F. (2015). Mastering Structured Data on the Semantic Web: From HTML5
Mircodata to Linked Open Data. New York: Apress
49
Summary
• Knowledge base
• Knowledge representation
scheme: Computer
1. Logic
Knowledge Inference
2. List Inputs
base mechanism
Outputs
3. Tree
4. Semantic network
5. Conceptual Graph
6. Production system
7. Frame
• Ontology
50