SlideShare a Scribd company logo
1 of 21
First-Order Logic
Chapter 8
Problem of Propositional Logic
 Propositional logic has very limited expressive
power
– E.g., cannot say "pits cause breezes in adjacent
squares“ except by writing one sentence for each
square.
– We want to be able to say this in one single sentence:
“for all squares and pits, pits cause breezes in adjacent
squares.
– First order logic will provide this flexibility.
First-order logic
• Propositional logic assumes the world
contains facts that are true or false.
• First-order logic
assumes the world contains
– Objects: people, houses, numbers, colors,
baseball games, wars, …
– Relations between objects: red, round, prime,
brother of, bigger than, part of, comes
between, …
Relations
• Some relations are properties: they state
some fact about a single object:
Round(ball), Prime(7).
• n-ary relations state facts about two or
more objects: Married(John,Mary),
Largerthan(3,2).
• Some relations are functions: their value is
another object: Plus(2,3), Father(Dan).
Models for FOL: Example
Atomic Sentences
• Sentences in logic state facts that are true or false.
• Properties and n-ary relations do just that:
LargerThan(2,3) (means 2>3) is false.
Brother(Mary,Pete) is false.
• Note: Functions do not state facts and form no sentence:
Brother(Pete) refers to the object John (his brother) and
is neither true nor false.
• Brother(Pete,Brother(Pete)) is True.
Binary relation Function
Complex Sentences
• We make complex sentences with
connectives (just like in proposition logic).
( ( ), ) ( ( ))
Brother LeftLeg Richard John Democrat Bush
 
binary
relation
function property
objects
connectives
Quantification
• Round(ball) is true or false because we
give it a single argument (ball).
• We can be much more flexible if we allow
variables which can take on values in a
domain. e.g. reals x, all persons P, etc.
• To construct logical sentences we need a
quantifier to make it true or false.
Quantifier
• Is the following true or false?
• To make it true or false we use
5,
x x R
 
and
 
2
[( 2) ( 3)] ( )
[( 1)] ( )
x x x x R false
x x x R false
    
   
For all real x, x>2 implies x>3. There exists some real x which square is minus 1.
Nested Quantifiers
• Combinations of universal and existential
quantification are possible:
( , ) ( , )
( , ) ( , )
( , ) ( , )
( , ) ( , )
, { }
x y Father x y y x Father x y
x y Father x y y x Father x y
x y Father x y y x Father x y
x y Father x y y x Father x y
x y All people
    
    
    
    

Quiz :which is which: Everyone is the father of someone.
Everyone has everyone as a father
There is a person who has everyone as a father.
There is a person who has a father
There is a person who is the father of everyone.
Everyone has a father.
Binary relation:
“x is a father of y”.
De Morgan’s Law for Quantifiers
( )
( )
( )
( )
x P x P
x P x P
x P x P
x P x P
  
  
  
  
( )
( )
( )
( )
P Q P Q
P Q P Q
P Q P Q
P Q P Q
     
     
     
     
De Morgan’s Rule Generalized De Morgan’s Rule
Rule is simple: if you bring a negation inside a disjunction or a conjunction,
always switch between them (or and, and  or).
• Equality symbol: Father(John)=Henry.
This relates two objects.
Common mistakes to avoid
•  is the main connective with 
• is the main connective with
, ( ) ( ) { , , }
, ( ) ( )
, ( ) ( )
, ( ) ( )
x King x Person x x Pete Mary tablespoon
x King x Person x
x King x Person x
x King x Person x
  
 
 
 
 
All of these must be true!
King(Pete) AND Person(Pete)
King(Mary) AND Person(Mary)
King(Tablespoon) AND Person(Tablespoon)
One of these should be true!
if King(Pete) then Person(Pete)
if King(Mary) then Person(Mary)
If King(Tablespoon) then Person(Tablespoon)
too strong
too weak
Using FOL
• We want to TELL things to the KB, e.g.
TELL(KB, )
• We also want to ASK things to the KB,
ASK(KB, )
• The KB should return the list of x’s for
which Person(x) is true: {x/John,x/Richard,...}
, ( ) ( )
x King x Person x
 
, ( )
x Person x

