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

Predicate Calculus

Example#1
Example#1
Example#1
Example#2
Example#2
Example#2
Example#2 (Proof By Contradiction)
Example #3
[]
Forward and Backward Chaining in an Inference Engine
Inference Engine:
It is the component of the system that applies logical rules to the knowledge
base to deduce new information.

Forward Chaining
It starts with the known facts and assert new facts.

Backward Chaining
It starts with goal and works backward to determine what facts must be
asserted so that goals can be achieved.
Let’s assume the existance of following knowledge base:
• A^C→Y
• A^X→Z
• B→X
• Z→D
And the goal is D.

Forward Chaining: Let A and B are the given Forward Chaining: Let A and B are the given
facts to prove D. facts to prove D.
Proof:
B→X→Z→D D←Z←X←B
↑ ↑
A A
Forward Chaining
• When based on the available data a decision is taken, then the process is called as the forward
chaining.
• It starts with the initial state (i.e. the facts) and reaches at goal state.

1. It is a crime for an Russian to sell weapons to the enemy of Russia.


Russian(x) ^ Weapon(y) ^ Sell(x, y, z) ^ Enemy(z, Russia) → Criminal(x)
2. Seria is an enemy of Russia.
Enemy(Seria, Russia)
3. Seria has missile.
Missile(x) ^ Has(x, Seria)
4. The missile was sold to Seria by Joseph.
Missile(x) ^ Has(x, Seria) → Sell(Joseph, x, Seria)
5. Missile is a weapon.
Missile(x) → Weapon(x)
6. Joseph is a Russian.
Russian(Joseph)
Forward Chaining(contd...) Facts:
1. It is a crime for an Russian to sell weapons to the enemy of Russia.
Russian(x) ^ Weapon(y) ^ Sell(x, y, z) ^ Enemy(z,
{Russian(Joseph), Missile(x), Has(x, Seria),
Russia) → Criminal(x) Enemy(Seria, Russia)}
2. Seria is an enemy of Russia.
Enemy(Seria, Russia) To Prove:
3. Seria has missile.
Missile(x) ^ Has(x, Seria)
Joseph is a criminal.
4. The missile was sold to Seria by Joseph.
Missile(x) ^ Has(x, Seria) → Sell(Joseph, x, Seria)
5. Missile is a weapon.
Missile(x) → Weapon(x)
6. Joseph is a Russian.
Russian(Joseph)

Russian(Joseph) Missile(x) Has(x, Seria) Enemy(Seria, Russia)

Weapon(x) Sell(Joseph, x, Seria)

Criminal(Joseph)
Backward Chaining(contd...) Facts:
1. It is a crime for an Russian to sell weapons to the enemy of Russia.
Russian(x) ^ Weapon(y) ^ Sell(x, y, z) ^ Enemy(z,
{Russian(Joseph), Missile(x), Has(x, Seria),
Russia) → Criminal(x) Enemy(Seria, Russia)}
2. Seria is an enemy of Russia.
Enemy(Seria, Russia) To Prove:
3. Seria has missile.
Missile(x) ^ Has(x, Seria)
Joseph is a criminal.
4. The missile was sold to Seria by Joseph.
Missile(x) ^ Has(x, Seria) → Sell(Joseph, x, Seria)
5. Missile is a weapon.
Missile(x) → Weapon(x)
6. Joseph is a Russian.
Criminal(Joseph)
Russian(Joseph)

Russian(Joseph) Weapon(x) Sell(Joseph, x, Seria) Enemy(Seria, Russia)

Missile(x) Has(x, Seria)

You might also like