You are on page 1of 54

STIN1013

Introduction to Artificial Intelligence

KNOWLEDGE
REPRESENTATION

1
Knowledge

Knowledge,
like love,
is one of those words that
everyone knows the meaning
of, yet finds hard to define.
Like love, knowledge has
many meanings.

Giarratano and Riley (1998)


Knowledge

“Intelligence requires knowledge”


Intelligence refers to the capacity to
acquire and apply knowledge.
Definition

 Knowledge is an understanding which is gained


through
 experience;
 familiarity with the way to do something to
perform a task;
 an accumulation of facts, procedural rules or
heuristics.
Definition
 Knowledge can have many meanings. It is not just
the body of facts and principles accumulated by
human-kind or the act, or state of knowing, but also
the familiarity with languages, concepts,
procedures, rules, ideas, abstractions, places,
customs, facts and associations as well as
information
(Patterson, 1990)
Facts

KNOWLEDGE
Heuristic

Procedural
Rules
Fact

 Facts
 A statement that relates a certain element of
truth about a subject matter or a domain
 Example:
▪ milk is white
▪ the sun rises in the East
and sets in the West
Procedure

 Procedural rules
 A rule that describes a sequence of relations
relative to the domain
 Example:
▪ If the gas gauge shows
quarter-full or less,
then look for a gasoline
station
Heuristic

 Heuristic
 Is a rule of thumb based on years of experience.
 Example:
▪ If a person drives no more
than 5 miles above the
speed limit, then that
person is not likely to be
stopped for speeding.
Priori vs Posteriori
 Priori
 Knowledge which cannot be denied
 Considered to be universally true
 Logic statements, mathematical laws
 e.g. “everybody will die”, “ice is cold”

 Posteriori
 Knowledge derived from the senses, which can be true or false.
 The truth can be denied by sensory experience or on the basis of new
knowledge
Tacit vs Explicit
 Tacit
 Unconscious knowledge that cannot be expressed by language –
spontaneous actions without any significant amount of effort
 Eyes blinking, breathing

 Explicit
 Documented knowledge
Categories of Knowledge
Declarative
(what it is)
Meta
Procedural Knowledge
(how to do) (about other)
Basic Types of
Knowledge

Heuristic Structural
(shortcut) (mental model)
 Procedural
 Knowledge on the process of doing something
 It provides direction on how to do something via rules, strategies,
agendas as well as procedures
 Declarative
 A passive knowledge expressed as statements of facts about the
world
 Meta-knowledge
 Knowledge about knowledge
 Knowledge on knowing which knowledge to use to solve a problem
 Always used by experts to enhance the efficiency of problem solving

 Heuristic
 Knowledge which is gained through experience and translated into
instinct or intuition
 Often displayed individual expertise
Some examples
 Procedural knowledge
 to boil an egg we must do… then…

 Declarative knowledge
 my room no. is 2103

 Meta-knowledge
 if you want to know about heart attack, please read this book

 Heuristic knowledge
 the clouds looks dark and heavy, … heavy rain might fall…

 Structural Knowledge
 a cat has four legs
Hierarchy This is CT’s
phone no.!

Information

Data
+ CT

Knowledge
Hierarchy of Knowledge

Meta
Knowledge
Knowledge
Information
Data
Noise
Source of Knowledge

Not documented
Exp: experience

Documented
Exp: printed &
electronic media
Knowledge Representation

 Knowledge representation is
“a science of translating
actual knowledge into
a format that can be
used by the computer”.
Knowledge Usage

Knowledge
Representation

Knowledge Source
 Why needs to represent knowledge?...

“You are given a project


to develop a system
that can diagnose
heart attack?”

 How can you get information about heart attack?


 How do you understand the knowledge?
 Which knowledge to get into computer?
KR method/technique
Object

Knowledge
Representation
Methods Logic

Rule
 OAV – Object Attribute Value

Color Gold

Object Attribute Value


OAV
 Using fact : “form of
declarative knowledge”
OAV
 Refer to particular properties value of object
 Eg: The ball’s color is red (assign red to the ball’s
color)
 The object can be physical (eg: car, books) or
abstract (eg: love, hobby).
 The value can be numerical, string or Boolean!.
 It could be either single or multi valued from
different attributes and objects.
OAV

Colour Gold

Object Attribute Value

Car Colour Gold


OAV
 Fact :=: “The chair’s color is red and priced at RM
35.00 ”
Color RED

CHAIR

Price RM 35.00

Object Attribute Value


OAV
 Fact :=: “I have a brother named Johnny. The 8
years-old brother likes to play tennis and football.”

gender male
johnny
8 years old

hobby age

tennis football
OAV

 Discussion – Describe about Doraemon


Semantic Network

 Semantic Network

Animals
Semantic Network
 Definition
 method of knowledge representation using a graph made up
of nodes and arcs”

 Graphical view of problem’s important objects,


properties and relationships.
 Nodes represent objects & arcs represent the
relationship.
 Arcs are commonly labeled with terms “IS-A” or
“HAS”
Semantic Network
 FACT : Parrot is a bird. Typically bird has wings and travel by
flying. Bird category falls under animal kingdom. All animal
requires air to breathe. Ostrich is a bird but travels by walking.

Wings
Wings
has

Parrot is-a Bird is-a Air


