2080 8

BIT252 ยท 2080 ยท 5 marks

Distinguish between backward chaining and forward chaining with an example.

Distinguish between backward chaining and forward chaining with an example. [5]

Artificial IntelligenceChapter 5: Reasoning and InferenceBackward chaining

Quick answer

Forward chaining starts from known facts and applies inference rules to derive new facts, moving forward toward the goal.

Backward Chaining vs Forward Chaining

Forward Chaining (Data-Driven Reasoning)

  • It is a bottom-up approach
  • Begins with available data/facts
  • Fires rules whose conditions are satisfied
  • Continues until the goal is reached or no more rules can fire
  • Used when: all data is available and we want to derive conclusions

Backward Chaining (Goal-Driven Reasoning)

Backward chaining starts from the goal and works backward to find the facts that support it.

  • It is a top-down approach
  • Begins with the goal to be proved
  • Breaks the goal into sub-goals
  • Continues until all sub-goals are satisfied by known facts
  • Used when: the goal is clear and we want to verify it

Key Differences

FeatureForward ChainingBackward Chaining
DirectionFacts โ†’ GoalGoal โ†’ Facts
ApproachBottom-upTop-down
Driven byDataGoal
Starting pointKnown factsHypothesis/Goal
UsageWhen facts are givenWhen goal is specific
May deriveIrrelevant conclusionsOnly goal-relevant facts
Example systemCLIPSProlog

Example

Given Rules and Facts:

  • Fact 1: It is raining
  • Fact 2: I have an umbrella
  • Rule 1: If it is raining AND I have an umbrella โ†’ I will not get wet
  • Rule 2: If I will not get wet โ†’ I will go outside
  • Goal: Will I go outside?

Forward Chaining Solution:

Start with known facts: {raining, have umbrella}

Step 1: Rule 1 fires (raining + have umbrella)
        โ†’ Derive: "will not get wet"

Step 2: Rule 2 fires (will not get wet)
        โ†’ Derive: "will go outside"

Goal REACHED: Yes, I will go outside.

Backward Chaining Solution:

Start with Goal: "Will I go outside?"

Step 1: To prove "go outside", need Rule 2
        โ†’ Sub-goal: Prove "will not get wet"

Step 2: To prove "will not get wet", need Rule 1
        โ†’ Sub-goals: Prove "raining" AND "have umbrella"

Step 3: Check facts:
        "raining" โ†’ TRUE (known fact)
        "have umbrella" โ†’ TRUE (known fact)

Goal PROVED: Yes, I will go outside.

Summary

Forward chaining is suitable when we have a set of facts and want to derive all possible conclusions. Backward chaining is suitable when we have a specific goal and want to verify whether it can be supported by existing facts. Both are fundamental inference strategies used in expert systems and AI rule-based reasoning.

Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.