KNOWLEDGE
REPRESENTATION
Dr. Abbas Fadhil M. A. AL-Juboori
Computer Science Dept. – Kerbala
University
[email protected]
[email protected]
1
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)
“Intelligence requires knowledge”
Intelligence refers to the capacity to
acquire and apply knowledge.

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.

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
Heuristic
KNOWLEDGE
Procedural
Rules

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

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
 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
 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
 Unconscious knowledge that cannot be expressed by language –
spontaneous actions without any significant amount of effort
 Eyes blinking, breathing

Explicit
 Documented knowledge
Declarative
(what is it)
Meta
Knowledge
(about other)
Procedural
(how to do)
Basic Types of
Knowledge
Heuristic
(shortcut)
Structural
(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

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
This is CT’s
phone no.!
Information
Data
+ CT
Knowledge
Meta
Knowledge
Knowledge
Information
Data
Noise
Not documented
Exp: experience
Documented
Exp: printed &
electronic media

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?
Object
Knowledge
Representation
Methods
Rule
Logic

OAV – Object Attribute Value
Color
Object
Attribute
Gold
Value

Using fact : “form of
declarative knowledge”

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.
Object
Car
Colour
Gold
Attribute
Value
Colour
Gold

Fact :=: “The chair’s color is red and priced at ID
35.000 ”
Color
RED
Price
ID 35.000
Attribute
Value
CHAIR
Object

Fact :=: “I have a brother named Johnny. The 8
years-old brother likes to play tennis and football.”
gender
male
johnny
hobby
tennis
age
football
8 years old

Discussion – Describe about Doraemon

Semantic Network
Animals

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”

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.
has
Parrot
is-a
Wings
is-a
Bird
travel
Fly
Ostrich
travel
Walk
Animal
breathe
Air
Mammals
is-a
Human
is-a
Female
Walk
travel-by
has
Two legs
is-a
Male
is-a
Mariam
mother-of
travel-by
is-a
Ahmad
has
Wheel
chair
System
Analyst
Degree
BIT(Hons)

Frame
 Definition :: ”a data
structure for representing
stereotypical knowledge of
some concept or object”
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”)


Example
Frame Name: BIRD
Properties:
Color = <unknown>
Wings = 2
Flies = True
Frame Name: OSTRICH
Class Name: BIRD
Properties:
Color = brown/dark
Wings = 2
Flies = False
Two elements
of frame
Slot
 Is the characteristic
that describe an
object
 Exp: color, food, no. of
wings, …
Facet
 Value for slot
 Exp: yellow, 1,
worm,…

Example
Frame Name: BIRD
Properties:
Color = <unknown>
Wings = 2
Flies = True
Slot Facet

Rule
 Definition :: Rules ”a knowledge structure that
relates some known information to other
information and that can be concluded or inferred
to be known”


Is a form of procedural knowledge 
associates given information to some action.
Structure

connects
antecedents
(premises) and consequents (conclusions).

Statement “IF”  antecedent and “THEN” 
consequent
IF <antecedent> THEN <consequent>
IF thirsty THEN drink_a_water

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



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

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.

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 Sunday and it is a very lovely day.
b) It rained yesterday, therefore I've missed my lecture.
c) All men are mortals.
d) Fraiha is a district within Kerbala.

Nested formulae – important to express the actual meaning.

E.g:
it_is_raining  kitty_is_outside  kitty_gets_wet
(1) (it_is_raining  kitty_is_outside)  kitty_gets_wet
(2) it_is_raining  (kitty_is_outside  kitty_gets_wet)
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.
 E.g.:
 PPQQ
 ABCPQR


Truth table – a common method to prove the
truth value of any statement written in PL.
P
Q P
T
T
F
F
T
F
T
F
F
F
T
T
PQ
PQ
T
F
F
F
T
T
T
F
PQ PQ
T
F
T
T
T
F
F
T

Truth table – determines the category of formula
 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)

Limitation
 Cannot express universality of objects
▪ E.g.
▪ “all computers have processor”; “all birds fly”.
 Cannot express existence / inexistence / partial
quantity of objects
▪ E.g.
▪ “there are some birds which cannot fly”
▪ “none of us is immortal”

Also known as First Order Predicate Logic (FOPL).

This method overcomes the limitations of
propositional logic through use of quantifiers and
variables.

Main structure
 argument (i.e. variables and/or constants) is
linked by operator (i.e. functor).

A predicate
functor(argument1, argument2)

A predicate consists of functor and zero or more arguments
 Functor (or predicate name) relates the arguments
 Argument can be variables or constant
▪ Variables
▪ A symbol in capital letter or a word begins with upper
case letter
▪ Represent general classes of objects or properties
▪ E.g.:
teach(X,Y)
X and Y can be substituted with any value/constant
such as:
‘dave’ and ‘comp5346’,
resulting in:
teach(dave,comp5346)
▪ Constant
▪ A symbol or string of letters begins with lower case
letter
▪ Represent specific classes of objects or properties
▪ E.g.:
 ‘dave’ and ‘comp5436’ are constants
 ‘dAVe’ and ‘coMP5436’ are also valid constants
 What about ‘Dave’ and ‘COMP5436’? Are they the
valid constants? Why?

Basic idea
functor(variable_1, variable_2, ….)
▪ E.g.
▪ “she likes chocolate”
likes(she, chocolate)
▪ “tweety is a bird”
isa(tweety,bird) OR
bird(tweety)

Universal quantifier (X)
  means ‘for all’
 Indicates the expression is T (i.e. true) for ALL values of
designated variables
 E.g.: X likes(X,icecream)
▪ For all values of X, the statement ‘X likes ice cream’ is true
 E.g.:
▪ “all birds fly” is represented as X (bird(X)  flies(X))
▪ This also means “no birds do not fly”, thus it can also be
represented as X flies(X).

Existential quantifier (X)
  means ‘there exist’.
 Indicates the expression is T (i.e. true) for SOME values
of designated variables (at least one value exists that
makes the statement T)
 E.g.: “some children like ice cream”
▪ Is represented as:
▪ X likes(X,icecream) OR Children likes(Children,icecream)
▪ Can also be represented as X likes(X,icecream) …. As the
statement also means ‘not all children like ice cream’.
 E.g.: “some birds do not fly”
▪ is represented as X (bird(X)  flies(X))

E.g. 1:



E.g. 2:



Normal: All volleyball players are tall
FOPL: “X (volleyball_player (X)  tall (X))”
E.g. 3:



Normal: If it doesn’t rain today, Ahmad will go to the beach
FOPL: “rain(today) go(Ahmad, beach)”
Normal: Some people like apple.
FOPL: “X (person(X)  likes(X, apple))”
E.g. 4:


Normal: Nobody likes war
FOPL: “ X  likes (X, war)” OR “X likes(X,war)”
Descargar

TN2063: Machine Learning