written 6.2 years ago by |
Example: Consider simple example. Let’s understand how the same example can be solved using both forward and backward chaining.
Given facts:
It is a crime for an American to sell weapons to the enemy of America.
Country Nono is an enemy of America.
Nono has some missiles.
All the missiles were sold to No by Colonel West.
Missile is a weapon.
Colonel West is American.
We have to prove that West is criminal.
Let’s see how to represent these facts by FOL.
It is a crime for an American to sell weapons to the enemy nations.
American (x) ^Weapon(y) ^ sell (x.y.z) ^ enemy (z, America) => Criminal(x).
Country Nono is an enemy of America.
Enemy (Nonk, America)
Nono has some missiles.
Owns (Nono, x)
Missile(x)
- All the missiles were sold to Nono by Colonel West.
Missile(x) ^ owns(Nono,x) => Sell(West,x, Nono)
- Missile is a weapon.
Missile(x)=> weapon(x)
- Colonel West is American.
American (West).
Proof by forward chaining: The proof will start from the given facts. And we can derive other facts from those, it will lead us to the Solution. Answer observe from facts we can reach to the predicate Criminal (West).
Proof by backward chaining: This proof will start from the fact to be proved. And we can map it with given facts, it will lead us to the solution. As from e.g. we observe all leaf nodes of proof are given facts that mean ”West is Criminal”.