Examples
The kinship domain:
• Brothers are siblings
x,y Brother(x,y) => Sibling(x,y)
• One's mother is one's female parent
m,c Mother(c) = m  (Female(m)  Parent(m,c))
• “Sibling” is symmetric
x,y Sibling(x,y)  Sibling(y,x)
Some may be considered axioms, others as theorems which can be derived
from the axioms.
First order logic.ppt
First order logic.ppt
First order logic.ppt
First order logic.ppt
First order logic.ppt
First order logic.ppt
First order logic.ppt

More Related Content

Similar to First order logic.ppt

Theory of first order logic
Theory of first order logicTheory of first order logic
Theory of first order logicDevaddd
 
Logic programming (1)
Logic programming (1)Logic programming (1)
Logic programming (1)Nitesh Singh
 
Knowledge representation and Predicate logic
Knowledge representation and Predicate logicKnowledge representation and Predicate logic
Knowledge representation and Predicate logicAmey Kerkar
 
First order logic in knowledge representation
First order logic in knowledge representationFirst order logic in knowledge representation
First order logic in knowledge representationSabaragamuwa University
 
Lec 7 genetic algorithms
Lec 7 genetic algorithmsLec 7 genetic algorithms
Lec 7 genetic algorithmsEyob Sisay
 
Inference in First-Order Logic
Inference in First-Order Logic Inference in First-Order Logic
Inference in First-Order Logic Junya Tanaka
 
Overview prolog
Overview prologOverview prolog
Overview prologFraboni Ec
 
Class first order logic
Class first order logicClass first order logic
Class first order logicchandsek666
 
Predicate calculus up
Predicate calculus upPredicate calculus up
Predicate calculus upHywel Evans
 
اجابات البرولوج
اجابات البرولوجاجابات البرولوج
اجابات البرولوجAmmar Khalid
 
AI NOTES ppt 4.pdf
AI NOTES ppt 4.pdfAI NOTES ppt 4.pdf
AI NOTES ppt 4.pdfARMANVERMA7
 
Overview prolog
Overview prologOverview prolog
Overview prologDavid Hoen
 
Overview prolog
Overview prologOverview prolog
Overview prologJames Wong
 

Similar to First order logic.ppt (20)

Theory of first order logic
Theory of first order logicTheory of first order logic
Theory of first order logic
 
Logic programming (1)
Logic programming (1)Logic programming (1)
Logic programming (1)
 
Knowledge representation and Predicate logic
Knowledge representation and Predicate logicKnowledge representation and Predicate logic
Knowledge representation and Predicate logic
 
Fol
FolFol
Fol
 
First order logic in knowledge representation
First order logic in knowledge representationFirst order logic in knowledge representation
First order logic in knowledge representation
 
Lec 7 genetic algorithms
Lec 7 genetic algorithmsLec 7 genetic algorithms
Lec 7 genetic algorithms
 
lect14-semantics.ppt
lect14-semantics.pptlect14-semantics.ppt
lect14-semantics.ppt
 
Inference in First-Order Logic
Inference in First-Order Logic Inference in First-Order Logic
Inference in First-Order Logic
 
Logic
LogicLogic
Logic
 
Overview prolog
Overview prologOverview prolog
Overview prolog
 
Class first order logic
Class first order logicClass first order logic
Class first order logic
 
Predicate calculus up
Predicate calculus upPredicate calculus up
Predicate calculus up
 
اجابات البرولوج
اجابات البرولوجاجابات البرولوج
اجابات البرولوج
 
AI NOTES ppt 4.pdf
AI NOTES ppt 4.pdfAI NOTES ppt 4.pdf
AI NOTES ppt 4.pdf
 
Ai quantifiers
Ai quantifiersAi quantifiers
Ai quantifiers
 
Overview prolog
Overview prologOverview prolog
Overview prolog
 
Overview prolog
Overview prologOverview prolog
Overview prolog
 
Overview prolog
Overview prologOverview prolog
Overview prolog
 
Overview prolog
Overview prologOverview prolog
Overview prolog
 
Overview prolog
Overview prologOverview prolog
Overview prolog
 

Recently uploaded

OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 

Recently uploaded (20)

OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 

