SlideShare a Scribd company logo
1 of 63
Lecture 12, 13– Predicate Calculus
and Knowledge Representation
Logic and inferencing
Vision NLP
Expert
Systems
Planning
Robotics
•
Search
•
Reasoning
•
Learning
•
Knowledge
Obtaining implication of given facts and rules -- Hallmark of
intelligence
Inferencing through
−
Deduction (General to specific)
−
Induction (Specific to General)
−
Abduction (Conclusion to hypothesis in absence of any other evidence
to contrary)
Deduction
Given: All men are mortal (rule)
Shakespeare is a man (fact)
To prove: Shakespeare is mortal (inference)
Induction
Given: Shakespeare is mortal
Newton is mortal (Observation)
Dijkstra is mortal
To prove: All men are mortal (Generalization)
If there is rain, then there will be no picnic
Fact1: There was rain
Conclude: There was no picnic
Deduction
Fact2: There was no picnic
Conclude: There was no rain (?)
Induction and abduction are fallible forms of reasoning. Their conclusions are
susceptible to retraction
Two systems of logic
1) Propositional calculus
2) Predicate calculus
Propositions
−
Stand for facts/assertions
−
Declarative statements
−
As opposed to interrogative statements (questions) or imperative
statements (request, order)
Operators
=> and ¬ form a minimal set (can express other operations)
- Prove it.
Tautologies are formulae whose truth value is always T, whatever the
assignment is
)((~),),(),( ⇒∨∧ NIMPLICATIONOTORAND
Model
In propositional calculus any formula with n propositions has 2n
models
(assignments)
- Tautologies evaluate to T in all models.
Examples:
1)
2)
-
e Morgan with AND
PP ¬∨
)()( QPQP ¬∨¬⇔∧¬
Semantic Tree/Tableau method of proving tautology
Start with the negation of the formula
α-formula
β-formula
α-formula
p
q
¬q¬ p
- α - formula
- β - formula
)]()([ QPQP ¬∨¬⇒∧¬¬
)( QP ∧¬
)( QP ¬∨¬¬
- α - formula
Example 2:
B C B CContradictions in all paths
X
α-formula
¬A ¬C
¬A
¬B ¬A ¬B
A
B∨C
A
B∨C A
B∨C
A
B∨C
(α - formulae)
(β - formulae)
(α - formula)
)]()()([ CABACBA ∧∨∧⇒∨∧¬
)( CBA ∨∧
))()(( CABA ∧∨∧¬
)( BA ∧¬
))( CA ∧¬
Exercise:
Prove the backward implication in the previous
example
Inferencing in PC
Resolution Forward
chaining
Backward
chaining
Knowledge
Declarative Procedural
• Declarative knowledge deals with factoid questions
(what is the capital of India? Who won the
Wimbledon in 2005? Etc.)
• Procedural knowledge deals with “How”
• Procedural knowledge can be embedded in
declarative knowledge
Example: Employee knowledge base
Employee record
Emp id : 1124
Age : 27
Salary : 10L / annum
Tax : Procedure to calculate tax from basic salary,
Loans, medical factors, and # of children
Text Knowledge
Representation
A Semantic Graph
in: modifier
a: indefinite
the: definite
student
past tense
agent
bought
object
time
computer
new
June
modifier
The student bought a new computer in June.
UNL representation
Ram is reading the newspaper
Representation of Knowledge
UNL: a United Nations project
 Started in 1996
 10 year program
 15 research groups across continents
 First goal: generators
 Next goal: analysers (needs solving various
ambiguity problems)
 Current active language groups
 UNL_French (GETA-CLIPS, IMAG)
 UNL_Hindi (IIT Bombay with additional work on
UNL_English)
 UNL_Italian (Univ. of Pisa)
 UNL_Portugese (Univ of Sao Paolo, Brazil)
 UNL_Russian (Institute of Linguistics, Moscow)
 UNL_Spanish (UPM, Madrid)
Dave, Parikh and Bhattacharyya, Journal of Machine Translation, 2002
Knowledge Representation
Ram
read
newspaper
agt obj
UNL Graph - relations
Knowledge Representation
Ram(iof>person)
read(icl>interpret)
newspaper(icl>print_media)
UNL Graph - UWs
agt
obj
Knowledge Representation
Ram(iof>person)
read(icl>interpret)
newspaper(icl>print_media)
@entry
@present
@progress
@def
Ram is reading the newspaper
UNL graph - attributes
agt
obj
The boy who works here went to school
plt
agt
@ entry @ past
school(icl>institution)
go(icl>move)
boy(icl>person
)
work(icl>do
)
here
@ entry
agt
plc
:01
Another Example
Predicate Calculus
Predicate Calculus: well known
examples
 Man is mortal : rule
∀x[man(x) → mortal(x)]
 shakespeare is a man
man(shakespeare)
 To infer shakespeare is mortal
mortal(shakespeare)
Forward Chaining/ Inferencing
 man(x) → mortal(x)
 Dropping the quantifier, implicitly Universal
quantification assumed
 man(shakespeare)
 Goal mortal(shakespeare)
 Found in one step
 x = shakespeare, unification
Backward Chaining/
Inferencing
 man(x) → mortal(x)
 Goal mortal(shakespeare)
 x = shakespeare
 Travel back over and hit the fact asserted
 man(shakespeare)
Resolution - Refutation
 man(x) → mortal(x)
 Convert to clausal form
 ~man(shakespeare) mortal(x)
 Clauses in the knowledge base
 ~man(shakespeare) mortal(x)
 man(shakespeare)
 mortal(shakespeare)
∨
∨
Resolution – Refutation contd
 Negate the goal
 ~man(shakespeare)
 Get a pair of resolvents
)(~ eshakespearmortal )()(~ eshakespearmortaleshakespearman ∨
)(~ eshakespearman )(~ eshakespearman
Resolution Tree
1Re solvent 2Re solvent
soluteRe
Search in resolution
 Heuristics for Resolution Search
 Goal Supported Strategy

Always start with the negated goal
 Set of support strategy

Always one of the resolvents is the most recently
produced resolute
Inferencing in Predicate Calculus
 Forward chaining
 Given P, , to infer Q
 P, match L.H.S of
 Assert Q from R.H.S
 Backward chaining
 Q, Match R.H.S of
 assert P
 Check if P exists
 Resolution – Refutation
 Negate goal
 Convert all pieces of knowledge into clausal form (disjunction of
literals)
 See if contradiction indicated by null clause can be derived
QP →
QP →
1. P
2. converted to
3.
Draw the resolution tree (actually an inverted
tree). Every node is a clausal form and
branches are intermediate inference steps.
QP → QP ∨~
Q~
Q~
QP ∨~
P~ P
Terminology
 Pair of clauses being resolved is called the
Resolvents. The resulting clause is called
the Resolute.
 Choosing the correct pair of resolvents is a
matter of search.
Predicate Calculus
 Introduction through an example (Zohar Manna,
1974):
 Problem: A, B and C belong to the Himalayan
club. Every member in the club is either a
mountain climber or a skier or both. A likes
whatever B dislikes and dislikes whatever B likes.
A likes rain and snow. No mountain climber likes
rain. Every skier likes snow. Is there a member
who is a mountain climber and not a skier?
 Given knowledge has:
 Facts
 Rules
Predicate Calculus: Example
contd.
 Let mc denote mountain climber and sk denotes skier.
Knowledge representation in the given problem is as follows:
1. member(A)
2. member(B)
3. member(C)
4. ∀x[member(x) → (mc(x) ∨ sk(x))]
5. ∀x[mc(x) → ~like(x,rain)]
6. ∀x[sk(x) → like(x, snow)]
7. ∀x[like(B, x) → ~like(A, x)]
8. ∀x[~like(B, x) → like(A, x)]
9. like(A, rain)
10. like(A, snow)
11. Question: ∃x[member(x) ∧ mc(x) ∧ ~sk(x)]
 We have to infer the 11th
expression from the given 10.
 Done through Resolution Refutation.
Club example: Inferencing
1. member(A)
2. member(B)
3. member(C)
4.
– Can be written as
–
5.
–
6.
–
7.
–
))]()(()([ xskxmcxmemberx ∨→∀
))]()(()([ xskxmcxmember ∨→
)()()(~ xskxmcxmember ∨∨
)],()([ snowxlkxskx →∀
),()(~ snowxlkxsk ∨
)],(~)([ rainxlkxmcx →∀
),(~)(~ rainxlkxmc ∨
)],(~),([ xBlkxAlikex →∀
),(~),(~ xBlkxAlike ∨
8.
–
9.
10.
11.
– Negate–
)],(),([~ xBlkxAlkx →∀
),(),( xBlkxAlk ∨
),( rainAlk
),( snowAlk
)](~)()([ xskxmcxmemberx ∧∧∃
)]()(~)([~ xskxmcxmemberx ∨∨∀
 Now standardize the variables apart which
results in the following
1. member(A)
2. member(B)
3. member(C)
4.
5.
6.
7.
8.
9.
10.
11.
)()()(~ 111 xskxmcxmember ∨∨
),()(~ 22 snowxlkxsk ∨
),(~)(~ 33 rainxlkxmc ∨
),(~),(~ 44 xBlkxAlike ∨
),(),( 55 xBlkxAlk ∨
),( rainAlk
),( snowAlk
)]()(~)([~ 666 xskxmcxmemberx ∨∨∀
),(~),(~ 44 xBlkxAlike ∨ ),( snowAlk
),(~ snowBlk ),()(~ 22 snowxlkxsk ∨
)()()(~ 111 xskxmcxmember ∨∨)(~ Bsk
)()(~ BmcBmember ∨ )(Bmember
)(Bmc)]()(~)([~ 666 xskxmcxmemberx ∨∨∀
)()(~ BskBmember ∨ )(~ Bsk
)(~ Bmember )(Bmember
7
10
12 5
13 4
14 2
11
15
16 13
17 2
Assignment
 Prove the inferencing in the Himalayan club
example with different starting points,
producing different resolution trees.
 Think of a Prolog implementation of the
problem
 Prolog Reference (Prolog by Chockshin &
Melish)
Problem-2
From predicate calculus
A “department” environment
1. Dr. X is the HoD of CSE
2. Y and Z work in CSE
3. Dr. P is the HoD of ME
4. Q and R work in ME
5. Y is married to Q
6. By Institute policy staffs of the same
department cannot marry
7. All married staff of CSE are insured by LIC
8. HoD is the boss of all staff in the
department
Diagrammatic representation
Dr. X
Y
Z
Dr. P
Q R
married
CSE ME
Questions on “department”
 Who works in CSE?
 Is there a married person in ME?
 Is there somebody insured by LIC?
Problem-3
(Zohar Manna, Mathematical Theory of
Computation, 1974)
From Propositional Calculus
Tourist in a country of truth-
sayers and liers
 Facts and Rules: In a certain country, people
either always speak the truth or always
lie. A tourist T comes to a junction in the
country and finds an inhabitant S of the
country standing there. One of the roads at
the junction leads to the capital of the country
and the other does not. S can be asked only
yes/no questions.
 Question: What single yes/no question can T
ask of S, so that the direction of the capital is
revealed?
Diagrammatic representation
S (either always says the truth
Or always lies)
T (tourist)
Capital
Deciding the Propositions: a very difficult
step- needs human intelligence
 P: Left road leads to capital
 Q: S always speaks the truth
Meta Question: What question
should the tourist ask
 The form of the question
 Very difficult: needs human intelligence
 The tourist should ask
 Is R true?
 The answer is “yes” if and only if the
left road leads to the capital
 The structure of R to be found as a
function of P and Q
A more mechanical part: use
of truth table
P Q S’s
Answer
R
T T Yes T
T F Yes F
F T No F
F F No T
Get form of R: quite
mechanical
 From the truth table
 R is of the form (P x-nor Q) or (P ≡
Q)
Get R in
English/Hindi/Hebrew…
 Natural Language Generation: non-trivial
 The question the tourist will ask is
 Is it true that the left road leads to the
capital if and only if you speak the truth?
 Exercise: A more well known form of this
question asked by the tourist uses the X-OR
operator instead of the X-Nor. What changes
do you have to incorporate to the solution, to
get that answer?
Problem-4
From Propositional Calculus
Another tourist example: this time in a
restaurant setting in a different country
(Manna, 1974)
 Facts: A tourist is in a restaurant in a country when
the waiter tells him:
 “do you see the three men in the table yonder? One of them
is X who always speaks the truth, another is Y who always
lies and the third is Z who sometimes speaks the truth and
sometimes lies, i.e., answers yes/no randomly without
regard to the question.
 Question: Can you (the tourist) ask three yes/no
questions to these men, always indicating who should
answer the question, and determine who of them is
X, who y and who Z?
Solution: Most of the steps are
doable by humans only
 Number the persons: 1, 2, 3
 1 can be X/Y/Z
 2 can be X/Y/Z
 3 can be X/Y/Z
 Let the first question be to 1
 One of 2 and 3 has to be NOT Z.
 Critical step in the solution: only
humans can do?
Now cast the problem in the
same setting as the tourist and
the capital example
 Solving by analogy
 Use of previously solved problems
 Hallmark of intelligence
Analogy with the tourist and
the capital problem
 Find the direction to the capital
  Find Z; who amongst 1, 2 and 3 is Z?
 Ask a single yes/no question to S (the person
standing at the junction)
  Ask a single yes/no question to 1
 Answer forced to reveal the direction of the
capital
  Answer forced to reveal who from 1,2,3 is Z
Question to 1
 Ask “Is R true” and the answer is yes if
and only if 2 is not Z
 Propositions
 P: 2 is not Z
 Q: 1 always speaks the truth, i.e., 1 is X
Use of truth table as before
P Q 1’s
Answer
R
T T Yes T
T F Yes F
F T No F
F F No T
Question to 1: the first
question
 Is it true that 2 is not Z if and
only if you are X?
Analysis of 1’s answer
 Ans= yes
 Case 1: 1 is X/Y (always speaks the truth
or always lies)

2 is indeed not Z (we can trust 1’s answer)
 Case 2: 1 is Z

2 is indeed not Z (we cannot trust 1’s answer;
but that does not affect us)
Analysis of 1’s answer (contd)
 Ans= no
 Case 1: 1 is X/Y (always speaks the truth
or always lies)

2 is Z; hence 3 is not Z
 Case 2: 1 is Z

3 is not Z
Note carefully: how cleverly Z is identified.
Can a machine do it?
Next steps: ask the 2nd
question to determine X/Y
 Once “Not Z” is identified- say 2, ask
him a tautology
 Is P≡P

If yes, 2 is X

If no, 2 is Y
Ask the 3rd
Question
 Ask 2 “is 1 Z”
 If 2 is X
 Ans=yes, 1 is Z
 Ans=no, 1 is Y
 If 2 is Y (always lies)
 Ans=yes, 1 is X
 Ans=no, 1 is Z
 3 is the remaining person
What do these examples
show?
 Logic systematizes the reasoning process
 Helps identify what is
mechanical/routine/automatable
 Brings to light the steps that only human
intelligence can perform
 These are especially of foundational and structural
nature (e.g., deciding what propositions to
start with)
 Algorithmizing reasoning is not trivial

More Related Content

What's hot

Dijkstra’S Algorithm
Dijkstra’S AlgorithmDijkstra’S Algorithm
Dijkstra’S Algorithmami_01
 
knowledge representation using rules
knowledge representation using rulesknowledge representation using rules
knowledge representation using rulesHarini Balamurugan
 
What is knowledge representation and reasoning ?
What is knowledge representation and reasoning ?What is knowledge representation and reasoning ?
What is knowledge representation and reasoning ?Anant Soft Computing
 
Learning by analogy
Learning by analogyLearning by analogy
Learning by analogyNitesh Singh
 
Chomsky classification of Language
Chomsky classification of LanguageChomsky classification of Language
Chomsky classification of LanguageDipankar Boruah
 
Knowledge Representation & Reasoning
Knowledge Representation & ReasoningKnowledge Representation & Reasoning
Knowledge Representation & ReasoningSajid Marwat
 
State Space Search in ai
State Space Search in aiState Space Search in ai
State Space Search in aivikas dhakane
 
Symbol table in compiler Design
Symbol table in compiler DesignSymbol table in compiler Design
Symbol table in compiler DesignKuppusamy P
 
Algorithms Lecture 7: Graph Algorithms
Algorithms Lecture 7: Graph AlgorithmsAlgorithms Lecture 7: Graph Algorithms
Algorithms Lecture 7: Graph AlgorithmsMohamed Loey
 
Problem solving agents
Problem solving agentsProblem solving agents
Problem solving agentsMegha Sharma
 
State Space Representation and Search
State Space Representation and SearchState Space Representation and Search
State Space Representation and SearchHitesh Mohapatra
 
Sets and disjoint sets union123
Sets and disjoint sets union123Sets and disjoint sets union123
Sets and disjoint sets union123Ankita Goyal
 
weak slot and filler structure
weak slot and filler structureweak slot and filler structure
weak slot and filler structureAmey Kerkar
 

What's hot (20)

AI Lecture 7 (uncertainty)
AI Lecture 7 (uncertainty)AI Lecture 7 (uncertainty)
AI Lecture 7 (uncertainty)
 
Dijkstra’S Algorithm
Dijkstra’S AlgorithmDijkstra’S Algorithm
Dijkstra’S Algorithm
 
Associative memory network
Associative memory networkAssociative memory network
Associative memory network
 
knowledge representation using rules
knowledge representation using rulesknowledge representation using rules
knowledge representation using rules
 
What is knowledge representation and reasoning ?
What is knowledge representation and reasoning ?What is knowledge representation and reasoning ?
What is knowledge representation and reasoning ?
 
Learning by analogy
Learning by analogyLearning by analogy
Learning by analogy
 
Chomsky classification of Language
Chomsky classification of LanguageChomsky classification of Language
Chomsky classification of Language
 
First order logic
First order logicFirst order logic
First order logic
 
Knowledge Representation & Reasoning
Knowledge Representation & ReasoningKnowledge Representation & Reasoning
Knowledge Representation & Reasoning
 
State Space Search in ai
State Space Search in aiState Space Search in ai
State Space Search in ai
 
Symbol table in compiler Design
Symbol table in compiler DesignSymbol table in compiler Design
Symbol table in compiler Design
 
Multi Head, Multi Tape Turing Machine
Multi Head, Multi Tape Turing MachineMulti Head, Multi Tape Turing Machine
Multi Head, Multi Tape Turing Machine
 
Greedy Algorihm
Greedy AlgorihmGreedy Algorihm
Greedy Algorihm
 
Algorithms Lecture 7: Graph Algorithms
Algorithms Lecture 7: Graph AlgorithmsAlgorithms Lecture 7: Graph Algorithms
Algorithms Lecture 7: Graph Algorithms
 
Problem solving agents
Problem solving agentsProblem solving agents
Problem solving agents
 
Fuzzy logic ppt
Fuzzy logic pptFuzzy logic ppt
Fuzzy logic ppt
 
State Space Representation and Search
State Space Representation and SearchState Space Representation and Search
State Space Representation and Search
 
And or graph
And or graphAnd or graph
And or graph
 
Sets and disjoint sets union123
Sets and disjoint sets union123Sets and disjoint sets union123
Sets and disjoint sets union123
 
weak slot and filler structure
weak slot and filler structureweak slot and filler structure
weak slot and filler structure
 

Viewers also liked

Predicate Logic
Predicate LogicPredicate Logic
Predicate Logicgiki67
 
03 - Predicate logic
03 - Predicate logic03 - Predicate logic
03 - Predicate logicTudor Girba
 
Knowledge representation and Predicate logic
Knowledge representation and Predicate logicKnowledge representation and Predicate logic
Knowledge representation and Predicate logicAmey Kerkar
 
Relational calculas
Relational calculasRelational calculas
Relational calculasanuj24
 
Nested quantifiers
Nested quantifiersNested quantifiers
Nested quantifiersAli Saleem
 
Nested quantifiers
Nested quantifiersNested quantifiers
Nested quantifiersAli Saleem
 
Lecture 12 Heuristic Searches
Lecture 12 Heuristic SearchesLecture 12 Heuristic Searches
Lecture 12 Heuristic SearchesHema Kashyap
 
17 1 knowledge-based system
17 1 knowledge-based system17 1 knowledge-based system
17 1 knowledge-based systemTianlu Wang
 
Artificial Intelligence
Artificial Intelligence Artificial Intelligence
Artificial Intelligence Muhammad Ahad
 
Lecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceLecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceasimnawaz54
 
Propositional logic & inference
Propositional logic & inferencePropositional logic & inference
Propositional logic & inferenceSlideshare
 
Unit 6 - Predicates, Referring Expressions, and Universe of Discourse
Unit 6 -  Predicates, Referring Expressions, and Universe of DiscourseUnit 6 -  Predicates, Referring Expressions, and Universe of Discourse
Unit 6 - Predicates, Referring Expressions, and Universe of DiscourseAshwag Al Hamid
 
Unit 4 - Referring Expressions
Unit 4 -  Referring ExpressionsUnit 4 -  Referring Expressions
Unit 4 - Referring ExpressionsAshwag Al Hamid
 
Relational algebra in dbms
Relational algebra in dbmsRelational algebra in dbms
Relational algebra in dbmsshekhar1991
 
Presentation on dbms(relational calculus)
Presentation on dbms(relational calculus)Presentation on dbms(relational calculus)
Presentation on dbms(relational calculus)yourbookworldanil
 

Viewers also liked (20)

Predicate Logic
Predicate LogicPredicate Logic
Predicate Logic
 
03 - Predicate logic
03 - Predicate logic03 - Predicate logic
03 - Predicate logic
 
15 predicate
15 predicate15 predicate
15 predicate
 
Knowledge representation and Predicate logic
Knowledge representation and Predicate logicKnowledge representation and Predicate logic
Knowledge representation and Predicate logic
 
ALI IRTAZA
ALI IRTAZAALI IRTAZA
ALI IRTAZA
 
Relational calculas
Relational calculasRelational calculas
Relational calculas
 
Nested quantifiers
Nested quantifiersNested quantifiers
Nested quantifiers
 
Nested quantifiers
Nested quantifiersNested quantifiers
Nested quantifiers
 
Ai 02
Ai 02Ai 02
Ai 02
 
Lecture 12 Heuristic Searches
Lecture 12 Heuristic SearchesLecture 12 Heuristic Searches
Lecture 12 Heuristic Searches
 
17 1 knowledge-based system
17 1 knowledge-based system17 1 knowledge-based system
17 1 knowledge-based system
 
Artificial Intelligence
Artificial Intelligence Artificial Intelligence
Artificial Intelligence
 
Propositional logic
Propositional logicPropositional logic
Propositional logic
 
Lecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceLecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inference
 
Propositional logic & inference
Propositional logic & inferencePropositional logic & inference
Propositional logic & inference
 
Propositional logic
Propositional logicPropositional logic
Propositional logic
 
Unit 6 - Predicates, Referring Expressions, and Universe of Discourse
Unit 6 -  Predicates, Referring Expressions, and Universe of DiscourseUnit 6 -  Predicates, Referring Expressions, and Universe of Discourse
Unit 6 - Predicates, Referring Expressions, and Universe of Discourse
 
Unit 4 - Referring Expressions
Unit 4 -  Referring ExpressionsUnit 4 -  Referring Expressions
Unit 4 - Referring Expressions
 
Relational algebra in dbms
Relational algebra in dbmsRelational algebra in dbms
Relational algebra in dbms
 
Presentation on dbms(relational calculus)
Presentation on dbms(relational calculus)Presentation on dbms(relational calculus)
Presentation on dbms(relational calculus)
 

Similar to Predicate calculus

L03 ai - knowledge representation using logic
L03 ai - knowledge representation using logicL03 ai - knowledge representation using logic
L03 ai - knowledge representation using logicManjula V
 
GDSC SSN - solution Challenge : Fundamentals of Decision Making
GDSC SSN - solution Challenge : Fundamentals of Decision MakingGDSC SSN - solution Challenge : Fundamentals of Decision Making
GDSC SSN - solution Challenge : Fundamentals of Decision MakingGDSCSSN
 
Chapter 01 - p2.pdf
Chapter 01 - p2.pdfChapter 01 - p2.pdf
Chapter 01 - p2.pdfsmarwaneid
 
Dedalo, looking for Cluster Explanations in a labyrinth of Linked Data
Dedalo, looking for Cluster Explanations in a labyrinth of Linked DataDedalo, looking for Cluster Explanations in a labyrinth of Linked Data
Dedalo, looking for Cluster Explanations in a labyrinth of Linked DataVrije Universiteit Amsterdam
 
AI3391 Artificial Intelligence Session 26 First order logic.pptx
AI3391 Artificial Intelligence Session 26 First order logic.pptxAI3391 Artificial Intelligence Session 26 First order logic.pptx
AI3391 Artificial Intelligence Session 26 First order logic.pptxAsst.prof M.Gokilavani
 
Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)SHUBHAM KUMAR GUPTA
 
10 logic+programming+with+prolog
10 logic+programming+with+prolog10 logic+programming+with+prolog
10 logic+programming+with+prologbaran19901990
 
Knowledge Representation, Inference and Reasoning
Knowledge Representation, Inference and ReasoningKnowledge Representation, Inference and Reasoning
Knowledge Representation, Inference and ReasoningSagacious IT Solution
 
Chapter-6-Random Variables & Probability distributions-3.doc
Chapter-6-Random Variables & Probability distributions-3.docChapter-6-Random Variables & Probability distributions-3.doc
Chapter-6-Random Variables & Probability distributions-3.docDesalechali1
 
Knowledge base artificial intelligence.pdf
Knowledge base  artificial intelligence.pdfKnowledge base  artificial intelligence.pdf
Knowledge base artificial intelligence.pdfjannatulferdous20101
 
Cs344 lect15-robotic-knowledge-inferencing-prolog-11feb08
Cs344 lect15-robotic-knowledge-inferencing-prolog-11feb08Cs344 lect15-robotic-knowledge-inferencing-prolog-11feb08
Cs344 lect15-robotic-knowledge-inferencing-prolog-11feb08Praveen Kumar
 
Pwl rewal-slideshare
Pwl rewal-slidesharePwl rewal-slideshare
Pwl rewal-slidesharepalvaro
 

Similar to Predicate calculus (20)

L03 ai - knowledge representation using logic
L03 ai - knowledge representation using logicL03 ai - knowledge representation using logic
L03 ai - knowledge representation using logic
 
artficial intelligence
artficial intelligenceartficial intelligence
artficial intelligence
 
GDSC SSN - solution Challenge : Fundamentals of Decision Making
GDSC SSN - solution Challenge : Fundamentals of Decision MakingGDSC SSN - solution Challenge : Fundamentals of Decision Making
GDSC SSN - solution Challenge : Fundamentals of Decision Making
 
Worksheet
WorksheetWorksheet
Worksheet
 
Chapter 01 - p2.pdf
Chapter 01 - p2.pdfChapter 01 - p2.pdf
Chapter 01 - p2.pdf
 
lect14-semantics.ppt
lect14-semantics.pptlect14-semantics.ppt
lect14-semantics.ppt
 
Dedalo, looking for Cluster Explanations in a labyrinth of Linked Data
Dedalo, looking for Cluster Explanations in a labyrinth of Linked DataDedalo, looking for Cluster Explanations in a labyrinth of Linked Data
Dedalo, looking for Cluster Explanations in a labyrinth of Linked Data
 
AI3391 Artificial Intelligence Session 26 First order logic.pptx
AI3391 Artificial Intelligence Session 26 First order logic.pptxAI3391 Artificial Intelligence Session 26 First order logic.pptx
AI3391 Artificial Intelligence Session 26 First order logic.pptx
 
02 RULES OF INFERENCES.pptx
02 RULES OF INFERENCES.pptx02 RULES OF INFERENCES.pptx
02 RULES OF INFERENCES.pptx
 
Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)
 
10 logic+programming+with+prolog
10 logic+programming+with+prolog10 logic+programming+with+prolog
10 logic+programming+with+prolog
 
Knowledge Representation, Inference and Reasoning
Knowledge Representation, Inference and ReasoningKnowledge Representation, Inference and Reasoning
Knowledge Representation, Inference and Reasoning
 
Chapter-6-Random Variables & Probability distributions-3.doc
Chapter-6-Random Variables & Probability distributions-3.docChapter-6-Random Variables & Probability distributions-3.doc
Chapter-6-Random Variables & Probability distributions-3.doc
 
Module_5_1.pptx
Module_5_1.pptxModule_5_1.pptx
Module_5_1.pptx
 
01bkb04p.ppt
01bkb04p.ppt01bkb04p.ppt
01bkb04p.ppt
 
Knowledge base artificial intelligence.pdf
Knowledge base  artificial intelligence.pdfKnowledge base  artificial intelligence.pdf
Knowledge base artificial intelligence.pdf
 
Cs344 lect15-robotic-knowledge-inferencing-prolog-11feb08
Cs344 lect15-robotic-knowledge-inferencing-prolog-11feb08Cs344 lect15-robotic-knowledge-inferencing-prolog-11feb08
Cs344 lect15-robotic-knowledge-inferencing-prolog-11feb08
 
Pwl rewal-slideshare
Pwl rewal-slidesharePwl rewal-slideshare
Pwl rewal-slideshare
 
Stochastic Processes Homework Help
Stochastic Processes Homework Help Stochastic Processes Homework Help
Stochastic Processes Homework Help
 
Pnp
PnpPnp
Pnp
 

More from Rajendran

Element distinctness lower bounds
Element distinctness lower boundsElement distinctness lower bounds
Element distinctness lower boundsRajendran
 
Scheduling with Startup and Holding Costs
Scheduling with Startup and Holding CostsScheduling with Startup and Holding Costs
Scheduling with Startup and Holding CostsRajendran
 
Divide and conquer surfing lower bounds
Divide and conquer  surfing lower boundsDivide and conquer  surfing lower bounds
Divide and conquer surfing lower boundsRajendran
 
Red black tree
Red black treeRed black tree
Red black treeRajendran
 
Medians and order statistics
Medians and order statisticsMedians and order statistics
Medians and order statisticsRajendran
 
Proof master theorem
Proof master theoremProof master theorem
Proof master theoremRajendran
 
Recursion tree method
Recursion tree methodRecursion tree method
Recursion tree methodRajendran
 
Recurrence theorem
Recurrence theoremRecurrence theorem
Recurrence theoremRajendran
 
Master method
Master method Master method
Master method Rajendran
 
Master method theorem
Master method theoremMaster method theorem
Master method theoremRajendran
 
Master method theorem
Master method theoremMaster method theorem
Master method theoremRajendran
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithmsRajendran
 
Longest common subsequences in Algorithm Analysis
Longest common subsequences in Algorithm AnalysisLongest common subsequences in Algorithm Analysis
Longest common subsequences in Algorithm AnalysisRajendran
 
Dynamic programming in Algorithm Analysis
Dynamic programming in Algorithm AnalysisDynamic programming in Algorithm Analysis
Dynamic programming in Algorithm AnalysisRajendran
 
Average case Analysis of Quicksort
Average case Analysis of QuicksortAverage case Analysis of Quicksort
Average case Analysis of QuicksortRajendran
 
Np completeness
Np completenessNp completeness
Np completenessRajendran
 
computer languages
computer languagescomputer languages
computer languagesRajendran
 

More from Rajendran (20)

Element distinctness lower bounds
Element distinctness lower boundsElement distinctness lower bounds
Element distinctness lower bounds
 
Scheduling with Startup and Holding Costs
Scheduling with Startup and Holding CostsScheduling with Startup and Holding Costs
Scheduling with Startup and Holding Costs
 
Divide and conquer surfing lower bounds
Divide and conquer  surfing lower boundsDivide and conquer  surfing lower bounds
Divide and conquer surfing lower bounds
 
Red black tree
Red black treeRed black tree
Red black tree
 
Hash table
Hash tableHash table
Hash table
 
Medians and order statistics
Medians and order statisticsMedians and order statistics
Medians and order statistics
 
Proof master theorem
Proof master theoremProof master theorem
Proof master theorem
 
Recursion tree method
Recursion tree methodRecursion tree method
Recursion tree method
 
Recurrence theorem
Recurrence theoremRecurrence theorem
Recurrence theorem
 
Master method
Master method Master method
Master method
 
Master method theorem
Master method theoremMaster method theorem
Master method theorem
 
Hash tables
Hash tablesHash tables
Hash tables
 
Lower bound
Lower boundLower bound
Lower bound
 
Master method theorem
Master method theoremMaster method theorem
Master method theorem
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithms
 
Longest common subsequences in Algorithm Analysis
Longest common subsequences in Algorithm AnalysisLongest common subsequences in Algorithm Analysis
Longest common subsequences in Algorithm Analysis
 
Dynamic programming in Algorithm Analysis
Dynamic programming in Algorithm AnalysisDynamic programming in Algorithm Analysis
Dynamic programming in Algorithm Analysis
 
Average case Analysis of Quicksort
Average case Analysis of QuicksortAverage case Analysis of Quicksort
Average case Analysis of Quicksort
 
Np completeness
Np completenessNp completeness
Np completeness
 
computer languages
computer languagescomputer languages
computer languages
 

Recently uploaded

Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
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Ữ Â...Nguyen Thanh Tu Collection
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
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 ClassroomPooky Knightsmith
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 

Recently uploaded (20)

Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
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Ữ Â...
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
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
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 

Predicate calculus

  • 1. Lecture 12, 13– Predicate Calculus and Knowledge Representation
  • 2. Logic and inferencing Vision NLP Expert Systems Planning Robotics • Search • Reasoning • Learning • Knowledge Obtaining implication of given facts and rules -- Hallmark of intelligence
  • 3. Inferencing through − Deduction (General to specific) − Induction (Specific to General) − Abduction (Conclusion to hypothesis in absence of any other evidence to contrary) Deduction Given: All men are mortal (rule) Shakespeare is a man (fact) To prove: Shakespeare is mortal (inference) Induction Given: Shakespeare is mortal Newton is mortal (Observation) Dijkstra is mortal To prove: All men are mortal (Generalization)
  • 4. If there is rain, then there will be no picnic Fact1: There was rain Conclude: There was no picnic Deduction Fact2: There was no picnic Conclude: There was no rain (?) Induction and abduction are fallible forms of reasoning. Their conclusions are susceptible to retraction Two systems of logic 1) Propositional calculus 2) Predicate calculus
  • 5. Propositions − Stand for facts/assertions − Declarative statements − As opposed to interrogative statements (questions) or imperative statements (request, order) Operators => and ¬ form a minimal set (can express other operations) - Prove it. Tautologies are formulae whose truth value is always T, whatever the assignment is )((~),),(),( ⇒∨∧ NIMPLICATIONOTORAND
  • 6. Model In propositional calculus any formula with n propositions has 2n models (assignments) - Tautologies evaluate to T in all models. Examples: 1) 2) - e Morgan with AND PP ¬∨ )()( QPQP ¬∨¬⇔∧¬
  • 7. Semantic Tree/Tableau method of proving tautology Start with the negation of the formula α-formula β-formula α-formula p q ¬q¬ p - α - formula - β - formula )]()([ QPQP ¬∨¬⇒∧¬¬ )( QP ∧¬ )( QP ¬∨¬¬ - α - formula
  • 8. Example 2: B C B CContradictions in all paths X α-formula ¬A ¬C ¬A ¬B ¬A ¬B A B∨C A B∨C A B∨C A B∨C (α - formulae) (β - formulae) (α - formula) )]()()([ CABACBA ∧∨∧⇒∨∧¬ )( CBA ∨∧ ))()(( CABA ∧∨∧¬ )( BA ∧¬ ))( CA ∧¬
  • 9. Exercise: Prove the backward implication in the previous example
  • 10. Inferencing in PC Resolution Forward chaining Backward chaining
  • 11. Knowledge Declarative Procedural • Declarative knowledge deals with factoid questions (what is the capital of India? Who won the Wimbledon in 2005? Etc.) • Procedural knowledge deals with “How” • Procedural knowledge can be embedded in declarative knowledge
  • 12. Example: Employee knowledge base Employee record Emp id : 1124 Age : 27 Salary : 10L / annum Tax : Procedure to calculate tax from basic salary, Loans, medical factors, and # of children
  • 14. A Semantic Graph in: modifier a: indefinite the: definite student past tense agent bought object time computer new June modifier The student bought a new computer in June.
  • 15. UNL representation Ram is reading the newspaper Representation of Knowledge
  • 16. UNL: a United Nations project  Started in 1996  10 year program  15 research groups across continents  First goal: generators  Next goal: analysers (needs solving various ambiguity problems)  Current active language groups  UNL_French (GETA-CLIPS, IMAG)  UNL_Hindi (IIT Bombay with additional work on UNL_English)  UNL_Italian (Univ. of Pisa)  UNL_Portugese (Univ of Sao Paolo, Brazil)  UNL_Russian (Institute of Linguistics, Moscow)  UNL_Spanish (UPM, Madrid) Dave, Parikh and Bhattacharyya, Journal of Machine Translation, 2002
  • 20. The boy who works here went to school plt agt @ entry @ past school(icl>institution) go(icl>move) boy(icl>person ) work(icl>do ) here @ entry agt plc :01 Another Example
  • 22. Predicate Calculus: well known examples  Man is mortal : rule ∀x[man(x) → mortal(x)]  shakespeare is a man man(shakespeare)  To infer shakespeare is mortal mortal(shakespeare)
  • 23. Forward Chaining/ Inferencing  man(x) → mortal(x)  Dropping the quantifier, implicitly Universal quantification assumed  man(shakespeare)  Goal mortal(shakespeare)  Found in one step  x = shakespeare, unification
  • 24. Backward Chaining/ Inferencing  man(x) → mortal(x)  Goal mortal(shakespeare)  x = shakespeare  Travel back over and hit the fact asserted  man(shakespeare)
  • 25. Resolution - Refutation  man(x) → mortal(x)  Convert to clausal form  ~man(shakespeare) mortal(x)  Clauses in the knowledge base  ~man(shakespeare) mortal(x)  man(shakespeare)  mortal(shakespeare) ∨ ∨
  • 26. Resolution – Refutation contd  Negate the goal  ~man(shakespeare)  Get a pair of resolvents )(~ eshakespearmortal )()(~ eshakespearmortaleshakespearman ∨ )(~ eshakespearman )(~ eshakespearman
  • 27. Resolution Tree 1Re solvent 2Re solvent soluteRe
  • 28. Search in resolution  Heuristics for Resolution Search  Goal Supported Strategy  Always start with the negated goal  Set of support strategy  Always one of the resolvents is the most recently produced resolute
  • 29. Inferencing in Predicate Calculus  Forward chaining  Given P, , to infer Q  P, match L.H.S of  Assert Q from R.H.S  Backward chaining  Q, Match R.H.S of  assert P  Check if P exists  Resolution – Refutation  Negate goal  Convert all pieces of knowledge into clausal form (disjunction of literals)  See if contradiction indicated by null clause can be derived QP → QP →
  • 30. 1. P 2. converted to 3. Draw the resolution tree (actually an inverted tree). Every node is a clausal form and branches are intermediate inference steps. QP → QP ∨~ Q~ Q~ QP ∨~ P~ P
  • 31. Terminology  Pair of clauses being resolved is called the Resolvents. The resulting clause is called the Resolute.  Choosing the correct pair of resolvents is a matter of search.
  • 32. Predicate Calculus  Introduction through an example (Zohar Manna, 1974):  Problem: A, B and C belong to the Himalayan club. Every member in the club is either a mountain climber or a skier or both. A likes whatever B dislikes and dislikes whatever B likes. A likes rain and snow. No mountain climber likes rain. Every skier likes snow. Is there a member who is a mountain climber and not a skier?  Given knowledge has:  Facts  Rules
  • 33. Predicate Calculus: Example contd.  Let mc denote mountain climber and sk denotes skier. Knowledge representation in the given problem is as follows: 1. member(A) 2. member(B) 3. member(C) 4. ∀x[member(x) → (mc(x) ∨ sk(x))] 5. ∀x[mc(x) → ~like(x,rain)] 6. ∀x[sk(x) → like(x, snow)] 7. ∀x[like(B, x) → ~like(A, x)] 8. ∀x[~like(B, x) → like(A, x)] 9. like(A, rain) 10. like(A, snow) 11. Question: ∃x[member(x) ∧ mc(x) ∧ ~sk(x)]  We have to infer the 11th expression from the given 10.  Done through Resolution Refutation.
  • 34. Club example: Inferencing 1. member(A) 2. member(B) 3. member(C) 4. – Can be written as – 5. – 6. – 7. – ))]()(()([ xskxmcxmemberx ∨→∀ ))]()(()([ xskxmcxmember ∨→ )()()(~ xskxmcxmember ∨∨ )],()([ snowxlkxskx →∀ ),()(~ snowxlkxsk ∨ )],(~)([ rainxlkxmcx →∀ ),(~)(~ rainxlkxmc ∨ )],(~),([ xBlkxAlikex →∀ ),(~),(~ xBlkxAlike ∨
  • 35. 8. – 9. 10. 11. – Negate– )],(),([~ xBlkxAlkx →∀ ),(),( xBlkxAlk ∨ ),( rainAlk ),( snowAlk )](~)()([ xskxmcxmemberx ∧∧∃ )]()(~)([~ xskxmcxmemberx ∨∨∀
  • 36.  Now standardize the variables apart which results in the following 1. member(A) 2. member(B) 3. member(C) 4. 5. 6. 7. 8. 9. 10. 11. )()()(~ 111 xskxmcxmember ∨∨ ),()(~ 22 snowxlkxsk ∨ ),(~)(~ 33 rainxlkxmc ∨ ),(~),(~ 44 xBlkxAlike ∨ ),(),( 55 xBlkxAlk ∨ ),( rainAlk ),( snowAlk )]()(~)([~ 666 xskxmcxmemberx ∨∨∀
  • 37. ),(~),(~ 44 xBlkxAlike ∨ ),( snowAlk ),(~ snowBlk ),()(~ 22 snowxlkxsk ∨ )()()(~ 111 xskxmcxmember ∨∨)(~ Bsk )()(~ BmcBmember ∨ )(Bmember )(Bmc)]()(~)([~ 666 xskxmcxmemberx ∨∨∀ )()(~ BskBmember ∨ )(~ Bsk )(~ Bmember )(Bmember 7 10 12 5 13 4 14 2 11 15 16 13 17 2
  • 38. Assignment  Prove the inferencing in the Himalayan club example with different starting points, producing different resolution trees.  Think of a Prolog implementation of the problem  Prolog Reference (Prolog by Chockshin & Melish)
  • 40. A “department” environment 1. Dr. X is the HoD of CSE 2. Y and Z work in CSE 3. Dr. P is the HoD of ME 4. Q and R work in ME 5. Y is married to Q 6. By Institute policy staffs of the same department cannot marry 7. All married staff of CSE are insured by LIC 8. HoD is the boss of all staff in the department
  • 42. Questions on “department”  Who works in CSE?  Is there a married person in ME?  Is there somebody insured by LIC?
  • 43. Problem-3 (Zohar Manna, Mathematical Theory of Computation, 1974) From Propositional Calculus
  • 44. Tourist in a country of truth- sayers and liers  Facts and Rules: In a certain country, people either always speak the truth or always lie. A tourist T comes to a junction in the country and finds an inhabitant S of the country standing there. One of the roads at the junction leads to the capital of the country and the other does not. S can be asked only yes/no questions.  Question: What single yes/no question can T ask of S, so that the direction of the capital is revealed?
  • 45. Diagrammatic representation S (either always says the truth Or always lies) T (tourist) Capital
  • 46. Deciding the Propositions: a very difficult step- needs human intelligence  P: Left road leads to capital  Q: S always speaks the truth
  • 47. Meta Question: What question should the tourist ask  The form of the question  Very difficult: needs human intelligence  The tourist should ask  Is R true?  The answer is “yes” if and only if the left road leads to the capital  The structure of R to be found as a function of P and Q
  • 48. A more mechanical part: use of truth table P Q S’s Answer R T T Yes T T F Yes F F T No F F F No T
  • 49. Get form of R: quite mechanical  From the truth table  R is of the form (P x-nor Q) or (P ≡ Q)
  • 50. Get R in English/Hindi/Hebrew…  Natural Language Generation: non-trivial  The question the tourist will ask is  Is it true that the left road leads to the capital if and only if you speak the truth?  Exercise: A more well known form of this question asked by the tourist uses the X-OR operator instead of the X-Nor. What changes do you have to incorporate to the solution, to get that answer?
  • 52. Another tourist example: this time in a restaurant setting in a different country (Manna, 1974)  Facts: A tourist is in a restaurant in a country when the waiter tells him:  “do you see the three men in the table yonder? One of them is X who always speaks the truth, another is Y who always lies and the third is Z who sometimes speaks the truth and sometimes lies, i.e., answers yes/no randomly without regard to the question.  Question: Can you (the tourist) ask three yes/no questions to these men, always indicating who should answer the question, and determine who of them is X, who y and who Z?
  • 53. Solution: Most of the steps are doable by humans only  Number the persons: 1, 2, 3  1 can be X/Y/Z  2 can be X/Y/Z  3 can be X/Y/Z  Let the first question be to 1  One of 2 and 3 has to be NOT Z.  Critical step in the solution: only humans can do?
  • 54. Now cast the problem in the same setting as the tourist and the capital example  Solving by analogy  Use of previously solved problems  Hallmark of intelligence
  • 55. Analogy with the tourist and the capital problem  Find the direction to the capital   Find Z; who amongst 1, 2 and 3 is Z?  Ask a single yes/no question to S (the person standing at the junction)   Ask a single yes/no question to 1  Answer forced to reveal the direction of the capital   Answer forced to reveal who from 1,2,3 is Z
  • 56. Question to 1  Ask “Is R true” and the answer is yes if and only if 2 is not Z  Propositions  P: 2 is not Z  Q: 1 always speaks the truth, i.e., 1 is X
  • 57. Use of truth table as before P Q 1’s Answer R T T Yes T T F Yes F F T No F F F No T
  • 58. Question to 1: the first question  Is it true that 2 is not Z if and only if you are X?
  • 59. Analysis of 1’s answer  Ans= yes  Case 1: 1 is X/Y (always speaks the truth or always lies)  2 is indeed not Z (we can trust 1’s answer)  Case 2: 1 is Z  2 is indeed not Z (we cannot trust 1’s answer; but that does not affect us)
  • 60. Analysis of 1’s answer (contd)  Ans= no  Case 1: 1 is X/Y (always speaks the truth or always lies)  2 is Z; hence 3 is not Z  Case 2: 1 is Z  3 is not Z Note carefully: how cleverly Z is identified. Can a machine do it?
  • 61. Next steps: ask the 2nd question to determine X/Y  Once “Not Z” is identified- say 2, ask him a tautology  Is P≡P  If yes, 2 is X  If no, 2 is Y
  • 62. Ask the 3rd Question  Ask 2 “is 1 Z”  If 2 is X  Ans=yes, 1 is Z  Ans=no, 1 is Y  If 2 is Y (always lies)  Ans=yes, 1 is X  Ans=no, 1 is Z  3 is the remaining person
  • 63. What do these examples show?  Logic systematizes the reasoning process  Helps identify what is mechanical/routine/automatable  Brings to light the steps that only human intelligence can perform  These are especially of foundational and structural nature (e.g., deciding what propositions to start with)  Algorithmizing reasoning is not trivial