You are on page 1of 26

Predicate logic – First Order Logic (FOL)

Logic
Just like algebra is a type of formal logic that deals
with numbers, e.g. 2+4 = 6, propositional logic and
predicate calculus are forms of formal logic for dealing
with propositions. We will consider two basic logic
representation techniques:
1. Propositional Logic
2. Predicate Calculus (FOL)
Propositional logic
A proposition is the statement of a fact.
Propositional logic allows partial/disjunctive/negated
information
Propositional logic is declarative
Propositional logic is compositional:
Meaning of B  P is derived from meaning of B and
1,1 1,2 1,1
of P1,2
Propositional logic is context-independent
Unlike natural language, where meaning depends on
context
Propositional logic has very limited expressive power.
Propositional logic
We usually assign a symbolic variable to represent a
proposition, e.g.
p = It is raining
q = I carry an umbrella
r = it is cloudy

S = IF it is raining Then carry an umbrella


p → q

t= IF it is raining or it is cloudy Then carry an umbrella


(p v r ) → q
Compound statements
Different propositions may be logically related and we
can form compound statements of propositions using
logical connectives. Common logical connectives are:
∧ AND (Conjunction)
∨ OR (Disjunction)
¬ NOT (Negation)
→ If … then (Conditional)
⇔ If and only if (bi-conditional)
Limitations of propositional logic
Propositions can only represent knowledge as
complete sentences, e.g. a = the ball’s color is blue
Cannot analyze the internal structure of the sentence
Propositional logic has very limited expressive power
 Unlike natural language

No quantifiers are available, e.g. for-all, there-exists


Propositional logic provides no framework for proving
statements such as:
All humans are mortal All women are humans
Predicate calculus
Also known as First-Order Logic
Predicate Calculus is an extension of propositional logic
that allows the structure of facts and sentences to be
defined. With predicate logic, we can use expressions like:
Color( ball, blue)
Representation language for AI
Advantages
Well-defined formal semantics
Sound and complete inference rules
Predicate calculus
Uses symbols to reason about things
Propositional symbols include P, Q, R
Truth symbols include true and false
Connectives include
, ,, 
First Order Logic
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, …
First Order Logic
In propositional calculus P denotes a proposition
of some complexity
P may stand for “it rained on Tuesday”
There is no way to access the individual components i.e.,
rain and Tuesday
Predicate calculus creates a relationship between
the components and then gives a truth value
Weather (Tuesday, rain)
Since Tuesday is a specific day so we can replace it with a
variable X
Weather (X, rain) means it rained every day
Weather (X, rain) where X = Tuesday is true
First Order Logic
All men are mortal, Socrates is a man. Therefore,
Socrates is mortal
Propositional logic yields
A, B  C
Predicate calculus yields
X ( Man( X )  Mortal ( X ))
Man( Socrates )
 Mortal ( Socrates )
This allows the relationship of sub-sentence units to
be expressed, e.g. the relationship between color, ball
and blue in the above example. Due to its greater
representational power, predicate calculus provides a
mechanism for proving statements and can be used as
a logic system for proving logical theorems.
Quantifiers
Predicate calculus allows us to use quantifiers for
statements. Quantifiers allow us to say things about
some or all objects within some set. The logical
quantifiers used in basic predicate calculus are
universal and existential quantifiers
Existential quantifier
First order predicate logic
First order predicate logic is the simplest form of predicate
logic. The main types of symbols used are
a) Constants are used to name specific objects or properties,
e.g. Ali, Ahmed, blue, box.
b) Predicates: A fact or proposition is divided into two parts
a) Predicate: the assertion of the proposition
b) Argument: the object of the proposition
For example, the proposition “Ali likes travelling” can be
represented in predicate logic as Likes (Ali, travelling), where
Likes is the predicate and Ali and travelling are the arguments.
Symbols
c) Variables: Variables are used to a represent general
class of objects/properties, e.g. in the predicate likes
(X, Y), X and Y are variables that assume the values
X=Ali and Y=bananas
d) Formulae: Formulas combine predicates and
quantifiers to represent information
Lets us illustrate these symbols using an example
The predicate section outlines the known facts about
the situation in the form of predicates, i.e. predicate
name and its arguments. So, man(ahmed) means that
ahmed is a man, hates(ahmed, chand) means that
ahmed hates chand.

You might also like