2. 2
What is KR?
R. Davis, H. Schrobe, P. Szolovits (1993):
1. A replacement
2. A fragmentary theory of intelligent reasoning
3. A medium for efficient computation
4. A medium of human expressions
3. 3
Representation and Mapping
• Facts: truth in real world. These are the things we
want to represent.
• Representations of facts: These are the things we
can manipulate.
4. Representation and Mapping
Knowledge Level:
Which Facts are described(Include Each Agent Behaviors and
Current goal)
Symbol Level:
Knowledge are defined in terms of symbols that can be
manipulated by program
4
5. 5
Mapping between Facts and
Representation
Facts
Internal
Representations
English
Representations
reasoning
programs
English
understanding
English
generation
Maps from Facts to Representation
Representation to Facts
6. 6
Representation and Mapping
doted Line=> Abstract reasoning to process that the program planned to model
Solid Line=> actual reasoning to the perform particular program
In order to Solve a complex problem one need both Large amount
of memory and some mechanism.
That Knowledge is to create solution to new problem
Initial
facts
Internal
representations
of initial facts
desired real reasoning
forward
representation
mapping
Final
facts
Internal
representations
of final facts
backward
representation
mapping
operation
of program
8. 8
Representation and Mapping
• Spot is a dog
dog(Spot)
• Every dog has a tail
x: dog(x) hastail(x)
hastail(Spot)
Spot has a tail
9. 9
Representation and Mapping
• Fact-representation mapping is not one-to-one, rather
than many to many
• Good representation can make a thinking program
small.
10. 10
Representation and Mapping
The Multilated Checkerboard Problem
“Consider a normal checker board from which two
squares, in opposite corners, have been removed.
The task is to cover all the remaining squares exactly
with donimoes, each of which covers two squares. No
overlapping, either of dominoes on top of each other or
of dominoes over the boundary of the multilated board
are allowed.
Can this task be done?”
12. 12
Representation and Mapping
Good system for the representation of Knowledge in
particular domain should follow 4 Properties:
• Representational adequacy: Ability to represent all kind of
knowledge that are needed in that domain.
• Relative to adequacy: Ability to manipulate the representation to
derive new structure from old.
• Relative to efficiency: Additional information (Ability to incorporate into
knowledge structure)
• Acquisition efficiency: Ability to acquire new information easily( to
control itself)
13. ISSUES IN KNOWLEDGE
REPRESENTATION
• Issues that arises while KR techniques:
1. Important Attributes
2. Relationships among Attributes.
3. Choosing the granularity of Representation.
4. Representing Sets of Objects.
5. Finding the Right structures as Needed
• Instance(India is a instance of country)
• Is a( Child Hospital is subclass of Hospital)
13
22. 22
Propositional logic in Artificial
intelligence
Propositional logic (PL) is the simplest form of logic where
all the statements are made by propositions.
A proposition is a declarative statement which is either true
or false.
It is a technique of knowledge representation in logical and
mathematical form.
Example:
1.a) It is Sunday.
2.b) The Sun rises from West (False proposition)
3.c) 3+3= 7(False proposition)
4.d) 5 is a prime number.
23. 23
Following are some basic facts about propositional logic
• Propositional logic is also called Boolean logic as it works on 0 and 1.
• In propositional logic, we use symbolic variables to represent the logic, and
we can use any symbol for a representing a proposition, such A, B, C, P, Q, R,
etc.
• Propositions can be either true or false, but it cannot be both.
• Propositional logic consists of an object, relations or function, and logical
connectives.
• These connectives are also called logical operators.
Syntax of propositional logic:
There are two types of Propositions:
1.Atomic Propositions
2.Compound propositions
•Atomic Proposition: Atomic propositions are the simple propositions. It consists
of a single proposition symbol. These are the sentences which must be either true or
false.
24. 24
1.a) 2+2 is 4, it is an atomic proposition as it is a true fact.
2.b) "The Sun is cold" is also a proposition as it is a false fact.
•Compound proposition: Compound propositions are constructed by combining
simpler or atomic propositions, using parenthesis and logical connectives.
Example:
1.a) "It is raining today, and street is wet."
2.b) "Ankit is a doctor, and his clinic is in Mumbai."
Logical Connectives:
There are mainly five connectives, which are given as follows:
1.Negation: A sentence such as ¬ P is called negation of P. A literal can be either
Positive literal or negative literal.
25. 25
1.Conjunction: A sentence which has ∧ connective such as, P ∧ Q is called a conjunction.
Example: Rohan is intelligent and hardworking. It can be written as,
P= Rohan is intelligent,
Q= Rohan is hardworking. → P∧ Q.
2.Disjunction: A sentence which has ∨ connective, such as P ∨ Q. is called disjunction,
where P and Q are the propositions.
Example: "Ritika is a doctor or Engineer",
Here P= Ritika is Doctor. Q= Ritika is Doctor, so we can write it as P ∨ Q.
3.Implication: A sentence such as P → Q, is called an implication. Implications are also
known as if-then rules. It can be represented as
If it is raining, then the street is wet.
Let P= It is raining, and Q= Street is wet, so it is represented as P → Q
4.Biconditional: A sentence such as P⇔ Q is a Biconditional sentence, example If I am
breathing, then I am alive
P= I am breathing, Q= I am alive, it can be represented as P ⇔ Q.
29. 29
First-Order Logic in Artificial intelligence
• In the topic of Propositional logic, we have seen that how to represent
statements using propositional logic.
• But unfortunately, in propositional logic, we can only represent the facts, which
are either true or false.
• PL is not sufficient to represent the complex sentences or natural language
statements.
• The propositional logic has very limited expressive power.
• Consider the following sentence, which we cannot represent using PL logic.
•"Some humans are intelligent", or
•"Sachin likes cricket."
First-Order logic:
•First-order logic is another way of knowledge representation in artificial
intelligence. It is an extension to propositional logic.
•FOL is sufficiently expressive to represent the natural language statements in a
concise way.
•First-order logic is also known as Predicate logic or First-order predicate logic.
•As a natural language, first-order logic also has two main parts:
• Syntax
• Semantics
30. 30
Basic Elements of First-order logic:
Atomic sentences:
•Atomic sentences are the most basic sentences of first-order logic. These sentences are
formed from a predicate symbol followed by a parenthesis with a sequence of terms.
•We can represent atomic sentences as Predicate (term1, term2, ......, term n).
Example: Ravi and Ajay are brothers: => Brothers(Ravi, Ajay).
Chinky is a cat: => cat (Chinky).
Complex Sentences:
•Complex sentences are made by combining atomic sentences using connectives.
First-order logic statements can be divided into two parts:
•Subject: Subject is the main part of the statement.
•Predicate: A predicate can be defined as a relation, which binds two atoms together in a
statement.
31. 31
Consider the statement: "x is an integer.", it consists of
two parts, the first part x is the subject of the statement and
second part "is an integer," is known as a predicate.
Quantifiers in First-order logic:
1.Universal Quantifier, (for all, everyone, everything)
2.Existential quantifier, (for some, at least one).
If x is a variable, then ∀x is read as:
•For all x
•For each x
•For every x.
All man drink coffee.
∀x man(x) → drink (x, coffee).
32. 32
Existential Quantifier:
It is denoted by the logical operator ∃, which resembles as inverted E. When it is
used with a predicate variable then it is called as an existential quantifier.
In Existential quantifier we always use AND or Conjunction symbol (∧).
If x is a variable, then existential quantifier will be ∃x or ∃(x). And it will be
read as:
•There exists a 'x.'
•For some 'x.'
•For at least one 'x.'
Some Examples of FOL using quantifier:
1. All birds fly.
In this question the predicate is "fly(bird)."
And since there are all birds who fly so it will be represented as follows.
∀x bird(x) →fly(x).
33. 33
2. Every man respects his parent.
In this question, the predicate is "respect(x, y)," where x=man, and y= parent.
Since there is every man so will use ∀, and it will be represented as follows:
∀x man(x) → respects (x, parent).
3. Some boys play cricket.
In this question, the predicate is "play(x, y)," where x= boys, and y= game. Since there are
some boys so we will use ∃, and it will be represented as:
∃x boys(x) → play(x, cricket).
4. Not all students like both Mathematics and Science.
In this question, the predicate is "like(x, y)," where x= student, and y= subject.
Since there are not all students, so we will use ∀ with negation, so following
representation for this:
¬∀ (x) [ student(x) → like(x, Mathematics) ∧ like(x, Science)].
5. Only one student failed in Mathematics.
In this question, the predicate is "failed(x, y)," where x= student, and y= subject.
Since there is only one student who failed in Mathematics, so we will use following
representation for this:
∃(x) [ student(x) → failed (x, Mathematics) ∧∀ (y) [¬(x==y) ∧ student(y) →
¬failed (x, Mathematics)].