Ai Unit Ii
Ai Unit Ii
Presentation
Mrs.P.Bhavani, Assistant Professor
Dept of CSE
UNIT II - SYLLABUS
Environment
Square adjacent to the Wumpus are
smelly
Squares adjacent to the pit are
breezy
Glitter iff gold is in the same square
Shooting kills Wumpus if you are
facing it
Shooting uses up the only arrow
Grabbing picks up the gold if in
the same square
Releasing drops the gold in the
same
square
Actuators
Left turn, right
turn, forward, grab, release, shoot
Characterization of Wumpus World
Observable
partial, only local
perception
Deterministic
Yes, outcomes are
specified
Episodic
No,
sequential
at the
level of
actions
Static
An Example
An Example
Logic
• These sentences SYNTAX are expressed according to the syntax of the
representation language, which specifies all the sentences that are well formed.
• The notion of syntax is clear enough in ordinary arithmetic:
• "x + y = 4" is a well-formed sentence
Semantics
• For example, the usual semantics adopted for arithmetic
specifies that the sentence
• "x + y = 4" is true in a world where x is 2 and y is 2, but false
in a world where x is 1 and y is 1.'
Entailment
• In mathematical notation, we write as
2. Dependent Independent
3. It lack to handle Partial It details with Partial information
information
4. No compositionality Good compositionality
5. Difficult to think Easy to think
EXAMPLE
• "Evil King John ruled England in 1200."
• Objects: John, England, 1200;
• Relation: ruled;
• Properties: evil, king.
ONTOLOGICAL COMMITMENT
• Nature of reality
• Special purpose logic makes faster ontological
commitment
TEMPORAL LOGIC
• It assumes that facts hold particular times and
that those times(interval) are ordered
(arranged)
• High order logic
• More expressive than FOL.It allows one to
make assertions about all relations
Epistemological commitments
Syntax and Semantics of FOL
• Syntax – Procedures
• Semantics – Meaning
Model of FOL
Model in propositional logic are just of truth
values i.e 0’s and 1’s
Relations
• Relation is the related set of tuples of objects
Tuple
A tuple is a collection of objects arranged in a
fixed order and written within angle brackets
Model
Contd..
• 5 objects
• 2 binary relations
• 3 unary relations
• 1 unary functions
5 objects
• Richard
• John
• Left leg of Richard
• Left leg of John
• crown
Contd..
2 binary relations
“Brothers” and “on head”
3 Unary relations
Person
King john
crown
Contd..
• 1 unary function
• <richard the lionheart> richard left leg
• <king john> john left leg
• <Richard,john>
Symbols and interpretations
• 3 types of symbols
• Constant symbol – object (john , Richard)
• Predicate symbol – relation(Brother, on
head ,Person,king,crown)
• Function symbol – left leg
Interpretations
• Object
• Relation
• Functions
Other interpretations
Detailed explanation of elements
Terms
A term is a logical expression that refers to an
object.
Atomic Sentences
William is the brother of Richard
Function(object)
Brother(William,richard)
Contd..
• Richard’s Father is married to William's mother
• Married(Father(Richard),Mother(william)
• Complex Sentence
• 7
• ^
• V
• =>
•
Contd..
• Either Richard is king or john is king
• King(Richard) V King(john)
• Richard is not king,so it implies john is king
• 7King(Richard)=>king(john)
Contd..
• X is an integer
Integer(x)
• Caesar was ruler
Ruler(caesar)
• Ravi and Rama are brothers
brothers(Ravi,rama)
• Marcus tried to assassinate caesar
Try to Assassinate (marcus,caesar)
Quantifiers
• Universal quantification ∀
• Existential quantification
• Nested
Contd..
• All man drink coffee
x fn
∀x man(x) ->drink(x,coffee)
Every man respects his parents
∀x man(x)->respects(x,Parents)
Contd..
• Some boys play cricket
∃x boys(x)->play(x, cricket)
• Not all students like both Mathematics and
science
• 7∀xstudent(x)->like(x,mathematics) ^ like(x,science)
Contd..
• Everyone is loyal to someone
∀x ∃y loyal(x,y)
• Everyone loves Everyone
∀X ∀Y loves(X,Y)
• Everyone likes icecream There is none who dislikes
icecream
Equality
7(x,y) x y
Forward chaining
• The Generalized Modus Ponens rule can be used in two ways.
• We can start with the sentences in the knowledge base and
generate new conclusions that in turn can allow more
inferences to be made.
• This is called forward chaining.
• Forward chaining is usually used when a new fact is added to
the database and we want to generate its consequences.
Contd..
• Known facts
• Applying inference rules
• To reach the goal
Contd..
• Given Data
• Tomy barks
• Tomy eats bone
• To prove :Tomy is black
Contd..
• Rules:
• If D barks and D eats bone then D is dog ->1
• If V is cold and V is sweet ,then V is ice cream ->2
• If D is a dog then D is black ->3
• If V is icecream ,then it is vannila ->4
Example 2
• As per the law ,it is crime for an American to
sell weapons to hostile nations vizar,an enemy
of American has some missile and all the
missiles were sold to it by robin,who is an
American.
• Prove “Robin is criminal”
Contd..
1.It is a crime for an American to sell weapon to
hostile weapons
American(x) ^ weapon(y)^sells(x,y,z)^hostile(z) ->criminal(x)
2.Vizar has some missiles
own(A,M)
Missile(M)
Contd..
3.All of the missiles were sold to country vizar by
robin
Missile(M)^owns(A,M) ->sells(Robin,M,A)
4.Enemy of America is known as hostile
Enemy(A,America) ->hostile(A)
Contd..
5.Missiles are weapons
Missile(M) ->weapons(W)
6.Country vizar is an enemy of America
Enemy(A,America)
7.Robin is American
American(Robin)
Forward chaining
criminal(x)
• Humans are best at understanding, reasoning, and interpreting knowledge. Human knows things, which
is knowledge and as per their knowledge they perform various actions in the real world. But how
machines do all these things comes under knowledge representation and reasoning. Hence we can
describe Knowledge representation as following:
• Knowledge representation and reasoning (KR, KRR) is the part of Artificial intelligence which
concerned with AI agents thinking and how thinking contributes to intelligent behavior of agents.
• It is responsible for representing information about the real world so that a computer can understand
and can utilize this knowledge to solve the complex real world problems such as diagnosis a medical
condition or communicating with humans in natural language.
• It is also a way which describes how we can represent knowledge in artificial intelligence. Knowledge
representation is not just storing data into some database, but it also enables an intelligent machine to
learn from that knowledge and experiences so that it can behave intelligently like a human.
CONTD..
• Following are the kind of knowledge which needs to be represented in AI
systems:
• Object: All the facts about objects in our world domain. E.g., Guitars
contains strings, trumpets are brass instruments.
• Events: Events are the actions which occur in our world.
• Performance: It describe behavior which involves knowledge about how
to do things.
• Meta-knowledge: It is knowledge about what we know.
• Facts: Facts are the truths about the real world and what we represent.
• Knowledge-Base: The central component of the knowledge-based agents
is the knowledge base. It is represented as KB.
1.Declarative Knowledge: