SlideShare una empresa de Scribd logo
1 de 49
Rushdi Shams, Dept of CSE, KUET, Bangladesh 1
Knowledge RepresentationKnowledge Representation
First Order LogicFirst Order Logic
Artificial IntelligenceArtificial Intelligence
Version 2.0Version 2.0
There are 10 types of people in this world- who understand binaryThere are 10 types of people in this world- who understand binary
and who do not understand binaryand who do not understand binary
Rushdi Shams, Dept of CSE, KUET, Bangladesh 2
Introduction
Propositional logic is declarative
Propositional logic allows partial/disjunctive/negated
information
(unlike most data structures and databases)
Meaning in propositional logic is context-independent
(unlike natural language, where meaning depends on context)
Propositional logic has very limited expressive power
(unlike natural language)
E.g., cannot say “if any student sits an exam they either pass or
fail”.
Propositional logic is compositional
(meaning of B ^ P is derived from meaning of B and of P)
Rushdi Shams, Dept of CSE, KUET, Bangladesh 3
Introduction
You see that we can convert the sentences into
propositional logic but it is difficult
Thus, we will use the foundation of propositional
logic and build a more expressive logic
Rushdi Shams, Dept of CSE, KUET, Bangladesh 4
Introduction
Whereas propositional logic assumes the world
contains facts,
first-order logic (like natural language) assumes the
world contains
Objects: people, houses, numbers, colors, baseball
games, wars, …
Relations: red, round, prime, brother of, bigger than,
part of, comes between, …
Functions: father of, best friend, one more than, plus, …
Rushdi Shams, Dept of CSE, KUET, Bangladesh 5
Syntax of FOL: Basic Elements
Constants KingJohn, 2, NUS,...
Predicates Brother, >,...
Functions Sqrt, LeftLegOf,...
Variables x, y, a, b,...
Connectives ¬, ⇒, ∧, ∨, ⇔
Equality =
Quantifiers ∀, ∃
Rushdi Shams, Dept of CSE, KUET, Bangladesh 6
Examples
King John and Richard the Lion heart are
brothers
Brother(KingJohn,RichardTheLionheart)
The length of left leg of Richard is greater than
the length of left leg of King John
> (Length(LeftLegOf(Richard)),
Length(LeftLegOf(KingJohn)))
Rushdi Shams, Dept of CSE, KUET, Bangladesh 7
Atomic Sentences
Rushdi Shams, Dept of CSE, KUET, Bangladesh 8
Atomic Sentences
Rushdi Shams, Dept of CSE, KUET, Bangladesh 9
Complex Sentences
Complex sentences are made from atomic sentences using
connectives:
¬S, S1∧ S2, S1∨ S2, S1⇒ S2, S1⇔S2,
Example
Sibling(KingJohn,Richard) ⇒ Sibling(Richard,KingJohn)
Rushdi Shams, Dept of CSE, KUET, Bangladesh 10
Complex Sentences
Rushdi Shams, Dept of CSE, KUET, Bangladesh 11
FOL illustrated
 Five objects-
1. Richard the Lionheart
2. Evil King John
3. Left leg of Richard
4. Left leg of John
5. The crown
Rushdi Shams, Dept of CSE, KUET, Bangladesh 12
FOL illustrated
 Objects are related with
Relations
 For example, King John and
Richard are related with
Brother relationship
 This relationship can be
denoted by
(Richard,John),(John,Richard)
Rushdi Shams, Dept of CSE, KUET, Bangladesh 13
FOL illustrated
 Again, the crown and King
John are related with
OnHead Relationship-
OnHead (Crown,John)
 Brother and OnHead are
binary relations as they
relate couple of objects.
Rushdi Shams, Dept of CSE, KUET, Bangladesh 14
FOL illustrated
 Properties are relations that
are unary.
 In this case, Person can be
such property acting upon
both Richard and John
Person (Richard)
Person (John)
 Again, king can be acted
only upon John
King (John)
Rushdi Shams, Dept of CSE, KUET, Bangladesh 15
FOL illustrated
 Certain relationships are
best performed when
expressed as functions.
 Means one object is related
with exactly one object.
Richard -> Richard’s left leg
John -> John’s left leg
Rushdi Shams, Dept of CSE, KUET, Bangladesh 16
Universal quantification
∀<variables> <sentence>
∀x P(x)
Translated into the English language, the expression is understood
as:
 "For all x, P(x) holds",
 "for each x, P(x) holds" or
 “for every x, P(x) holds"
"All cars have wheels" could be transformed into the
propositional form, ∀x P(x)
 P(x) is the predicate denoting: x has wheels, and
 the universe of discourse is only populated by cars.
Rushdi Shams, Dept of CSE, KUET, Bangladesh 17
Universal quantification
If all the elements in the universe of discourse can
be listed then the universal quantification ∀x P(x)
is equivalent to the conjunction:
P(x1)∧ P(x2)∧ P(x3) ∧   ...  ∧ P(xn) .
For example, in the above example of ∀x P(x), if
we knew that there were only 4 cars in our
universe of discourse (c1, c2, c3 and c4) then we
could also translate the statement as:
P(c1) ∧  P(c2) ∧  P(c3)  ∧ P(c4)
Rushdi Shams, Dept of CSE, KUET, Bangladesh 18
Universal quantification
 Remember, we had five
objects, let us replace them
with a variable x-
1. x ―›Richard the Lionheart
2. x ―› Evil King John
3. x ―› Left leg of Richard
4. x ―› Left leg of John
5. x ―› The crown
Rushdi Shams, Dept of CSE, KUET, Bangladesh 19
Universal quantification
 Now, for the quantified
sentence
∀x King (x) ⇒ Person (x)
Richard is king ⇒ Richard is Person
John is king ⇒ John is person
Richard’s left leg is king ⇒ Richard’s
left leg is person
John’s left leg is king ⇒ John’s left leg
is person
The crown is king ⇒ the crown is
person
Rushdi Shams, Dept of CSE, KUET, Bangladesh 20
Universal quantification
Richard is king ⇒ Richard is
Person
John is king ⇒ John is person
Richard’s left leg is king ⇒
Richard’s left leg is person
John’s left leg is king ⇒ John’s left
leg is person
The crown is king ⇒ the crown is
person
Only the second 
sentence is correct, 
the rest is incorrect
Rushdi Shams, Dept of CSE, KUET, Bangladesh 21
Existential quantification
∃ <variables> <sentence>
∃ x P(x)
Translated into the English language, the expression is understood
as:
"There exists an x such that P(x)"
"There is at least one x such that P(x)"
"Someone loves you" could be transformed into the
propositional form, ∃ x P(x)
P(x) is the predicate meaning: x loves you,
The universe of discourse contains (but is not limited
to) all living creatures.
Rushdi Shams, Dept of CSE, KUET, Bangladesh 22
Existential quantification
If all the elements in the universe of discourse can
be listed, then the existential quantification ∃ x
P(x) is equivalent to the disjunction:
P(x1)∨ P(x2) ∨  P(x3) ∨  ...   ∨  P(xn) .
For example, in the above example of ∃ x P(x), if
we knew that there were only 5 living creatures in
our universe of discourse (say: me, he, she, rex and
fluff), then we could also write the statement as:
P(me) ∨  P(he) ∨   P(she) ∨  P(rex) ∨  P(fluff)
Order of application of quantifiers
When more than one variables are quantified in a wff
such as   ∃ y  ∀ x P( x, y ), they are applied from the
inside, that is, the one closest to the atomic formula is
applied first.
Thus  ∃ y  ∀ x P( x, y ) reads ∃ y  [∀ x P( x, y )], and
we say "there exists a y such that for every x, P( x, 
y ) holds" or "for some y, P( x, y ) holds for every x".
Rushdi Shams, Dept of CSE, KUET, Bangladesh 23
Order of application of quantifiers
The positions of the same type of quantifiers can be
switched without affecting the truth value as long as
there are no quantifiers of the other type between the
ones to be interchanged.
For example   ∃ x  ∃  y   ∃ z P(x, y , z) is equivalent to  
∃ y  ∃  x  ∃  z P(x, y , z),   ∃ z  ∃  y   ∃ x P(x, y , z),
etc.
It is the same for the universal quantifier.
Rushdi Shams, Dept of CSE, KUET, Bangladesh 24
Order of application of quantifiers
However, the positions of different types of
quantifiers can not be switched.
For example ∃ x   ∀ y P( x, y ) is not equivalent to   ∃
y  ∀ x P( x, y ).
Rushdi Shams, Dept of CSE, KUET, Bangladesh 25
Rushdi Shams, Dept of CSE, KUET, Bangladesh 26
Order of application of quantifiers
∀ x ∃ y x < y
“for every number x, there is a number y that is greater than x ”
∃ y ∀ x x < y
“there is a number that is greater than every (any) number ”
Rushdi Shams, Dept of CSE, KUET, Bangladesh 27
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
Rushdi Shams, Dept of CSE, KUET, Bangladesh 28
Properties of quantifiers
Quantifier duality: each can be expressed using the other
∀x Likes(x,IceCream) is equivalent to
¬∃x ¬Likes(x,IceCream)
∃x Likes(x,Broccoli) is equivalent to
¬∀x ¬Likes(x,Broccoli)
Rushdi Shams, Dept of CSE, KUET, Bangladesh 29
Properties of quantifiers
 Equivalences-
