First Order Logic

First Order Logic
First Order Logic
(AKA-Predicate Calculus)
vs (Propositional Logic)
• Propositional Logic we talk about atomic facts
– Propositional logic has no objects.
– Because it has no objects it also has no relationships
between objects, or functions that names objects
• FOL- Stronger ontological commitment
– Objects (with individual identities)
– Objects have properties
– Relations between objects
• FOL is very well understood
First Order Logic Syntax
ForAll | ThereExists
First order logic has
• SENTENCES that represent Boolean facts
• TERMS which represent objects
• CONSTANTS and VARIABLES which represent
objects
• PREDICATE which given an object (I.e. TERM)
it returns true or false
• FUNCTIONS which given an object will return
another object
Details
– Informally: Objects like ColinPowell, Mars, Austrailia
– Variables: general use lower case letters
– Constants: Use uppercase, or starting with uppercase
– Formally Speaking a predicate is a set of tuples
• BrotherHoodPredicate={<KingJohn, RichardTheLionHeart>
< RichardTheLionHeart, KingJohn> }
Atomic Sentence
– Brother(Richard,John)
– Married(FatherOf(Richard),MotherOf(John))
– An atomic sentence is true iff the relation
referred to by the predicate holds between the
objects referred to by the arguments
Complex Sentences
•
•
•
•
•
And, OR, Implies and Not
Mother(Anne,Neil) ^ Mother(Anne,Eileen)
AtWar(USA) v AtPeace(USA)
Mother(Anne,Neil)Older(Anne,Neil)
¬Mother(Anne,GeorgeBush)
Universal Quantification
• <variables> <sentence>
• All students at WPI are smart.
• s at(s,WPI)=> smart(s)
• What does this mean?
• s at(s,WPI) ^ smart(s)
All objects are at WPI and all objects are smart
Existential Quantification
•  <variables> <sentence>
• There exist a student at MIT that is smart
•  s at(s,MIT) ^ smart(s)
• What does this mean?
•  s at(s,MIT) => smart(s)
If there is an object that is not at MIT then this
Formally Speaking
Equality
• Anne = Mother(Neil)
• How would you say that “Neil has at least two
sisters”
• Neil has at least 3 sisters.
• Define Sibling
ForAll x,y Sibling(x,y)  not(x=y)
AND [ThereExists p Parent(p,x)
AND Parent(p,y)]
Formally Speaking about
Equality
• Equality is the identify relation
– { <Neil, Neil>
<Tom, Tom>
<grape1, grape1>
…>
Practice
– Squares neighboring the Wumpus are smelly
– ForAll s1,s2
at(s1,Wumpus) ^ neighbor(s1,s2)=>smelly(s2)
Practice with the Kinship
Domain
• Sibling
• ForAll x,y Sibling(x,y) not(x=y) AND
[ThereExists p Parent(p,x) AND Parent(p,y)]
• Assume we have those on Page 198
• Define
–
–
–
–
–
–
Brother(x,y)
Sister(x,y)
Aunt(a,c)
BrotherInLaw(b,x)
Grandchild
GreatGrandParent