0% found this document useful (0 votes)
9 views19 pages

Chapter 4 !

Uploaded by

Eyachew Tewabe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views19 pages

Chapter 4 !

Uploaded by

Eyachew Tewabe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Chapter 4

Knowledge Representation (KR)

1
Knowledge: What and Why?
• Knowledge includes facts about the real world entities and the
relationship between them
• Knowledge-based Systems (KBSs) are useless without the
ability to represent knowledge.

Why Knowledge is important ?


• We are living in complex environment where there are:
– Many actors, presumers, strong competitors, and high turnover
• It enables to:
–Automate reasoning , Discover new facts, Deduce new facts
that follow from the KB, and Answer users queries
–Make quality decisions - select courses of actions, etc.
• Hence, there is a need to represent knowledge to ease
the development of an intelligent system. 2
Knowledge-based Agent (KBA)
• Agents can be seen as knowing about their world, and
reasoning about their possible courses of action.
• KBA begins with some knowledge of the world and of its
actions.
– It uses logical reasoning to maintain a description of the
world as new percepts arrive
– Learn new facts/knowledge that are inferred and
unseen by current percepts
– Deduce a course of actions that will achieve its goals

• One can also design an autonomous agent that


– learns from experience and construct knowledge with less
3
human interventions
Knowledge engineering (KE)
• KE is the process of building a knowledge base through
extracting the knowledge from the human expert.
• Knowledge engineering is the process of
–Extracting the knowledge from the human expert.
–Choose knowledge representation formalism
–Choose reasoning and problem solving strategy.
• A knowledge engineer is someone who investigates a
particular domain, determines what concepts are important in
that domain, and creates a formal representation of the objects
and relations in the domain.
–A KE has to decide what objects and relations are worth
representing, and which relations hold among which objects

Knowledge Knowledge
acquisition Representation Knowledge
(Extract knowledge (choose KR Method & Base
of Human Expert) reasoning strategy)
4
The two main tasks of KE
•Knowledge acquisition: The knowledge engineer interview the
real human experts to be educated about the domain and to
elicit the required knowledge, in a process called knowledge
acquisition
•Knowledge Representation techniques such as logic are a
powerful tool for KR and reasoning. However, such techniques
consists of only the syntax, semantics and proof theory.
–KR techniques do not offer any guidance as to what facts should be
expressed, nor what vocabulary should be used to express them
•Knowledge base is used to store a set of facts and rules about
the domain expressed in a suitable representation language
–Each individual representation are called sentences
–Sentences are expressed in a (formal) knowledge representation
(KR) language 5
Knowledge Representation & Reasoning
•Knowledge Representation (KR): express knowledge
explicitly in a computer-tractable way such that the agent
can reason out.
•Parts of KR language:
–Syntax of a language: describes the possible configuration to form
sentences. E.g.: if x & y denote numbers, then x > y is a sentence
about numbers
–Semantics: determines the facts in the world to which the sentences
refer. E.g.: x > y is false when y is greater than x and true otherwise
•Reasoning: is the process of constructing new sentences
from existing facts in the KB.
–Proper reasoning ensures that the new configuration represent facts
that actually follow from the facts in the KB.
6
Logic as KR
•A Logic is a formal language in which knowledge can be
represented such that conclusions can easily be drawn.
–It is a declarative language to assert sentences and deduce
from sentences.
•Components of a formal logic include syntax, semantics,
reasoning and inference mechanism.
–Syntax: what expressions/structures are allowed in the
language. Describes how to make sentences
E.g. mycar (red) is ok, but mycar(grey or green) is not.
–Semantics: express what sentences mean, in terms of a
mapping to real world.
•The meaning of a sentence is not intrinsic to that sentence. Semantics
relate sentences to reality.
•E.g. mycar (red) means that my car is red.
–Proof Theory: It is a means of carrying our reasoning using a
set of rules. It helps to draw new conclusions from existing
7
statements in the logic.
Propositional logic
•A simple language useful for showing key ideas and
definitions
•Syntax: PL allows facts about the world to be represented
as sentences formed from:
 Logical constants: True, False
 Proposition symbols (P, Q, R, …) are used to represent
facts about the world: e.g.: P = "It is hot“, Q = "It is humid“, R
= "It is raining“
 Logical connectives: not (), and (), or (), implies (), is
equivalent, if and only if ().
 Precedence order from highest to lowest is: , ,,, 
e.g. The sentence P v Q  R  S is equivalent to
[(P) v (Q  R)]  S
 Parenthesis ( ): Used for grouping sentences and to specify
order of precedence 8
Propositional logic (PL) sentences
•A sentence is made by linking prepositional symbols
together using logical connectives.
– There are atomic and complex sentences.
– Atomic sentences consist of propositional symbol (e.g. P, Q,
TRUE, FALSE)
– Complex sentences are combined by using connectives or
parenthesis:
– while S and T are atomic sentences, S  T, (S  T), (S  T),
(S  T), and (S  T) are complex sentences.

Examples: Given the following sentences about the