1. ∃x P is equivalent to ¬∀x ¬P
2. ¬∃x ¬P is equivalent to ∀x P
3. ∃x ¬P is equivalent to ¬∀x P
4. ¬∃x P is equivalent to ∀x ¬P
Rushdi Shams, Dept of CSE, KUET, Bangladesh 30
Rushdi Shams, Dept of CSE, KUET, Bangladesh 31
Example knowledge base
The law says that it is a crime for an
American to sell weapons to hostile nations.
The country Nono, an enemy of America,
has some missiles, and all of its missiles
were sold to it by Colonel West, who is
American.
Prove that Col. West is a criminal
Rushdi Shams, Dept of CSE, KUET, Bangladesh 32
Example knowledge base
... it is a crime for an American to sell weapons to hostile nations:
American(x) ∧ Weapon(y) ∧ Sells(x,y,z) ∧ Hostile(z) ⇒ Criminal(x)
Nono … has some missiles,
Owns(Nono,x)
Missile(x)
… all of its missiles were sold to it by Colonel West
Missile(x) ∧ Owns(Nono,x) ⇒ Sells(West,x,Nono)
Missiles are weapons:
Missile(x) ⇒ Weapon(x)
An enemy of America counts as "hostile“:
Enemy(x,America) ⇒ Hostile(x)
West, who is American …
American(West)
The country Nono, an enemy of America …
Enemy(Nono,America)
Rushdi Shams, Dept of CSE, KUET, Bangladesh 33
Forward Chaining
American(x) ∧ Weapon(y) ∧ Sells(x,y,z) ∧ Hostile(z) ⇒
Criminal(x)
Owns(Nono,x)
Missile(x)
Missile(x) ∧ Owns(Nono,x) ⇒ Sells(West,x,Nono)
Missile(x) ⇒ Weapon(x)
Enemy(x,America) ⇒ Hostile(x)
American(West)
Enemy(Nono,America)
Rushdi Shams, Dept of CSE, KUET, Bangladesh 34
Forward Chaining
American(x) ∧ Weapon(y) ∧ Sells(x,y,z) ∧ Hostile(z) ⇒
Criminal(x)
Owns(Nono,x)
Missile(x)
Missile(x) ∧ Owns(Nono,x) ⇒ Sells(West,x,Nono)
Missile(x) ⇒ Weapon(x)
Enemy(x,America) ⇒ Hostile(x)
American(West)
Enemy(Nono,America)
Rushdi Shams, Dept of CSE, KUET, Bangladesh 35
Forward Chaining
American(West) ∧ Weapon(y) ∧ Sells(x,y,z) ∧ Hostile(z)
⇒ Criminal(x)
Owns(Nono,x)
Missile(x)
Missile(x) ∧ Owns(Nono,x) ⇒ Sells(West,x,Nono)
Missile(x) ⇒ Weapon(x)
Enemy(x,America) ⇒ Hostile(x)
American(West)
Enemy(Nono,America)
Rushdi Shams, Dept of CSE, KUET, Bangladesh 36
Forward Chaining
American(West) ∧ Weapon(y) ∧ Sells(West,y,z) ∧
Hostile(z) ⇒ Criminal(x)
Owns(Nono,x)
Missile(x)
Missile(x) ∧ Owns(Nono,x) ⇒ Sells(West,x,Nono)
Missile(x) ⇒ Weapon(x)
Enemy(x,America) ⇒ Hostile(x)
American(West)
Enemy(Nono,America)
Rushdi Shams, Dept of CSE, KUET, Bangladesh 37
Forward Chaining
American(West) ∧ Weapon(y) ∧ Sells(West,y,z) ∧
Hostile(z) ⇒ Criminal(x)
Owns(Nono,x)
Missile(x)
Missile(x) ∧ Owns(Nono,x) ⇒ Sells(West,x,Nono)
Missile(x) ⇒ Weapon(x)
Enemy(x,America) ⇒ Hostile(x)
American(West)
Enemy(Nono,America)
Rushdi Shams, Dept of CSE, KUET, Bangladesh 38
Forward Chaining
American(West) ∧ Weapon(y) ∧ Sells(West,y,z) ∧
Hostile(z) ⇒ Criminal(x)
Owns(Nono,x)
Missile(x)
Missile(x) ∧ Owns(Nono,x) ⇒ Sells(West,x,Nono)
Missile(x) ⇒ Weapon(x)
Enemy(Nono,America) ⇒ Hostile(x)
American(West)
Enemy(Nono,America)
Rushdi Shams, Dept of CSE, KUET, Bangladesh 39
Forward Chaining
American(West) ∧ Weapon(y) ∧ Sells(West,y,z) ∧
Hostile(z) ⇒ Criminal(x)
Owns(Nono,x)
Missile(x)
Missile(x) ∧ Owns(Nono,x) ⇒ Sells(West,x,Nono)
Missile(x) ⇒ Weapon(x)
Enemy(Nono,America) ⇒ Hostile(Nono)
American(West)
Enemy(Nono,America)
Rushdi Shams, Dept of CSE, KUET, Bangladesh 40
Forward Chaining
American(West) ∧ Weapon(y) ∧ Sells(West,y,z) ∧
Hostile(Nono) ⇒ Criminal(x)
Owns(Nono,x)
Missile(x)
Missile(x) ∧ Owns(Nono,x) ⇒ Sells(West,x,Nono)
Missile(x) ⇒ Weapon(x)
Enemy(Nono,America) ⇒ Hostile(Nono)
American(West)
Enemy(Nono,America)
Rushdi Shams, Dept of CSE, KUET, Bangladesh 41
Backward Chaining
American(West) ∧ Weapon(y) ∧ Sells(West,y,z) ∧
Hostile(Nono) ⇒ Criminal(x)
Owns(Nono,x)
Missile(x)
Missile(x) ∧ Owns(Nono,x) ⇒ Sells(West,x,Nono)
Missile(x) ⇒ Weapon(x)
Enemy(Nono,America) ⇒ Hostile(Nono)
American(West)
Enemy(Nono,America)
Rushdi Shams, Dept of CSE, KUET, Bangladesh 42
Backward Chaining
American(West) ∧ Weapon(y) ∧ Sells(West,y,z) ∧
Hostile(Nono) ⇒ Criminal(x)
Owns(Nono,x)
Missile(x)
Missile(x) ∧ Owns(Nono,x) ⇒ Sells(West,x,Nono)
Missile(x) ⇒ Weapon(x)
Enemy(Nono,America) ⇒ Hostile(Nono)
American(West)
Enemy(Nono,America)
Rushdi Shams, Dept of CSE, KUET, Bangladesh 43
Backward Chaining
American(West) ∧ Weapon(y) ∧ Sells(West,y,z) ∧
Hostile(Nono) ⇒ Criminal(x)
Owns(Nono,x)
Missile(x)
Missile(x) ∧ Owns(Nono,x) ⇒ Sells(West,x,Nono)
Missile(x) ⇒ Weapon(x)
Enemy(Nono,America) ⇒ Hostile(Nono)
American(West)
Enemy(Nono,America)
Rushdi Shams, Dept of CSE, KUET, Bangladesh 44
Backward Chaining
American(West) ∧ Weapon(y) ∧ Sells(West,y,z) ∧
Hostile(Nono) ⇒ Criminal(x)
Owns(Nono,x)
Missile(x)
Missile(x) ∧ Owns(Nono,x) ⇒Sells(West,x,Nono)
Missile(x) ⇒ Weapon(x)
Enemy(Nono,America) ⇒ Hostile(Nono)
American(West)
Enemy(Nono,America)
Rushdi Shams, Dept of CSE, KUET, Bangladesh 45
Backward Chaining
American(West) ∧ Weapon(y) ∧ Sells(West,y,z) ∧
Hostile(Nono) ⇒ Criminal(x)
Owns(Nono,x)
Missile(x)
Missile(x) ∧ Owns(Nono,x) ⇒Sells(West,x,Nono)
Missile(x) ⇒ Weapon(x)
Enemy(Nono,America) ⇒ Hostile(Nono)
American(West)
Enemy(Nono,America)
Rushdi Shams, Dept of CSE, KUET, Bangladesh 46
Backward Chaining
American(West) ∧ Weapon(y) ∧ Sells(West,y,Nono) ∧
Hostile(Nono) ⇒ Criminal(x)
Owns(Nono,x)
Missile(x)
Missile(x) ∧ Owns(Nono,x) ⇒Sells(West,x,Nono)
Missile(x) ⇒ Weapon(x)
Enemy(Nono,America) ⇒ Hostile(Nono)
American(West)
Enemy(Nono,America)
Rushdi Shams, Dept of CSE, KUET, Bangladesh 47
Backward Chaining
American(West) ∧ Weapon(y) ∧ Sells(West,y,Nono) ∧
Hostile(Nono) ⇒ Criminal(x)
Owns(Nono,x)
Missile(x)
Missile(x) ∧ Owns(Nono,x) ⇒Sells(West,x,Nono)
Missile(x) ⇒ Weapon(x)
Enemy(Nono,America) ⇒ Hostile(Nono)
American(West)
Enemy(Nono,America)
Rushdi Shams, Dept of CSE, KUET, Bangladesh 48
…& the Inference
American(West) ∧ Weapon(y) ∧ Sells(West,y,Nono) ∧
Hostile(Nono) ⇒ Criminal(West)
Owns(Nono,x)
Missile(x)
Missile(x) ∧ Owns(Nono,x) ⇒Sells(West,x,Nono)
Missile(x) ⇒ Weapon(x)
Enemy(Nono,America) ⇒ Hostile(Nono)
American(West)
Enemy(Nono,America)
Rushdi Shams, Dept of CSE, KUET, Bangladesh 49
References
Artificial Intelligence: A Modern Approach (2nd
Edition)
by Russell and Norvig Chapter 8
http://www.cs.odu.edu/~toida/nerzic/content/logic/pred_

