Unit 2:: Knowledge Representation

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 19

Established as per the Section 2(f) of the UGC Act, 1956

Approved by AICTE, COA and BCI, New Delhi

Unit 2:
Knowledge Representation:
School of Computer Science and Engineering

Prof. Nikhil
OUTLINE
Recap of previous Lecture
Topic for the Lecture
Objective and Outcome of Lecture
Lecture Discussion
Using Predicate Logic

Representing Simple Facts in Logic


Knowledge Representation
To p i c o f t h e L e c t u r e
Knowledge Representation
Objective and Outcome of Lecture
OBJECTIVE AND OUTCOME OF
LECTURE

Lecture
Objective Illustrate knowledge representation issues and methods

Lecture
Represent knowledge using logic and apply reasoning methods
Outcome
REPRESENTING Simple FACTS IN
LOGIC
USING PREDICATE LOGIC
Logic Logic is concerned with the truth of statements about the world.
Generally each statement is either TRUE or FALSE.
Logic includes :
Syntax , Semantics and Inference Procedure.
◊ Syntax : Specifies the symbols in the language about how they can be combined to
form sentences. The facts about the world are represented as sentences in logic.
◊ Semantic : Specifies how to assign a truth value to a sentence based on its meaning in
the world. It Specifies what facts a sentence refers to. A fact is a claim about the
world, and it may be TRUE or FALSE.
◊ Inference Procedure : Specifies methods for computing new sentences from the
existing sentences
REPRESENTING SIMPLE FACTS IN LOGIC
Using propositional logic –Real-world facts are represented as logical propositions
written as well-formed formulas (wff’s)
Example 1:
It is raining.
RAINING

It is sunny.
SUNNY

It is Windy.
WINDY
If it is raining, then it is not sunny.
RAINING  ¬SUNNY
REPRESENTING SIMPLE FACTS IN LOGIC
– Example 2:
Suppose we want to represent the obvious fact stated by the classical sentence.
Socrates is a man.
We could write:
SOCRATESMAN
Plato is a man.
PLATOMAN
Which would be a totally separate assertion, it would be much better to represent these
facts as:
MAN(SOCRATES)
MAN(PLATO)
All men are mortal.
MORTALMAN
• To explore the use of predicate logic as a way of representing knowledge by
looking at a specific
• example.
• The above two statements becomes totally separate assertion, we would not be able to
draw any conclusions about similarities between Socrates and Plato.

• A better representation of these facts:


Consider example :
 “All men are mortal.
 Socrates is a man.
 Then Socrates is mortal” ,
These cannot be expressed in propositional logic as a finite and logically valid argument
(formula).
 We need languages : that allow us to describe properties (predicates) of objects, or a
relationship among objects represented by the variables .
Predicate logic satisfies the requirements of a language.
− Predicate logic is powerful enough for expression and reasoning.
− Predicate logic is built upon the ideas of propositional logic
Consider the following example that shows the use of predicate logic as a way of
representing knowledge.
1. Marcus was a man.
2. Marcus was a Pompeian.
3. All Pompeians were Romans.
4. Caesar was a ruler.
5. Also, All Pompeians were either loyal to Caesar or hated him.
6. Everyone is loyal to someone.
7. People only try to assassinate rulers they are not loyal to.
8. Marcus tried to assassinate Caesar.
The facts described by these sentences can be represented as a set of well-formed
formulas (wffs) as follows:
1. Marcus was a man.
man(Marcus)
2. Marcus was a Pompeian.
Pompeian(Marcus)
3. All Pompeians were Romans.
∀x: Pompeian(x) → Roman(x)
4. Caesar was a ruler.
ruler(Caesar)
All Pompeians were either loyal to Caesar or hated him.
Inclusive-or
∀x: Roman(x) → loyalto(x, Caesar) ∨ hate(x, Caesar)

Exclusive-or
∀x: Roman(x) → (loyalto(x, Caesar) ∧¬ hate(x, Caesar)) ∨
(¬loyalto(x, Caesar) ∧ hate(x, Caesar))
6. Everyone is loyal to someone.
∀x: ∃y: loyalto(x, y)

7. People only try to assassinate rulers they are not loyal to.
∀x: ∀y: person(x) ∧ ruler(y) ∧ tryassassinate(x, y) →¬loyalto(x, y)

8. Marcus tried to assassinate Caesar.


tryassassinate(Marcus, Caesar)
• Now suppose if we want to use these statements to answer the question: Was Marcus
loyal to Caesar?

• Also, Now let’s try to produce a formal proof, reasoning backward from the desired
goal: ¬Loyalto(Marcus, Caesar)

• In order to prove the goal, we need to use the rules of inference to transform it into
another goal (or possibly a set of goals) that can, in turn, transformed, and so on,
until there are no unsatisfied goals remaining.
An attempt to prove ¬loyalto(Marcus, Caesar).

The problem is that, although we know that Marcus was a man, we do not have any way
to conclude from that that Marcus was a person.

Also, We need to add the representation of another fact to our system, namely:

∀ man(x) → person(x)
Now we can satisfy the last goal and produce a proof that Marcus was not loyal to
Caesar.

You might also like