Difference between Forward and backward chaining in Pega

Introduction In this post we will see how to configure a declare expression rule in Pega. It is mainly used in computing property value based on expression.This rule comes under declarative category.It executes declarative and hence there is no need  to call these rules manually. We can just configure the rules and no need to …

How to configure declare expression in Pega Read More »

Difference between Backward and Forward Chaining.

Improve Article

Save Article

Like Article

  • Difficulty Level : Easy
  • Last Updated : 16 Jul, 2020

  • Read
  • Discuss
  • Courses
  • Practice
  • Video
  • Improve Article

    Save Article

    Forward Chaining and Backward Chaining are the two most important strategies in the field of Artificial Intelligence and lie in the Expert System Domain of AI.
    Forward and Backward chaining is the strategies used by the Inference Engine in making the deductions.

    Inference Engine:
    Inference Engine is a component of the expert system that applies logical rules to the knowledge base to deduce new information. It interprets and evaluates the facts in the knowledge base in order to provide an answer.
    A knowledgebase is a structured collection of facts about the system’s domain.

    Forward Chaining:
    Forward Chaining the Inference Engine goes through all the facts, conditions and derivations before deducing the outcome i.e When based on available data a decision is taken then the process is called as Forwarding chaining, It works from an initial state and reaches to the goal(final decision).

    Example:
    A
    A -> B
    B
    —————————–
    He is running.
    If he is running, he sweats.
    He is sweating.

    Backward Chaining:
    In this, the inference system knows the final decision or goal, this system starts from the goal and works backwards to determine what facts must be asserted so that the goal can be achieved, i.e it works from goal(final decision) and reaches the initial state.

    Example:
    B
    A -> B
    A
    —————————–
    He is sweating.
    If he is running, he sweats.
    He is running.

    Difference between Forwarding Chaining and Backward Chaining:

    Forward ChainingBackward Chaining1.When based on available data a decision is taken then the process is called as Forward chaining.Backward chaining starts from the goal and works backward to determine what facts must be asserted so that the goal can be achieved.2.Forward chaining is known as data-driven technique because we reaches to the goal using the available data.Backward chaining is known as goal-driven technique because we start from the goal and reaches the initial state in order to extract the facts.3.It is a bottom-up approach.It is a top-down approach.4.It applies the Breadth-First Strategy.It applies the Depth-First Strategy.5.Its goal is to get the conclusion.Its goal is to get the possible facts or the required data.6.Slow as it has to use all the rules.Fast as it has to use only a few rules.7.It operates in forward direction i.e it works from initial state to final decision.It operates in backward direction i.e it works from goal to reach initial state.8.Forward chaining is used for the planning, monitoring, control, and interpretation application.It is used in automated inference engines, theorem proofs, proof assistants and other artificial intelligence applications.

    My Personal Notes arrow_drop_up

    Save

    Please Login to comment...

    Here, we can observe that whenever the cost or quantity changes the total prices gets calculated based on the expression used in declare expression rule.

    2.Backward Chaining:

    It is exactly opposite to farward chaining.There are many ways by which backward chaining gets triggered.

    Total Price = Cost * Quantity

    let us consider the same example that we have taken above, whenever the total price is null the declare expression checks for the input properties. (Cost & quantity).Let us consider cost is calculated as

    Cost = Best Price - Discount

    Now declare expression tries to get the cost value if it is null, it is like going backward & backward until it gets all the required values to calculate the target property.

    Following is the difference between the forward chaining and backward chaining:

    • Forward chaining as the name suggests, start from the known facts and move forward by applying inference rules to extract more data, and it continues until it reaches to the goal, whereas backward chaining starts from the goal, move backward by using inference rules to determine the facts that satisfy the goal.
    • Forward chaining is called a data-driven inference technique, whereas backward chaining is called a goal-driven inference technique.
    • Forward chaining is known as the down-up approach, whereas backward chaining is known as a top-down approach.
    • Forward chaining uses breadth-first search strategy, whereas backward chaining uses depth-first search strategy.
    • Forward and backward chaining both applies Modus ponens inference rule.
    • Forward chaining can be used for tasks such as planning, design process monitoring, diagnosis, and classification, whereas backward chaining can be used for classification and diagnosis tasks.
    • Forward chaining can be like an exhaustive search, whereas backward chaining tries to avoid the unnecessary path of reasoning.
    • In forward-chaining there can be various ASK questions from the knowledge base, whereas in backward chaining there can be fewer ASK questions.
    • Forward chaining is slow as it checks for all the rules, whereas backward chaining is fast as it checks few required rules only.
    S. No.Forward ChainingBackward Chaining1.Forward chaining starts from known facts and applies inference rule to extract more data unit it reaches to the goal.Backward chaining starts from the goal and works backward through inference rules to find the required facts that support the goal.2.It is a bottom-up approachIt is a top-down approach3.Forward chaining is known as data-driven inference technique as we reach to the goal using the available data.Backward chaining is known as goal-driven technique as we start from the goal and divide into sub-goal to extract the facts.4.Forward chaining reasoning applies a breadth-first search strategy.Backward chaining reasoning applies a depth-first search strategy.5.Forward chaining tests for all the available rulesBackward chaining only tests for few required rules.6.Forward chaining is suitable for the planning, monitoring, control, and interpretation application.Backward chaining is suitable for diagnostic, prescription, and debugging application.7.Forward chaining can generate an infinite number of possible conclusions.Backward chaining generates a finite number of possible conclusions.8.It operates in the forward direction.It operates in the backward direction.9.Forward chaining is aimed for any conclusion.Backward chaining is only aimed for the required data.

    What is forward & backward chaining?

    Forward chaining is known as data-driven technique because we reaches to the goal using the available data. Backward chaining is known as goal-driven technique because we start from the goal and reaches the initial state in order to extract the facts.

    What is the difference between forward and backward commands?

    Answer. Explanation: The forward reasoning is data-driven approach while backward reasoning is a goal driven.

    What is forward chaining used for?

    Forward chaining is used to break down the logic sequence and work through it from beginning to end by attaching each step after the previous one is solved.

    What is the purpose of backward chaining?

    Backward chaining is the logical process of inferring unknown truths from known conclusions by moving backward from a solution to determine the initial conditions and rules. Backward chaining is often applied in artificial intelligence (AI) and may be used along with its counterpart, forward chaining.