Más contenido relacionado

La actualidad más candente

Knowledge representation in AI
Knowledge representation in AIKnowledge representation in AI
Knowledge representation in AI
Vishal Singh
 

La actualidad más candente (20)

Unification and Lifting
Unification and LiftingUnification and Lifting
Unification and Lifting
 
Knowledge representation In Artificial Intelligence
Knowledge representation In Artificial IntelligenceKnowledge representation In Artificial Intelligence
Knowledge representation In Artificial Intelligence
 
Predicate logic
 Predicate logic Predicate logic
Predicate logic
 
Artificial Intelligence - Reasoning in Uncertain Situations
Artificial Intelligence - Reasoning in Uncertain SituationsArtificial Intelligence - Reasoning in Uncertain Situations
Artificial Intelligence - Reasoning in Uncertain Situations
 
Inference in First-Order Logic
Inference in First-Order Logic Inference in First-Order Logic
Inference in First-Order Logic
 
Problem solving agents
Problem solving agentsProblem solving agents
Problem solving agents
 
A* Algorithm
A* AlgorithmA* Algorithm
A* Algorithm
 
Problem Formulation in Artificial Inteligence Projects
Problem Formulation in Artificial Inteligence ProjectsProblem Formulation in Artificial Inteligence Projects
Problem Formulation in Artificial Inteligence Projects
 
Artificial Intelligence Searching Techniques
Artificial Intelligence Searching TechniquesArtificial Intelligence Searching Techniques
Artificial Intelligence Searching Techniques
 
Artificial Intelligence Notes Unit 2
Artificial Intelligence Notes Unit 2Artificial Intelligence Notes Unit 2
Artificial Intelligence Notes Unit 2
 
Knowledge representation in AI
Knowledge representation in AIKnowledge representation in AI
Knowledge representation in AI
 
Ai quantifiers
Ai quantifiersAi quantifiers
Ai quantifiers
 
Introduction Artificial Intelligence a modern approach by Russel and Norvig 1
Introduction Artificial Intelligence a modern approach by Russel and Norvig 1Introduction Artificial Intelligence a modern approach by Russel and Norvig 1
Introduction Artificial Intelligence a modern approach by Russel and Norvig 1
 
Knowledge Representation in Artificial intelligence
Knowledge Representation in Artificial intelligence Knowledge Representation in Artificial intelligence
Knowledge Representation in Artificial intelligence
 
Reasoning in AI
Reasoning in AIReasoning in AI
Reasoning in AI
 
AI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction ProblemAI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction Problem
 
Planning
PlanningPlanning
Planning
 
Uncertain Knowledge and Reasoning in Artificial Intelligence
Uncertain Knowledge and Reasoning in Artificial IntelligenceUncertain Knowledge and Reasoning in Artificial Intelligence
Uncertain Knowledge and Reasoning in Artificial Intelligence
 
Fuzzy rules and fuzzy reasoning
Fuzzy rules and fuzzy reasoningFuzzy rules and fuzzy reasoning
Fuzzy rules and fuzzy reasoning
 
First order logic
First order logicFirst order logic
First order logic
 

Destacado

Propositional And First-Order Logic
Propositional And First-Order LogicPropositional And First-Order Logic
Propositional And First-Order Logic
ankush_kumar
 
Propositional logic & inference
Propositional logic & inferencePropositional logic & inference
Propositional logic & inference
Slideshare
 
Translating English to Propositional Logic
Translating English to Propositional LogicTranslating English to Propositional Logic
Translating English to Propositional Logic
Janet Stemwedel
 
Logic Notes
Logic NotesLogic Notes
Logic Notes
acavis
 
Class first order logic
Class first order logicClass first order logic
Class first order logic
chandsek666
 
Lec 02. C Program Structure / C Memory Concept
Lec 02. C Program Structure / C Memory ConceptLec 02. C Program Structure / C Memory Concept
Lec 02. C Program Structure / C Memory Concept
Rushdi Shams
 
Lec 24. Dynamic Memory Allocation
Lec 24. Dynamic Memory AllocationLec 24. Dynamic Memory Allocation
Lec 24. Dynamic Memory Allocation
Rushdi Shams
 

Destacado (20)

Propositional And First-Order Logic
Propositional And First-Order LogicPropositional And First-Order Logic
Propositional And First-Order Logic
 
Predicate Logic
Predicate LogicPredicate Logic
Predicate Logic
 
Propositional logic & inference
Propositional logic & inferencePropositional logic & inference
Propositional logic & inference
 
Translating English to Propositional Logic
Translating English to Propositional LogicTranslating English to Propositional Logic
Translating English to Propositional Logic
 
Syntax and semantics of propositional logic
Syntax and semantics of propositional logicSyntax and semantics of propositional logic
Syntax and semantics of propositional logic
 
Jarrar: First Order Logic
Jarrar: First Order LogicJarrar: First Order Logic
Jarrar: First Order Logic
 
Logic Notes
Logic NotesLogic Notes
Logic Notes
 
First order logic in knowledge representation
First order logic in knowledge representationFirst order logic in knowledge representation
First order logic in knowledge representation
 
03 - Predicate logic
03 - Predicate logic03 - Predicate logic
03 - Predicate logic
 
Discrete Math Lecture 02: First Order Logic
Discrete Math Lecture 02: First Order LogicDiscrete Math Lecture 02: First Order Logic
Discrete Math Lecture 02: First Order Logic
 
Logic Ppt
Logic PptLogic Ppt
Logic Ppt
 
Class first order logic
Class first order logicClass first order logic
Class first order logic
 
