Forward chaining in AI with FOL proof
Forward Chaining is one of the two methodologies using an inference engine, the other one being backward Chaining. It starts with a base state and uses the inference rules and available knowledge in the forward direction till it reaches the end state. The process iterates till the final state is reached.
To get detailed knowledge of forward and Backward chaining refer to the link.
Now Let’s understand Forward chaining with FOL with an example:
We will list down the facts initially and then convert facts to First-order Logic (FOL) using inference laws until we reach the goal state.
Some Fact :
- It is crime for Americans to sell the weapon to the enemy of America
- Country Nono is an enemy of America
- Nono has some Missiles
- All missiles were sold to Nono by Colonel
- Colonel is American
- Missile is a weapon
Goal :
- Colonel is criminal
Steps to be followed :
Fact conversion to FOL:
Step1 : It is crime for Americans to sell the weapon to the enemy of America
Step2 : Country Nono is enemy of America
FOL : Enemy(Nono, America)
Step3 : Nono has some Missile
FOL : Owns(Nono ,x) Missile(x)
Step4 : All missiles were sold to Nono by Colonel
FOL : Missile(x) ^ Owns(Nono,x) → Sell(Colonel,x,Nono)
Step5 : Colonel is American
FOL : American(Colonel)
Step6 : Missile is weapon
FOL : Missile(x) → Weapon (x)
Proof:
Iteration 1:
- Start with the knowledge base/known facts : The facts that are not deduced from any other [ present in LHS of the statements ]
American(Colonel) | Missile(x) | Owns(Nono , x) | Enemy(Nono , America) |
- Add inferences one by one to link the connections
- Rule (1) doesn’t satisfy the so it will not be added
- Rule (2) and Rule(3) FOL are already added
- Rule (4) matches the inference so we will add it.
- Rule(5) doesn’t have RHS so nothing added
- Rule (6) has weapon in RHS derived from Missile(x) , which is already a part so we will add weapon in our next state
<image>
That completes our first iteration
Iteration 2:
- Rule(1) has all the LHS conditions satisfied as we can see in the first iteration. So all the four FOL in LHS are available, now we can add Criminal(x) from RHS in our next state
We reached the goal state to deduce that: Colonel is a criminal
Forward chaining is data driven since we use available data to reach the final state.
Contact Us