“weather problem” convert them into PL sentences:
• “It is humid.”: Q
• “If it is humid, then it is hot” : Q  P
• “If it is hot and humid, then it is raining”: (P  Q)  R9
Example
Convert the following English sentences to Propositional
logic. Let:
A = Lectures are active
R = Text is readable
P = Kebede will pass the exam
• the lectures are not active: A
• the lectures are active and the text is readable: A  R
• either the lectures are active or the text is readable: A V R
• if the lectures are active, then the text is not readable:
AR
• the lectures are active if and only if the text is readable:
AR
• if the lectures are active, then if the text is not readable,
Kebede will not pass the exam: A  (R  P ) 10
Terminology
•Valid sentence: A sentence is valid sentence or
tautology if and only if it is True under all possible
interpretations in all possible worlds.
Example: “It’s raining or it’s not raining.” (R  R).
•Satisfiable: A sentence is satisfiable if and only if there
is some interpretations in some world for which the
sentence is True.
Example: “It is raining or it is humid”. R v Q, R
•Unsatisfiable: A sentence is unsatisfiable (inconsistent
sentence or self- contradiction) if and only if it is not
satisfiable, i.e. a sentence that is False under all
interpretations. The world is never like what it describes.
Example: “It’s raining and it's not raining.” R  R
11
Terminology
•Entailment: mirrors the relation of one fact
following from another.
– New sentences are generated that are
necessarily true, given that the old sentences are
true.
– KB entails α (KB |= α) if and only if the
conclusion α is true in every logically possible
worlds in which all the premises in KB are true.
•Derivation:
–KB |- Q, Q is derived from KB if there is a proof
consisting of a sequence of valid inference
steps starting from the premises in KB and
resulting in Q
12
Logical equivalence
•Two sentences are logically equivalent iff they are true in same models

pνq≡qνp Commutativity of disjunction


pΛq≡qΛp Commutativity of conjunction
(p Λ q) Λ r ≡ p Λ (q Λ r) Associativity of conjunction
(p ν q) ν r ≡ p ν (q ν r) Associativity of disjunction
( ( p) ≡ p Double Negation elimination
pq≡qp contraposition
pq≡pνq implication elimination
(p ν q) ≡ ( p Λ q) De-Morgan
(p Λ q) ≡ ( p ν  q) De-Morgan
(p  q) ≡ (p q) Λ (q  p) Biconditional elimination
p Λ (q ν r) ≡ (p Λ q) ν (p Λ r) Distributive of Λ over ν
13
p ν (q Λ r) ≡ (p ν q) Λ (p ν r) Distributive of ν over Λ
Example
• Example 1: Given the following facts and rules that
relates facts; What can we say about the weather
condition?
– It is humid:
– If it is humid, then it is hot :
– If it is hot and humid, then it is raining:
1. Q Premise
2. Q  P Premise
3. (P  Q)  R Premise
4. P using Modes Ponens (1 & 2)
5. P  Q using AND introduction (1 & 4)
6. R using Modes Ponens (3 & 5)

• Example 2: Is the following statements valid? Proof.


A  B  C
BC 14
First Order Logic
• First-Order Logic (FOL) is expressive enough to
concisely represent any kind of situation that are
expressed in natural language.
–FOL represents objects and relations between
objects, variables, and quantifiers in addition to
propositions
Every elephant is gray:
 x (elephant(x) → gray(x))

There is a white alligator:


 x (alligator(X) ^ white(X))

15
Syntax of FOL
• Constants symbol
–names (like Jonas, Kebede, …), numbers (like 1, 2, … n), ...
• Predicates:
–Predicates used to relate one object with another. E.g.
brother, >,...
• Functions: Returns value (Sqrt, mother-of,...)
• Variables: x, y, a, b,...
–Important to increase generalization capability of KB
• Connectives:
–retains connectives used in PL (, , , , )
• Quantifiers:
–Quantifiers specify whether all or some objects satisfy
properties or relations between objects
–Two standard quantifiers: Universal ( for all, for every) and
Existential ( there exists, some)
16
Universal quantification
• Universal Quantifiers: makes statements about every object
<variables> <sentence>
–Everyone at AAU is smart:
x At(x,AAU)  Smart(x)
–All cats are mammals:
x cat(x)  mammal(x)

• x sentence P is true iff P is true with x being each possible


object in the given universe
–The above statement is equivalent to the conjunction
At(Jonas, AAU)  Smart(Jonas) 
At(Rawad, AAU)  Smart(Rawad) 
...
• A common mistake to avoid
–Typically,  is the main connective with 
–Common mistake: the use of  as the main connective with :
x At(x,AAU)  Smart(x) is true if “Everyone is at AAU & everyone is
17
smart”
Existential quantification
•Makes statements about some objects in the universe
<variables> <sentence>
–Someone at AAU is smart:
x At(x,AAU)  Smart(x)
–Spot has a sister who is a cat:
x sister(spot,x)  cat(x)
•x sentence P is true iff P is true with x being some
possible objects
–The above statement is equivalent to the disjunction
At(Jonas, AAU)  Smart(Jonas) 
At(Alemu, AAU)  Smart(Alemu) 
…..
•Common mistake to avoid
–Typically,  is the main connective with 
–Common mistake: using  as the main connective with :
18
x At(x,AAU)  Smart(x) is true if there is anyone who is not at AAU
Nested quantifiers
•x,y parent(x,y)  child(y,x)
–for all x and y, if x is the parent of y then y is the child of x.
•x y Loves(x,y)
–There is a person who loves everyone in the given world
•y x Loves(x,y)
–Everyone in the given universe is loved by at least one person
Properties of quantifiers
–x y is the same as y x
–x y is the same as y x
–x y is not the same as y x
•Quantifier duality: each can be expressed using the other,
using negation ()
x Likes(x,icecream) x Likes(x,icecream)
– Everyone likes ice cream means that there is nobody who dislikes ice
cream
x Likes(x,cake) x Likes(x,cake)
–There is someone who likes cake means that there is no one who
dislikes cake 19

You might also like