Predicate

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

PREDICATE LOGIC

- Shubhankar Acharyya
AIML’26
Predicate Logic
• Introduction
• Example of reasoning
• Instance and Isa representations
• Computable functions & Predicates
Intro to Predicate Logic

It is a formal system used in AI to represent and reason about statements involving quantified variables and
predicates.
In Predicate Logic:
1. Variables: Variables are placeholders that can take on values from a specified domain. For example, in the
statement "x is greater than y," x and y are variables.
2. Predicates: Predicates are expressions that can be true or false depending on the values of their arguments.
They represent properties or relations between objects. For example, "P(x)" might represent "x is a prime number."
3. Quantifiers: Quantifiers specify the scope of variables in logical statements. The two most common quantifiers
are the universal quantifier (∀), which asserts that a statement holds for all values of a variable, and the existential
quantifier (∃), which asserts that a statement holds for at least one value of a variable.

Predicate logic allows for the formal representation of complex statements and relationships. It forms the basis for
many AI systems, including expert systems, automated reasoning, and natural language understanding. By using
predicate logic, AI systems can manipulate symbols and make inferences about the world.
Example of Reasoning

Facts Feeding :
1. Marcus was a man. ……………………… man(Marcus)
2. Marcus was a Pompeian. …………….. Pompeian(Marcus)
3. All Pompeian were Romans. ……….. ∀x : Pompeian(x)  Roman(x)
4. Caesar was a ruler…………………………. ruler (Caesar)
5. All Romans were either loyal to Caeser or hated him.
∀x : Roman(x)  loyalto ( x, Caeser) V hate( x, Caeser )
6. Everyone is loyal to someone. ……… ∀x : ∃y : loyalto (x,y)
7. People only try to assassinate rulers they are not loyal to.
∀x : ∀y : person(x) Λ ruler(y) Λ tryassassinate (x,y)  ¬ loyalto ( x, y)
8. Marcus tried to assassinate Caeser.
tryassassinate (Marcus ,Caesar )
9. All men are people. …………………….. ∀x : man(x)  person (x)
Now let’s look how reasoning is done using these facts………
Example of Reasoning

Reasoning :
Q. Was Marcus loyal to Caeser?
¬ loyalto (Marcus, Caeser)
↑ ( 7, Subs tu on )
person(Marcus) Λ ruler(Caesar) Λ tryassassinate (Marcus , Ceasar)
↑4
person(Marcus) Λ tryassassinate (Marcus , Ceasar)
↑8
person( Marcus)
↑ (9, Subs tu on)
man( Marcus)

[ ](nil)
Instance and Isa
Relationships
The specific attributes ‘instance’ and ‘isa’ play an important role of property inheritance.
There are three way of representation of class memberships.

1. man(Marcus)
Pompeian(Marcus)
∀x : Pompeian(x)  Roman(x)
ruler (Caesar)
∀x : Roman(x)  loyalto ( x, Caeser) V hate( x, Caeser )

Here class membership is represented with unary predicates each corresponds to a class . Asserting that
P(x) is true is equiv to asserting that x is an instance of P.
Instance and Isa
Relationships
2. Instance (Marcus , man)
Instance (Marcus , Pompeian)
∀x : Instance ( x, Pompeian)  Instance ( x, Roman)
Instance(Caesar , ruler)
and so on like that…
Here we use the instance predicate explicitly . The predicate instance is a binary one , whose first argument
is an object and whose second argument is a class in which the object belongs to.
3. Instance (Marcus , man)
Instance (Marcus , Pompeian)
isa ( Pompeian , Roman)
Instance(Caesar , ruler)
This representation contains both instance and isa predicate explicitly.
Computable Functions and
Predicates
1. Marcus was born in 40 AD. ………………………………………… born(Marcus,40)
2. All men are mortal. ……………………………………………………. ∀x: man(x)  mortal(x)
3. All Pompeian died when the volcano er↑ted in 79 AD.
erupted(volcano,79) Λ ∀x:[pompeian(x)  died(x,79)]
4. No mortal lives longer than 150 years.
∀x:∀t1:∀t2:mortal(x) Λ born(x,t1) Λ gt (t2-t1,150)  dead (x,t2)
5. It is now 2024. …………………………………………………………. now=2024
6. Alive means not dead.
∀x:∀t: [alive(x,t)  ¬ dead(x,t)] Λ [¬ dead(x,t)alive(x,t)]
7. If someone dies, then he is dead at all later times.
∀x:∀t1:∀t2:died(x,t1) Λ gt(t2,t1)dead(x,t2)
8. man(Marcus).
9. pompeian(Marcus)
Q. Is Marcus alive?
So we Have to prove ¬ alive(Marcus ,now)
¬ alive (Marcus, now)
↑ (6, Substitution)
dead (Marcus ,now)
↑ (7, subs tu on)
died (Marcus, t1) Λ gt (now ,t1)
↑ (3, Substitution)
pompeian (Marcus) Λ gt (now ,79)
↑ (9)
gt (now,79)
↑ (5, Subs tute equals)
gt (1991,79)
↑ (Compute gt)
[]

You might also like