Propositional logic
Propositional logicPropositional logic
Propositional logic
 
Logic
LogicLogic
Logic
 
LOGIC: Ideas & Terms
LOGIC: Ideas & TermsLOGIC: Ideas & Terms
LOGIC: Ideas & Terms
 
Logic.ppt.
Logic.ppt.Logic.ppt.
Logic.ppt.
 
AI: Logic in AI
AI: Logic in AIAI: Logic in AI
AI: Logic in AI
 
Lec 02. C Program Structure / C Memory Concept
Lec 02. C Program Structure / C Memory ConceptLec 02. C Program Structure / C Memory Concept
Lec 02. C Program Structure / C Memory Concept
 
Lec 18. Recursion
Lec 18. RecursionLec 18. Recursion
Lec 18. Recursion
 
Lec 24. Dynamic Memory Allocation
Lec 24. Dynamic Memory AllocationLec 24. Dynamic Memory Allocation
Lec 24. Dynamic Memory Allocation
 

Similar a First order logic (9)

Knowledge representation
Knowledge representationKnowledge representation
Knowledge representation
 
Logic 2
Logic 2Logic 2
Logic 2
 
Predicate_Logic.pdf
Predicate_Logic.pdfPredicate_Logic.pdf
Predicate_Logic.pdf
 
Unit 1 quantifiers
Unit 1  quantifiersUnit 1  quantifiers
Unit 1 quantifiers
 
Chapter 01 - p2.pdf
Chapter 01 - p2.pdfChapter 01 - p2.pdf
Chapter 01 - p2.pdf
 
Quantification
QuantificationQuantification
Quantification
 
PredicateLogic (1).ppt
PredicateLogic (1).pptPredicateLogic (1).ppt
PredicateLogic (1).ppt
 
PredicateLogic.pptx
PredicateLogic.pptxPredicateLogic.pptx
PredicateLogic.pptx
 
SMPLmeanings.pptx
SMPLmeanings.pptxSMPLmeanings.pptx
SMPLmeanings.pptx
 

Más de Rushdi Shams

Types of machine translation
Types of machine translationTypes of machine translation
Types of machine translation
Rushdi Shams
 
L1 l2 l3 introduction to machine translation
L1 l2 l3  introduction to machine translationL1 l2 l3  introduction to machine translation
L1 l2 l3 introduction to machine translation
Rushdi Shams
 
Syntax and semantics
Syntax and semanticsSyntax and semantics
Syntax and semantics
Rushdi Shams
 
Probabilistic logic
Probabilistic logicProbabilistic logic
Probabilistic logic
Rushdi Shams
 
Knowledge structure
Knowledge structureKnowledge structure
Knowledge structure
Rushdi Shams
 
L5 understanding hacking
L5  understanding hackingL5  understanding hacking
L5 understanding hacking
Rushdi Shams
 
L2 Intrusion Detection System (IDS)
L2  Intrusion Detection System (IDS)L2  Intrusion Detection System (IDS)
L2 Intrusion Detection System (IDS)
Rushdi Shams
 
L2 l3 l4 software process models
L2 l3 l4  software process modelsL2 l3 l4  software process models
L2 l3 l4 software process models
Rushdi Shams
 
L1 overview of software engineering
L1  overview of software engineeringL1  overview of software engineering
L1 overview of software engineering
Rushdi Shams
 
L13 why software fails
L13  why software failsL13  why software fails
L13 why software fails
Rushdi Shams
 

Más de Rushdi Shams (20)

Research Methodology and Tips on Better Research
Research Methodology and Tips on Better ResearchResearch Methodology and Tips on Better Research
Research Methodology and Tips on Better Research
 
Common evaluation measures in NLP and IR
Common evaluation measures in NLP and IRCommon evaluation measures in NLP and IR
Common evaluation measures in NLP and IR
 
Machine learning with nlp 101
Machine learning with nlp 101Machine learning with nlp 101
Machine learning with nlp 101
 
Semi-supervised classification for natural language processing
Semi-supervised classification for natural language processingSemi-supervised classification for natural language processing
Semi-supervised classification for natural language processing
 
Natural Language Processing: Parsing
Natural Language Processing: ParsingNatural Language Processing: Parsing
Natural Language Processing: Parsing
 
Types of machine translation
Types of machine translationTypes of machine translation
Types of machine translation
 
L1 l2 l3 introduction to machine translation
L1 l2 l3  introduction to machine translationL1 l2 l3  introduction to machine translation
L1 l2 l3 introduction to machine translation
 
Syntax and semantics
Syntax and semanticsSyntax and semantics
Syntax and semantics
 
Probabilistic logic
Probabilistic logicProbabilistic logic
Probabilistic logic
 
L15 fuzzy logic
L15  fuzzy logicL15  fuzzy logic
L15 fuzzy logic
 
Knowledge structure
Knowledge structureKnowledge structure
Knowledge structure
 
Belief function
Belief functionBelief function
Belief function
 
L5 understanding hacking
L5  understanding hackingL5  understanding hacking
L5 understanding hacking
 
L4 vpn
L4  vpnL4  vpn
L4 vpn
 
L3 defense
L3  defenseL3  defense
L3 defense
 
L2 Intrusion Detection System (IDS)
L2  Intrusion Detection System (IDS)L2  Intrusion Detection System (IDS)
L2 Intrusion Detection System (IDS)
 
L1 phishing
L1  phishingL1  phishing
L1 phishing
 
L2 l3 l4 software process models
L2 l3 l4  software process modelsL2 l3 l4  software process models
L2 l3 l4 software process models
 
L1 overview of software engineering
L1  overview of software engineeringL1  overview of software engineering
L1 overview of software engineering
 
L13 why software fails
L13  why software failsL13  why software fails
L13 why software fails
 

Último

Último (20)

Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 

