Predicate (First Order) Logic
Predicate (First Order) Logic
Predicate (First Order) Logic
Equality
• term1 = term2 is true under a given interpretation if and only if
term1 and term2 refer to the same object
E.g., definition of Sibling in terms of Parent:
x,y Sibling(x,y) [(x = y) m,f (m = f) Parent(m,x) Parent(f,x)
Parent(m,y) Parent(f,y)]
Translating English to FOL
• Every gardener likes the sun.
(x) gardener(x) => likes(x,Sun)
• Not Every gardener likes the sun.
~((x) gardener(x) => likes(x,Sun))
• You can fool some of the people all of the time.
(x)(t) person(x) ^ time(t) => can-be-fooled(x,t)
• You can fool all of the people some of the time.
(x)(t) person(x) ^ time(t) => can-be-fooled(x,t)
(the time people are fooled may be different)
• You can fool all of the people at some time.
(t)(x) person(x) ^ time(t) => can-be-fooled(x,t)
(all people are fooled at the same time)
• You can not fool all of the people all of the time.
~((x)(t) person(x) ^ time(t) => can-be-fooled(x,t))
• Everyone is younger than his father
(x) person(x) => younger(x, father(x))
Translating English to FOL
• All purple mushrooms are poisonous.
(x) (mushroom(x) ^ purple(x)) => poisonous(x)
• No purple mushroom is poisonous.
~(x) purple(x) ^ mushroom(x) ^ poisonous(x)
(x) (mushroom(x) ^ purple(x)) => ~poisonous(x)
• There are exactly two purple mushrooms.
(x)(Ey) mushroom(x) ^ purple(x) ^ mushroom(y) ^ purple(y) ^ ~(x=y) ^
(z) (mushroom(z) ^ purple(z)) => ((x=z) v (y=z))
• Clinton is not tall.
~tall(Clinton)
• X is above Y if X is directly on top of Y or there is a
pile of one or more other objects directly on top of
one another starting with X and ending with Y.
(x)(y) above(x,y) <=> (on(x,y) v (z) (on(x,z) ^ above(z,y)))
Sentence structure
In FOL the basic unit is a predicate (argument/terms)
structure called sentence to represent facts.
• Terms refers to objects
Example: likes(muhe, chocolate); tall(fred)
–Terms or arguments can be any of: Constant symbol, such
as ‘muhe’, variable symbol, such as X , functions, such as
motherof(fred), father-of( father-of( john))
• A predicate is the one that says something about the
subject. E.g., The book is red
• Subject: color of the book, represented as: is-red(book)
• is-red: predicate, and book: argument
–Predicate also refers to a particular relation between objects
• Example: likes(X, richard)
friends(motherof(jonas), motherof(semu))
–A predicate statement takes the value true or false
Sentences
Atomic sentences: formed from a predicate symbol
followed by a parenthesized list of terms
Atomic sentence = predicate (term1,...,termn)
Example: Brother(John, Richard)
• Atomic sentences can have arguments that are complex terms
(e.g. term = function (term1,...,termn) )
Example: married(fatherof(Richard),motherof(John))
Complex sentences: complex sentences are made by
combining atomic sentences using connectives:
S, S1 S2, S1 S2, S1 S2, S1 S2,
Ex. likes(john, mary) V tall(mary)
tall(john) V handsome(john)
Sibling(John, Richard) Sibling(Richard, John)
• Sentences can also be formed using quantifiers to indicate how
to treat variables:
– Universal quantifier: x lovely(x) - Everything is lovely.
– Existential quantifier: x lovely(x) - Something is lovely.
Semantics
•There is a precise meaning to expressions in predicate logic.
•Like in propositional logic, it is all about determining whether
something is true or false.
x P(x) means that P(x) must be true for every object x in the
domain of interest.
x P(x) means that P(x) must be true for at least one object x in
the domain of interest.
– So if we have a domain of interest consisting of just two people, john
and mary, and we know that tall(mary) and tall(john) are true,
we can say that x tall(x) is true.
•Atomic sentence is true if the relation referred by the
predicate holds b/n the objects referred by the arguments
brother(John, Richard)
•The truth value of complex sentences depends on logical
connectives used
older(John,30) younger(John,30)
Inference in First Order Logic
• We saw inference rules for propositional logic
• These rules hold for first-order logic as well
• We, however, need additional inference rules to handle
1st order logic sentence with quantifiers