Unit 2
Unit 2
Unit 2
Player1 65 23
Player2 58 18
Player3 75 24
• Inheritable knowledge
In the inheritable knowledge approach, all data must be stored into a
hierarchy of classes.
All classes should be arranged in a generalized form or a hierarchal
manner
In this approach, we apply inheritance property
Elements inherit values from other members of a class
This approach contains inheritable knowledge which shows a relation
between instance and class, and it is called instance relation.
Every individual frame can represent the collection of attributes and its
value.
In this approach, objects and values are represented in Boxed nodes
Inferential knowledge
Inferential knowledge approach represents knowledge in the form of
formal logics.
This approach can be used to derive more facts.
It guaranteed correctness.
Example: Let's suppose there are two statements:
1.Marcus is a man
2.All men are mortal
Then it can represent as;
Procedural knowledge
Performance measure
• +1000 reward points if the agent comes out of the cave with the gold.
• -1000 points penalty for being eaten by the Wumpus or falling into
the pit.
• -1 for each action, and -10 for using an arrow.
• The game ends if either agent dies or came out of the cave.
Environment:
• Left turn,
• Right turn
• Move forward
• Grab
• Release
• Shoot.
Sensors
The agent will perceive the stench if he is in the room adjacent to the
Wumpus. (Not diagonally).
The agent will perceive breeze if he is in the room directly adjacent to
the Pit.
The agent will perceive the bump if he walks into a wall.
When the Wumpus is shot, it emits a horrible scream which can be
perceived anywhere in the cave
These percepts can be represented as five element list, in which we will
have different indicators for each sensor.
Example if agent perceives stench, breeze, but no glitter, no bump, and
no scream then it can be represented as:
[Stench, Breeze, None, None, None].
The Wumpus world Properties:
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.
It is a Sunday
The sun rises from the west
3+3=7
5 is a prime number
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.
The propositions and connectives are the basic elements of the
propositional logic.
Connectives can be said as a logical operator which connects two
sentences.
A proposition formula which is always true is called tautology, and it is
also called a valid sentence.
A proposition formula which is always false is called Contradiction.
Statements which are questions, commands, or opinions are not
propositions such as "Where is Rohini", "How are you", "What is your
name", are not propositions.
Syntax of propositional logic:
The syntax of propositional logic defines the allowable sentences for
the knowledge representation. 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.
2+2 is 4 it is an atomic proposition and is a true fact
The sun is cold is also a proposition and it is a false fact
Compound proposition: Compound propositions are constructed by
combining simpler or atomic propositions, using parenthesis and logical
connectives.
"It is raining today, and street is wet."
"Ankit is a doctor, and his clinic is in Mumbai."
• Logical Connectives: Logical connectives are used to connect two
simpler propositions or representing a sentence logically. We can
create compound propositions with the help of logical connectives.
There are mainly five connectives, which are given as follows:
• Negation: A sentence such as ¬ P is called negation of P. A literal can
be either Positive literal or negative literal.
• 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.
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.
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
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.
Truth Table:In propositional logic, we need to
know the truth values of propositions in all
possible scenarios. We can combine all the
possible combination with logical
connectives, and the representation of these
combinations in a tabular format is called
Truth table. Following are the truth table for
all logical connectives:
Negation
P Negation P
True False
False True
Conjunction
P Q P conjunction Q
T T T
T F F
F T F
F F F
Disjunction
P Q PVQ
T T T
F T T
T F T
F F F
IMPLICATION
P Q P--→Q
T T T
T F F
F T T
F F T
For Biconditional
P Q P Q
T T T
T F F
F T F
F F T
Rules of Inference in Artificial intelligence
What is Unification?
Unification is a process of making two different logical atomic
expressions identical by finding a substitution. Unification depends on
the substitution process.
It takes two literals as input and makes them identical using
substitution.
Let Ψ1 and Ψ2 be two atomic sentences and 𝜎 be a unifier such that,
Ψ1𝜎 = Ψ2𝜎, then it can be expressed as UNIFY(Ψ1, Ψ2).
Example: Find the MGU for Unify{King(x), King(John)}
Let Ψ1 = King(x), Ψ2 = King(John),
Substitution θ = {John/x} is a unifier for these atoms and applying this
substitution, and both expressions will be identical.
• The UNIFY algorithm is used for unification, which takes two atomic
sentences and returns a unifier for those sentences (If any exist).
• Unification is a key component of all first-order inference algorithms.
• It returns fail if the expressions do not match with each other.
• The substitution variables are called Most General Unifier or MGU.