Parrot Bird Animal
Animal Air
breathe
travel
Fly
Fly
Ostrich
Ostrich
travel
Walk
Walk
Semantic Network

Mammals Walk
Walk
Mammals is-a travel-by

Human
Human
has Twolegs
Two legs
Female
Female
is-a is-a
Male
Male
Mariam
Mariam is-a
System
System
mother-of is-a
Ahmad
Ahmad Analyst
Analyst
travel-by
has
Wheel Degree
Degree
Wheel
chair BIT(Hons)
BIT(Hons)
chair
Frame
 Frame
 Definition :: ”a data
structure for representing
stereotypical knowledge of
some concept or object”
Frame
 An extension version of semantic network – called
“schema” (proposed by Barlett, 1932).
 Basic concept of object oriented programming
(proposed by Minsky, 1975).
 Class frame  general characteristics of some
common objects (Eg: class frame bird refer to
common properties of bird).
 Instance frame  to describe unique characteristic
from class frame (Eg: class “ostrich” from class
frame “bird”)
Frame

 Example
Frame Name: BIRD
Properties:
Color = <unknown>
Frame Name: OSTRICH
Wings = 2
Class Name: BIRD
Flies = True
Properties:

Color = brown/dark
Wings = 2
Flies = False
Frame
Two elements
of frame

Slot Facet
 Is the characteristic  Value for slot
that describe an  Exp: yellow, 1,
object worm,…
 Exp: color, food, no. of
wings, …
Frame

 Example

Frame Name: BIRD


Properties:
Color = <unknown>
Wings = 2
Flies = True

Slot Facet
Rules
 Rule
 Definition :: Rules ”a knowledge structure that
relates some known information to other
information and that can be concluded or inferred
to be known”
Knowledge Representation – Rule

 Is a form of procedural knowledge 


associates given information to some action.
 Structure  connects antecedents
(premises) and consequents (conclusions).
Rules

 Statement “IF”  antecedent and “THEN” 


consequent

IF <antecedent> THEN <consequent>

IF thirsty THEN drink_a_water


Rules
 Example:
 Diagnosing strep throat (knowledge base)

Rule 1:
IF x has a sore throat
AND suspect bacterial infection
THEN patient has strep throat
Rule 2:
IF x temperature is > 37 c
THEN x has a fever
Rule 3:
IF x has been sick > a month
AND x has a fever
THEN suspect bacterial infection
Logic-based Representation

 Logic
Logic-based Representation
 Oldest form of KR in computer
 Concerned with the truthfulness of a chain of
statements
 2 kinds of logic:
 Propositional Logic
 Predicate Calculus
 Implemented in PROLOG (Programming in
Logic) language
Propositional Logic
 E.g.
it_is_raining
kitty_is_outside
kitty_gets_wet
 Elementary propositions or atomic sentences – cannot be
broken down into smaller meaningful units.
 Often represented using symbols, e.g. P, Q, A etc.
Propositional Logic
 Manipulate basic Boolean logic operations (AND,
OR, NOT, IMPLIES, EQUIVALENCE.)
 E.g.:
▪ Normal :“Today is raining, therefore I will miss the
class”
▪ Logic : today_raining  i_will_miss_class

 Combining two or more PL forms compound propositions


(CP) or formulae.

 CP consists of propositions and logical operators.


 Logical operators:

General Name Formal Name Symbols


Not Negation 
And Conjunction 
Or Disjunction 
If… Then/Implies Conditional 
If and only if Biconditional 
 Propositional Logic – Example
 Example 1:
▪ Normal: The sky is blue and windy. It is really great for picnic
▪ Logic: sky_blue  windy  great_for_picnic
 Example 2:
▪ Normal: If the weather is cloudy, then it will be raining. If it is
raining, people will stay at home.
▪ Logic: (weather_cloudy  raining)  (raining 
people_stay_home).
 Example 3:
▪ Normal: I will rather stay if and only if it is raining.
▪ Logic: i_will_stay  raining
 Propositional Logic – Discussion

Question: Transform each of the following statements


into propositional logic:

a) Today is Tuesday and it is a very lovely day.


b) It rained yesterday, therefore I've missed my lecture.
c) All men are mortals.
d) Sintok is a district within Kedah
Propositional Logic

 Nested formulae – important to express the actual meaning


of a wff.
 E.g:
it_is_raining  pussy_is_outside  pussy_gets_wet

(1) (it_is_raining  pussy_is_outside)  pussy_gets_wet

(2) it_is_raining  (pussy_is_outside  pussy_gets_wet)


Propositional Logic
 Order of precedence
 
 
 
 
 
 The above determines the principal operator to split a
formulae into smaller units.
 Purpose: to indicate the actual meaning of a formulae.
Propositional Logic

 Truth table

P Q P PQ PQ PQ PQ


T T F T T T T
T F F F T F F
F T T F T T F
F F T F F T T
Propositional Logic
 Truth table
 Tautology – formula is always T regardless of the truth
values of its propositions.
▪ E.g. (P(PQ))Q
 Contingent – formula is sometimes T and sometimes F,
depending on the truth values of its propositions
▪ E.g. (AB)C
 Inconsistent – formula is always F regardless of the truth
values of its propositions
▪ E.g. P(P)
Propositional Logic

 Limitations:
 Cannot express universality
 Cannot express existential

You might also like