First order logic

  • 1. Rushdi Shams, Dept of CSE, KUET, Bangladesh 1 Knowledge RepresentationKnowledge Representation First Order LogicFirst Order Logic Artificial IntelligenceArtificial Intelligence Version 2.0Version 2.0 There are 10 types of people in this world- who understand binaryThere are 10 types of people in this world- who understand binary and who do not understand binaryand who do not understand binary
  • 2. Rushdi Shams, Dept of CSE, KUET, Bangladesh 2 Introduction Propositional logic is declarative Propositional logic allows partial/disjunctive/negated information (unlike most data structures and databases) Meaning in propositional logic is context-independent (unlike natural language, where meaning depends on context) Propositional logic has very limited expressive power (unlike natural language) E.g., cannot say “if any student sits an exam they either pass or fail”. Propositional logic is compositional (meaning of B ^ P is derived from meaning of B and of P)
  • 3. Rushdi Shams, Dept of CSE, KUET, Bangladesh 3 Introduction You see that we can convert the sentences into propositional logic but it is difficult Thus, we will use the foundation of propositional logic and build a more expressive logic
  • 4. Rushdi Shams, Dept of CSE, KUET, Bangladesh 4 Introduction Whereas propositional logic assumes the world contains facts, first-order logic (like natural language) assumes the world contains Objects: people, houses, numbers, colors, baseball games, wars, … Relations: red, round, prime, brother of, bigger than, part of, comes between, … Functions: father of, best friend, one more than, plus, …
  • 5. Rushdi Shams, Dept of CSE, KUET, Bangladesh 5 Syntax of FOL: Basic Elements Constants KingJohn, 2, NUS,... Predicates Brother, >,... Functions Sqrt, LeftLegOf,... Variables x, y, a, b,... Connectives ¬, ⇒, ∧, ∨, ⇔ Equality = Quantifiers ∀, ∃
  • 6. Rushdi Shams, Dept of CSE, KUET, Bangladesh 6 Examples King John and Richard the Lion heart are brothers Brother(KingJohn,RichardTheLionheart) The length of left leg of Richard is greater than the length of left leg of King John > (Length(LeftLegOf(Richard)), Length(LeftLegOf(KingJohn)))
  • 7. Rushdi Shams, Dept of CSE, KUET, Bangladesh 7 Atomic Sentences
  • 8. Rushdi Shams, Dept of CSE, KUET, Bangladesh 8 Atomic Sentences
  • 9. Rushdi Shams, Dept of CSE, KUET, Bangladesh 9 Complex Sentences Complex sentences are made from atomic sentences using connectives: ¬S, S1∧ S2, S1∨ S2, S1⇒ S2, S1⇔S2, Example Sibling(KingJohn,Richard) ⇒ Sibling(Richard,KingJohn)
  • 10. Rushdi Shams, Dept of CSE, KUET, Bangladesh 10 Complex Sentences
  • 11. Rushdi Shams, Dept of CSE, KUET, Bangladesh 11 FOL illustrated  Five objects- 1. Richard the Lionheart 2. Evil King John 3. Left leg of Richard 4. Left leg of John 5. The crown
  • 12. Rushdi Shams, Dept of CSE, KUET, Bangladesh 12 FOL illustrated  Objects are related with Relations  For example, King John and Richard are related with Brother relationship  This relationship can be denoted by (Richard,John),(John,Richard)
  • 13. Rushdi Shams, Dept of CSE, KUET, Bangladesh 13 FOL illustrated  Again, the crown and King John are related with OnHead Relationship- OnHead (Crown,John)  Brother and OnHead are binary relations as they relate couple of objects.
  • 14. Rushdi Shams, Dept of CSE, KUET, Bangladesh 14 FOL illustrated  Properties are relations that are unary.  In this case, Person can be such property acting upon both Richard and John Person (Richard) Person (John)  Again, king can be acted only upon John King (John)
  • 15. Rushdi Shams, Dept of CSE, KUET, Bangladesh 15 FOL illustrated  Certain relationships are best performed when expressed as functions.  Means one object is related with exactly one object. Richard -> Richard’s left leg John -> John’s left leg
  • 16. Rushdi Shams, Dept of CSE, KUET, Bangladesh 16 Universal quantification ∀<variables> <sentence> ∀x P(x) Translated into the English language, the expression is understood as:  "For all x, P(x) holds",  "for each x, P(x) holds" or  “for every x, P(x) holds" "All cars have wheels" could be transformed into the propositional form, ∀x P(x)  P(x) is the predicate denoting: x has wheels, and  the universe of discourse is only populated by cars.
  • 17. Rushdi Shams, Dept of CSE, KUET, Bangladesh 17 Universal quantification If all the elements in the universe of discourse can be listed then the universal quantification ∀x P(x) is equivalent to the conjunction: P(x1)∧ P(x2)∧ P(x3) ∧   ...  ∧ P(xn) . For example, in the above example of ∀x P(x), if we knew that there were only 4 cars in our universe of discourse (c1, c2, c3 and c4) then we could also translate the statement as: P(c1) ∧  P(c2) ∧  P(c3)  ∧ P(c4)
  • 18. Rushdi Shams, Dept of CSE, KUET, Bangladesh 18 Universal quantification  Remember, we had five objects, let us replace them with a variable x- 1. x ―›Richard the Lionheart 2. x ―› Evil King John 3. x ―› Left leg of Richard 4. x ―› Left leg of John 5. x ―› The crown
  • 19. Rushdi Shams, Dept of CSE, KUET, Bangladesh 19 Universal quantification  Now, for the quantified sentence ∀x King (x) ⇒ Person (x) Richard is king ⇒ Richard is Person John is king ⇒ John is person Richard’s left leg is king ⇒ Richard’s left leg is person John’s left leg is king ⇒ John’s left leg is person The crown is king ⇒ the crown is person
  • 20. Rushdi Shams, Dept of CSE, KUET, Bangladesh 20 Universal quantification Richard is king ⇒ Richard is Person John is king ⇒ John is person Richard’s left leg is king ⇒ Richard’s left leg is person John’s left leg is king ⇒ John’s left leg is person The crown is king ⇒ the crown is person Only the second  sentence is correct,  the rest is incorrect
  • 21. Rushdi Shams, Dept of CSE, KUET, Bangladesh 21 Existential quantification ∃ <variables> <sentence> ∃ x P(x) Translated into the English language, the expression is understood as: "There exists an x such that P(x)" "There is at least one x such that P(x)" "Someone loves you" could be transformed into the propositional form, ∃ x P(x) P(x) is the predicate meaning: x loves you, The universe of discourse contains (but is not limited to) all living creatures.
  • 22. Rushdi Shams, Dept of CSE, KUET, Bangladesh 22 Existential quantification If all the elements in the universe of discourse can be listed, then the existential quantification ∃ x P(x) is equivalent to the disjunction: P(x1)∨ P(x2) ∨  P(x3) ∨  ...   ∨  P(xn) . For example, in the above example of ∃ x P(x), if we knew that there were only 5 living creatures in our universe of discourse (say: me, he, she, rex and fluff), then we could also write the statement as: P(me) ∨  P(he) ∨   P(she) ∨  P(rex) ∨  P(fluff)
  • 23. Order of application of quantifiers When more than one variables are quantified in a wff such as   ∃ y  ∀ x P( x, y ), they are applied from the inside, that is, the one closest to the atomic formula is applied first. Thus  ∃ y  ∀ x P( x, y ) reads ∃ y  [∀ x P( x, y )], and we say "there exists a y such that for every x, P( x,  y ) holds" or "for some y, P( x, y ) holds for every x". Rushdi Shams, Dept of CSE, KUET, Bangladesh 23
  • 24. Order of application of quantifiers The positions of the same type of quantifiers can be switched without affecting the truth value as long as there are no quantifiers of the other type between the ones to be interchanged. For example   ∃ x  ∃  y   ∃ z P(x, y , z) is equivalent to   ∃ y  ∃  x  ∃  z P(x, y , z),   ∃ z  ∃  y   ∃ x P(x, y , z), etc. It is the same for the universal quantifier. Rushdi Shams, Dept of CSE, KUET, Bangladesh 24
  • 25. Order of application of quantifiers However, the positions of different types of quantifiers can not be switched. For example ∃ x   ∀ y P( x, y ) is not equivalent to   ∃ y  ∀ x P( x, y ). Rushdi Shams, Dept of CSE, KUET, Bangladesh 25
  • 26. Rushdi Shams, Dept of CSE, KUET, Bangladesh 26 Order of application of quantifiers ∀ x ∃ y x < y “for every number x, there is a number y that is greater than x ” ∃ y ∀ x x < y “there is a number that is greater than every (any) number ”
  • 27. Rushdi Shams, Dept of CSE, KUET, Bangladesh 27 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
  • 28. Rushdi Shams, Dept of CSE, KUET, Bangladesh 28 Properties of quantifiers Quantifier duality: each can be expressed using the other ∀x Likes(x,IceCream) is equivalent to ¬∃x ¬Likes(x,IceCream) ∃x Likes(x,Broccoli) is equivalent to ¬∀x ¬Likes(x,Broccoli)
  • 29. Rushdi Shams, Dept of CSE, KUET, Bangladesh 29 Properties of quantifiers  Equivalences- 1. ∃x P is equivalent to ¬∀x ¬P 2. ¬∃x ¬P is equivalent to ∀x P 3. ∃x ¬P is equivalent to ¬∀x P 4. ¬∃x P is equivalent to ∀x ¬P
  • 30. Rushdi Shams, Dept of CSE, KUET, Bangladesh 30
  • 31. Rushdi Shams, Dept of CSE, KUET, Bangladesh 31 Example knowledge base The law says that it is a crime for an American to sell weapons to hostile nations. The country Nono, an enemy of America, has some missiles, and all of its missiles were sold to it by Colonel West, who is American. Prove that Col. West is a criminal
  • 32. Rushdi Shams, Dept of CSE, KUET, Bangladesh 32 Example knowledge base ... it is a crime for an American to sell weapons to hostile nations: American(x) ∧ Weapon(y) ∧ Sells(x,y,z) ∧ Hostile(z) ⇒ Criminal(x) Nono … has some missiles, Owns(Nono,x) Missile(x) … all of its missiles were sold to it by Colonel West Missile(x) ∧ Owns(Nono,x) ⇒ Sells(West,x,Nono) Missiles are weapons: Missile(x) ⇒ Weapon(x) An enemy of America counts as "hostile“: Enemy(x,America) ⇒ Hostile(x) West, who is American … American(West) The country Nono, an enemy of America … Enemy(Nono,America)
  • 33. Rushdi Shams, Dept of CSE, KUET, Bangladesh 33 Forward Chaining American(x) ∧ Weapon(y) ∧ Sells(x,y,z) ∧ Hostile(z) ⇒ Criminal(x) Owns(Nono,x) Missile(x) Missile(x) ∧ Owns(Nono,x) ⇒ Sells(West,x,Nono) Missile(x) ⇒ Weapon(x) Enemy(x,America) ⇒ Hostile(x) American(West) Enemy(Nono,America)
  • 34. Rushdi Shams, Dept of CSE, KUET, Bangladesh 34 Forward Chaining American(x) ∧ Weapon(y) ∧ Sells(x,y,z) ∧ Hostile(z) ⇒ Criminal(x) Owns(Nono,x) Missile(x) Missile(x) ∧ Owns(Nono,x) ⇒ Sells(West,x,Nono) Missile(x) ⇒ Weapon(x) Enemy(x,America) ⇒ Hostile(x) American(West) Enemy(Nono,America)
  • 35. Rushdi Shams, Dept of CSE, KUET, Bangladesh 35 Forward Chaining American(West) ∧ Weapon(y) ∧ Sells(x,y,z) ∧ Hostile(z) ⇒ Criminal(x) Owns(Nono,x) Missile(x) Missile(x) ∧ Owns(Nono,x) ⇒ Sells(West,x,Nono) Missile(x) ⇒ Weapon(x) Enemy(x,America) ⇒ Hostile(x) American(West) Enemy(Nono,America)
  • 36. Rushdi Shams, Dept of CSE, KUET, Bangladesh 36 Forward Chaining American(West) ∧ Weapon(y) ∧ Sells(West,y,z) ∧ Hostile(z) ⇒ Criminal(x) Owns(Nono,x) Missile(x) Missile(x) ∧ Owns(Nono,x) ⇒ Sells(West,x,Nono) Missile(x) ⇒ Weapon(x) Enemy(x,America) ⇒ Hostile(x) American(West) Enemy(Nono,America)
  • 37. Rushdi Shams, Dept of CSE, KUET, Bangladesh 37 Forward Chaining American(West) ∧ Weapon(y) ∧ Sells(West,y,z) ∧ Hostile(z) ⇒ Criminal(x) Owns(Nono,x) Missile(x) Missile(x) ∧ Owns(Nono,x) ⇒ Sells(West,x,Nono) Missile(x) ⇒ Weapon(x) Enemy(x,America) ⇒ Hostile(x) American(West) Enemy(Nono,America)
  • 38. Rushdi Shams, Dept of CSE, KUET, Bangladesh 38 Forward Chaining American(West) ∧ Weapon(y) ∧ Sells(West,y,z) ∧ Hostile(z) ⇒ Criminal(x) Owns(Nono,x) Missile(x) Missile(x) ∧ Owns(Nono,x) ⇒ Sells(West,x,Nono) Missile(x) ⇒ Weapon(x) Enemy(Nono,America) ⇒ Hostile(x) American(West) Enemy(Nono,America)
  • 39. Rushdi Shams, Dept of CSE, KUET, Bangladesh 39 Forward Chaining American(West) ∧ Weapon(y) ∧ Sells(West,y,z) ∧ Hostile(z) ⇒ Criminal(x) Owns(Nono,x) Missile(x) Missile(x) ∧ Owns(Nono,x) ⇒ Sells(West,x,Nono) Missile(x) ⇒ Weapon(x) Enemy(Nono,America) ⇒ Hostile(Nono) American(West) Enemy(Nono,America)
  • 40. Rushdi Shams, Dept of CSE, KUET, Bangladesh 40 Forward Chaining American(West) ∧ Weapon(y) ∧ Sells(West,y,z) ∧ Hostile(Nono) ⇒ Criminal(x) Owns(Nono,x) Missile(x) Missile(x) ∧ Owns(Nono,x) ⇒ Sells(West,x,Nono) Missile(x) ⇒ Weapon(x) Enemy(Nono,America) ⇒ Hostile(Nono) American(West) Enemy(Nono,America)
  • 41. Rushdi Shams, Dept of CSE, KUET, Bangladesh 41 Backward Chaining American(West) ∧ Weapon(y) ∧ Sells(West,y,z) ∧ Hostile(Nono) ⇒ Criminal(x) Owns(Nono,x) Missile(x) Missile(x) ∧ Owns(Nono,x) ⇒ Sells(West,x,Nono) Missile(x) ⇒ Weapon(x) Enemy(Nono,America) ⇒ Hostile(Nono) American(West) Enemy(Nono,America)
  • 42. Rushdi Shams, Dept of CSE, KUET, Bangladesh 42 Backward Chaining American(West) ∧ Weapon(y) ∧ Sells(West,y,z) ∧ Hostile(Nono) ⇒ Criminal(x) Owns(Nono,x) Missile(x) Missile(x) ∧ Owns(Nono,x) ⇒ Sells(West,x,Nono) Missile(x) ⇒ Weapon(x) Enemy(Nono,America) ⇒ Hostile(Nono) American(West) Enemy(Nono,America)
  • 43. Rushdi Shams, Dept of CSE, KUET, Bangladesh 43 Backward Chaining American(West) ∧ Weapon(y) ∧ Sells(West,y,z) ∧ Hostile(Nono) ⇒ Criminal(x) Owns(Nono,x) Missile(x) Missile(x) ∧ Owns(Nono,x) ⇒ Sells(West,x,Nono) Missile(x) ⇒ Weapon(x) Enemy(Nono,America) ⇒ Hostile(Nono) American(West) Enemy(Nono,America)
  • 44. Rushdi Shams, Dept of CSE, KUET, Bangladesh 44 Backward Chaining American(West) ∧ Weapon(y) ∧ Sells(West,y,z) ∧ Hostile(Nono) ⇒ Criminal(x) Owns(Nono,x) Missile(x) Missile(x) ∧ Owns(Nono,x) ⇒Sells(West,x,Nono) Missile(x) ⇒ Weapon(x) Enemy(Nono,America) ⇒ Hostile(Nono) American(West) Enemy(Nono,America)
  • 45. Rushdi Shams, Dept of CSE, KUET, Bangladesh 45 Backward Chaining American(West) ∧ Weapon(y) ∧ Sells(West,y,z) ∧ Hostile(Nono) ⇒ Criminal(x) Owns(Nono,x) Missile(x) Missile(x) ∧ Owns(Nono,x) ⇒Sells(West,x,Nono) Missile(x) ⇒ Weapon(x) Enemy(Nono,America) ⇒ Hostile(Nono) American(West) Enemy(Nono,America)
  • 46. Rushdi Shams, Dept of CSE, KUET, Bangladesh 46 Backward Chaining American(West) ∧ Weapon(y) ∧ Sells(West,y,Nono) ∧ Hostile(Nono) ⇒ Criminal(x) Owns(Nono,x) Missile(x) Missile(x) ∧ Owns(Nono,x) ⇒Sells(West,x,Nono) Missile(x) ⇒ Weapon(x) Enemy(Nono,America) ⇒ Hostile(Nono) American(West) Enemy(Nono,America)
  • 47. Rushdi Shams, Dept of CSE, KUET, Bangladesh 47 Backward Chaining American(West) ∧ Weapon(y) ∧ Sells(West,y,Nono) ∧ Hostile(Nono) ⇒ Criminal(x) Owns(Nono,x) Missile(x) Missile(x) ∧ Owns(Nono,x) ⇒Sells(West,x,Nono) Missile(x) ⇒ Weapon(x) Enemy(Nono,America) ⇒ Hostile(Nono) American(West) Enemy(Nono,America)
  • 48. Rushdi Shams, Dept of CSE, KUET, Bangladesh 48 …& the Inference American(West) ∧ Weapon(y) ∧ Sells(West,y,Nono) ∧ Hostile(Nono) ⇒ Criminal(West) Owns(Nono,x) Missile(x) Missile(x) ∧ Owns(Nono,x) ⇒Sells(West,x,Nono) Missile(x) ⇒ Weapon(x) Enemy(Nono,America) ⇒ Hostile(Nono) American(West) Enemy(Nono,America)
  • 49. Rushdi Shams, Dept of CSE, KUET, Bangladesh 49 References Artificial Intelligence: A Modern Approach (2nd Edition) by Russell and Norvig Chapter 8 http://www.cs.odu.edu/~toida/nerzic/content/logic/pred_