First order logic.ppt

  • 2. Problem of Propositional Logic  Propositional logic has very limited expressive power – E.g., cannot say "pits cause breezes in adjacent squares“ except by writing one sentence for each square. – We want to be able to say this in one single sentence: “for all squares and pits, pits cause breezes in adjacent squares. – First order logic will provide this flexibility.
  • 3. First-order logic • Propositional logic assumes the world contains facts that are true or false. • First-order logic assumes the world contains – Objects: people, houses, numbers, colors, baseball games, wars, … – Relations between objects: red, round, prime, brother of, bigger than, part of, comes between, …
  • 4. Relations • Some relations are properties: they state some fact about a single object: Round(ball), Prime(7). • n-ary relations state facts about two or more objects: Married(John,Mary), Largerthan(3,2). • Some relations are functions: their value is another object: Plus(2,3), Father(Dan).
  • 5. Models for FOL: Example
  • 6. Atomic Sentences • Sentences in logic state facts that are true or false. • Properties and n-ary relations do just that: LargerThan(2,3) (means 2>3) is false. Brother(Mary,Pete) is false. • Note: Functions do not state facts and form no sentence: Brother(Pete) refers to the object John (his brother) and is neither true nor false. • Brother(Pete,Brother(Pete)) is True. Binary relation Function
  • 7. Complex Sentences • We make complex sentences with connectives (just like in proposition logic). ( ( ), ) ( ( )) Brother LeftLeg Richard John Democrat Bush   binary relation function property objects connectives
  • 8. Quantification • Round(ball) is true or false because we give it a single argument (ball). • We can be much more flexible if we allow variables which can take on values in a domain. e.g. reals x, all persons P, etc. • To construct logical sentences we need a quantifier to make it true or false.
  • 9. Quantifier • Is the following true or false? • To make it true or false we use 5, x x R   and   2 [( 2) ( 3)] ( ) [( 1)] ( ) x x x x R false x x x R false          For all real x, x>2 implies x>3. There exists some real x which square is minus 1.
  • 10. Nested Quantifiers • Combinations of universal and existential quantification are possible: ( , ) ( , ) ( , ) ( , ) ( , ) ( , ) ( , ) ( , ) , { } x y Father x y y x Father x y x y Father x y y x Father x y x y Father x y y x Father x y x y Father x y y x Father x y x y All people                      Quiz :which is which: Everyone is the father of someone. Everyone has everyone as a father There is a person who has everyone as a father. There is a person who has a father There is a person who is the father of everyone. Everyone has a father. Binary relation: “x is a father of y”.
  • 11. De Morgan’s Law for Quantifiers ( ) ( ) ( ) ( ) x P x P x P x P x P x P x P x P             ( ) ( ) ( ) ( ) P Q P Q P Q P Q P Q P Q P Q P Q                         De Morgan’s Rule Generalized De Morgan’s Rule Rule is simple: if you bring a negation inside a disjunction or a conjunction, always switch between them (or and, and  or). • Equality symbol: Father(John)=Henry. This relates two objects.
  • 12. Common mistakes to avoid •  is the main connective with  • is the main connective with , ( ) ( ) { , , } , ( ) ( ) , ( ) ( ) , ( ) ( ) x King x Person x x Pete Mary tablespoon x King x Person x x King x Person x x King x Person x            All of these must be true! King(Pete) AND Person(Pete) King(Mary) AND Person(Mary) King(Tablespoon) AND Person(Tablespoon) One of these should be true! if King(Pete) then Person(Pete) if King(Mary) then Person(Mary) If King(Tablespoon) then Person(Tablespoon) too strong too weak
  • 13. Using FOL • We want to TELL things to the KB, e.g. TELL(KB, ) • We also want to ASK things to the KB, ASK(KB, ) • The KB should return the list of x’s for which Person(x) is true: {x/John,x/Richard,...} , ( ) ( ) x King x Person x   , ( ) x Person x 
  • 14. Examples The kinship domain: • Brothers are siblings x,y Brother(x,y) => Sibling(x,y) • One's mother is one's female parent m,c Mother(c) = m  (Female(m)  Parent(m,c)) • “Sibling” is symmetric x,y Sibling(x,y)  Sibling(y,x) Some may be considered axioms, others as theorems which can be derived from the axioms.