• Category
  • >Artificial Intelligence

Forward Chaining Vs Backward Chaining

  • Yashoda Gandhi
  • May 13, 2022
Forward Chaining Vs Backward Chaining title banner

The demand for expert systems is increasing rapidly these days, with more and more people demanding systems that provide quick and accurate solutions. 

 

Artificial intelligence (AI) is easily accomplishing this feat with the help of a variety of technologies that assist AI applications in performing a variety of tasks such as planning, classification, reasoning, and so on.

 

Forward and backward chaining are two important reasoning techniques used by expert systems to mimic human-like intelligence. The importance of Forward and Backward Chaining in expert systems is enormous, making it critical for us to understand their fundamentals.

 

This article provides an overview of these techniques as well as an explanation of how they work. Readers will have learned real-world examples of how backward and forward chaining are used in AI by the end of the article.

 

 

Introduction to Expert System

 

A brief overview of an expert system can provide more information about the origins of backward and forward chaining in AI.

 

An expert system is a computer programme that uses rules, approaches, and facts to solve complex problems. MYCIN and DENDRAL are two examples of expert systems. To diagnose bacterial infections, MYCIN employs the backward chaining technique. DENDRAL uses forward chaining to create chemical structures.

 

An expert system is made up of three parts: a user interface, an inference engine, and a knowledge base. The user interface allows system users to interact with the expert system. The knowledge base contains high-quality, domain-specific knowledge.

 

The inference engine component is responsible for backward and forward chaining. This is a component that applies logical rules to the knowledge base in order to obtain new information or make a decision. 

 

The inference engine employs backward and forward chaining techniques as strategies for proposing solutions or deducing information in the expert system.

 

Also Read | Applications of Computer Vision in AI

 

 

What is Forward Chaining?

 

When using an inference engine, forward chaining is also known as forward deduction or forward reasoning. Forward chaining is a type of reasoning in which atomic sentences in a knowledge base are used to extract more data in the forward direction using inference rules (Modus Ponens).

 

The Forward-chaining algorithm starts with known facts, then triggers all rules with satisfied premises and adds their conclusion to the known facts. This process is repeated until the issue is resolved.

 

Forward-Chaining Characteristics

 

  1. As it moves from bottom to top, it is a down-up approach.

 

  1. It is the process of reaching a conclusion based on known facts or data, beginning with the initial state and progressing to the goal state.

 

  1. The forward-chaining approach is also known as data-driven because we achieve our goal by utilizing available data.

 

  1. The forward-chaining approach is commonly used in expert systems such as CLIPS, business rule systems, and production rule systems.

 

The rule-based system, XCON, is an example of a Forward Chaining expert system used to configure large computer systems. It was one of the first clear commercial successes of expert systems, which were written in the general-purpose programming language OPS5.

 

Algorithm of Forward Chaining

 

To complete a task and reach a logical or accurate conclusion, the forward-chaining algorithm, also known as the forward chaining inference process, employs the following step-by-step procedure:

 

  1. The system receives information about the problem from the user.

 

  1. This data is then stored in the working memory.

 

  1. The inference engine searches the rules in a predefined sequence for the one that matches the contents of the working memory.

 

  1. To find new matches, the system re-evaluates the rules.

 

  1. Rules that were previously fired are ignored once the new cycle begins.

 

Also Read |  Conversational Intelligence: Concepts, Importance & Tools

 

Advantages and Disadvantages of Backward Chaining

 

Forward chaining has the following advantages:

 

  1. The right arrangements can be successfully inferred in this type of chaining if the inference engine meets pre-determined principles.

 

  1. Because the endpoint is accessible, it is a faster thinking strategy than forward chaining.

 

  1. The outcome is now known, making it simple to draw conclusions.

 

  1. This procedure is repeated until no more matches are found.

 

  1. This method is most evident when Forward Chaining is used in rule-based systems.

 

Forward chaining has the following drawbacks:

 

  1. It only infers the necessary information, making it less adaptable than forward chaining.

 

  1. It doesn't end with a slew of answers or solutions.

 

  1. If the endpoint is known, the path to reasoning can be taken.

 

 

What is Backward Chaining?

 

Backward Chaining, also known as backward reasoning, is an inference engine reasoning technique that begins with a hypothetical goal. Backtracking is used to find the most optimal way to resolve a conflict or reach a goal state, where the search begins at the conclusion and goes back to understand the conditions that led to the conclusion.

 

This inference engine reasoning technique is used by systems to find the conditions and rules that resulted in a logical result or conclusion.

 

Backward chaining has the following characteristics:

 

  1. It is referred to as a top-down approach.

 

  1. Backward chaining is based on the rule of modus ponens inference.

 

  1. Backward chaining divides the goal into sub-goals or sub-goals to demonstrate the truth of the facts.

 

  1. A goal-driven approach is used because a list of goals determines which rules are selected and used.

 

  1. Backward-chaining algorithms are used in game theory, automated theorem proving tools, inference engines, proof assistants, and a variety of AI applications. 

 

  1. For proof, the backward-chaining method mostly used a depth-first search strategy.

 

Example of Backward Chaining

 

MYCIN is an example of a Backward Chaining expert system that used AI to identify severe bacterial infections. MYCIN was created in the early 1970s at Stanford University and used a simple inference engine and knowledge base.

 

In human problem-solving, the Backward Chaining algorithm uses a process similar to hypothesis testing. However, in contrast to the latter, it focuses on the necessary rules. In a nutshell, this backward chaining procedure entails:

 

First, the system examines the knowledge base to determine whether or not the goal has been specified. If not, it searches the knowledge base for rules that contain the goal in their THEN part in the form of premises until it finds one.

 

Once the premises are identified, the system checks to see if they are in the knowledge base, which, if not, serves as the new goal. This new goal is known as a sub-goal to be demonstrated.

 

The system repeats the preceding steps until it encounters a premise that is not provided by any rule. This is known as a primitive premise.

 

Finally, when the system locates the primitive, it prompts the user for additional information, which is used to prove both the sub-goal and the original goal.

 

Advantages and Disadvantages of Backward Chaining

 

We’ve listed some advantages of Backward chaining :

 

  1. The right arrangements can be successfully inferred in this type of chaining if the inference engine meets pre-determined principles.

 

  1. Because the endpoint is accessible, it is a faster thinking strategy than forward chaining.

 

  1. The outcome is now known, making it simple to draw conclusions.

 

Here are some disadvantages of Backward chaining :

 

  1. It only infers the necessary information, making it less adaptable than forward chaining.

 

  1. It doesn't end with a slew of answers or solutions.

 

  1. If the endpoint is known, the path to reasoning can be taken.


 

Difference between Forward and Backward Chaining

 

The following is the distinction between forward and backward chaining:

 

  1. As the name implies, forward chaining begins with known facts and moves forward by applying inference rules to extract more data, and it continues until it reaches the goal, whereas backward chaining begins with the goal and moves backward by applying inference rules to determine the facts that satisfy the goal.

 

  1. Backward chaining is referred to as a goal-driven inference technique, whereas forward chaining is referred to as a data-driven inference technique.

 

  1. Forward chaining is referred to as the down-up approach, whereas backward chaining is referred to as the top-down approach.

 

  1. Backward chaining employs a depth-first search strategy, whereas forward chaining employs a breadth-first search strategy.

 

  1. Both forward and backward chaining use the Modus ponens inference rule.

 

  1. Forward chaining is useful for tasks like planning, design process monitoring, diagnosis, and classification, whereas backward chaining is useful for tasks like classification and diagnosis.

 

  1. Backward chaining is similar to an exhaustive search, whereas forward chaining attempts to avoid the unnecessary path of reasoning.

 

  1. Forward-chaining can include a variety of ASK questions from the knowledge base, whereas backward chaining can include fewer ASK questions.

 

  1. Forward chaining is slow because it checks all of the rules, whereas backward chaining is fast because it only checks the rules that are required.

 

Also Read | AI Examples

 

 

Working of Forward and Backward Chaining with Example

 

Working of Forward Chaining

 

The following sequence explains a simple example of forward chaining.

 

A

A->B

B

 

A represents the starting point. A->B denotes a fact. This fact is employed in order to reach decision B.

 

As an example, consider the following:

 

Tom is on the move (A)

 

When a person runs, he will sweat (A->B).

 

As a result, Tom is perspiring. (B)

 

A DENDRAL expert system is an excellent example of forward chaining in artificial intelligence. DENDRAL is a programme that predicts the molecular structure of substances.

 

Deducing the chemical structure begins with determining the number of atoms in each molecule. The sample's mass spectrum is then used to determine the atomic arrangement. These steps can be summarized as follows.

 

  1. The chemical formula is established ( the number of atoms in every molecule).

 

  1. The spectrum machine is used to generate sample mass spectra.

 

  1. The chemical's isomer and structure are identified.

 

The identification of the chemical structure is the endpoint in this example. A generate and test technique is used in the DENDRAL expert system.

 

The generator contains two components: a synthesizer and a structural enumerator. The synthesizer is in charge of creating the mass spectrum. The structural enumerator identifies the structure of substances and keeps the generator from becoming redundant.

 

Working of Backward Chaining

 

The previous example's information (forward chaining) can be used to provide a simple explanation of backward chaining. Backward chaining is explained in the following order.

 

B

A->B

A

 

B represents the goal or endpoint that serves as the starting point for backward tracking. The initial state is denoted by the letter A. A->B is a fact that must be established in order to reach the endpoint B.

 

As an example of backward chaining, consider the following:

 

Tom is perspiring (B).

 

When a person runs, he will sweat (A->B).

 

Tom is on the move (A).

 

The MYCIN expert system exemplifies how backward chaining works in practice. This is a system that is used to diagnose bacterial infections. It also suggests treatments for these types of infections.

 

A MYCIN's knowledge base contains many antecedent-consequent rules that allow the system to recognise various causes of (bacterial) infections. This system is appropriate for patients who have a bacterial infection but do not know what it is. The system will collect data on the patient's symptoms and medical history. It will then analyze this data to determine the bacterial infection.

 

The following is an example of a suitable sequence:

 

The patient is suffering from a bacterial infection. The patient is throwing up.

 

He or she is also suffering from diarrhea and severe stomach upset. As a result, the patient has typhoid (salmonella bacterial infection)

 

The MYCIN expert system recommends appropriate treatment based on the information gathered from the patient. The recommended treatment is in accordance with the identified bacterial infection. In the preceding example, the system may advise the use of ciprofloxacin.

 

Also Read | Understanding Goods and Bads of AI

 

Forward Chaining and Backward Chaining, two building blocks of Expert Systems, aid in the creation of systems that solve both simple and complex problems by imitating human-like thinking. 

 

Furthermore, these have been improved to create a hybrid chaining inference technique that combines the benefits of both forward and backward chaining. In short, these techniques are at the heart of various modern machines, allowing them to perform previously unthinkable tasks.

 

AI or artificial intelligence relies heavily on forward and backward reasoning. These concepts differ primarily in terms of operational direction, speed, technique, strategy, and approach. Forward and backward chaining are analogous to an exhaustive search and an unnecessary path of reasoning.

Latest Comments

  • nashlucas33

    May 25, 2022

    I AM LUCAS NASHVILLE, I AM PROUD TO TESTIFY ABOUT JOINING THE NEW WORLD ORDER. I JUST RECENTLY JOINED THE ORGANIZATION FROM SEYCHELLES AND I LIVE IN THE BAHAMAS NOW. PLEASE BEWARE!!! OF SO MANY FAKE POSTS ON HOW TO JOIN ILLUMINATI, I WAS SCAMMED SEVERAL TIMES TRYING TO JOIN THE ORGANIZATION. THE FAKE PEOPLE PROMISED ME MONEY, A CAR, AND A HOUSE BUT IT WAS ALL LIES. I LOST OVER €3500 UNTIL I FOUND A GENUINE WAY TO JOIN EASILY WITH THE HELP OF THE CITIZEN RECRUIT DEPARTMENT 666. AFTER JOINING THE NEW WORLD ORDER, I RECEIVED MY FIRST MONEY REWARD WHICH AMOUNTED TO €100,000 AFTER GOING THROUGH THE ILLUMINATI LOYALTY PROOF TEST WHICH I CAN EASILY SAY WAS SIMPLE AND WELL DONE. PLEASE BEWARE OF SO MANY FAKE POSTS ONLINE. Contact the genuine citizen outreach Department by email citizenrecruitdepartment666@gmail.com WhatsApp or send a text to the recruiting Department here: +1 (647) 800-8405

  • jenkinscooper750

    Jun 28, 2022

    BITCOIN RECOVERY IS REAL!!! ( MorrisGray830 At gmail Dot Com, is the man for the job ) This man is dedicated to his work and you can trust him more than yourself. I contacted him a year and a half Ago and he didn't succeed. when i got ripped of $491,000 worth of bitcoins by scammers, I tried several recovery programs with no success too. I kept on. And now after so much time Mr Morris Gray contacted me with a success, and the reward he took was small because obviously he is doing this because he wants to help idiots like me who fell for crypto scam, and love his job. Of course he could have taken all the coins and not tell me , I was not syncing this wallet for a year, but he didn't. He is the MAN guys , He is! If you have been a victim of crypto scam before you can trust Morris Gray 10000000%. I thought there were no such good genuine guys anymore on earth, but Mr Morris Gray brought my trust to humanity again. GOD bless you sir...you can reach him via ( MORRIS GRAY 830 at Gmaill dot com ) or Whatsapp +1 (607)698-0239..

  • peterwood0110

    Aug 07, 2022

    My purpose out here today is to share this article with the world about how Dr. JB from the Gambia, helped me in getting back my wife that broke up with me three months ago. My name is Peter from the United States of America. I tried all I could to make her see reasons with me that we can continue our relationship but she neglected and turned down my decision. Thank God for giving me the thought of going into the internet for help, I searched properly and I saw different reviews of Dr. JB and I insisted on giving it a try by contacting him via WhatsApp on +220-522-4120. He gave me a reason to live again and he prepared a love spell and told me that my wife will come back to me within 48 hours. Can you believe it, my wife came back to me and our wedding will be held before the end of this year. Contact him now!!! if you need any help. Email: unlimitedlovespellcast@gmail.com WhatsApp: +220-522-4120 Facebook Page: https://web.facebook.com/WhiteWitchMiracleSpellSolutionHome

  • Arthur

    Aug 18, 2022

    What can I say to you Dr Ayoola for what you have done for me, I’m here to say thank you Dr Ayoola, I’m a man that love playing Lottery. I have been playing lottery for over 15 years now and I have not won any good money because of the way my life was, I was having challenges in my financial life I was owning a lot of people around me because of what my wife put me through and don’t know what to do, I was confuse and frustrated I didnt know what to do, I was just researching on how I can win lottery when I got so many testimonies from people that Dr Ayoola has helped in the past and they were able to win a good money with the help of this man call Dr Ayoola I was overwhelmed and I contacted him as well for help I was so surprised he got back to me saying he will help me, that was how we started working together he promised me that I will win which I believe because of the way he spoke to me, today I’m here to tell the world that I’m a living testimony of his good works. Dr Ayoola helped me to win the sum of 50 million euro I was shocked because I have been playing this same lottery for over 15 years, Dr Ayoola was God sent to me I’m here testifying about him for you to know just in case you want help so you can contact him as well via website Drayoolatemple.com or drayoolasolutionhome@gmail.com or https://www.facebook.com/Dr-Ayoola-105640401516053/ text or call +14809032128

  • jasonbennett355

    Oct 13, 2022

    Omg I Finally Got Helped !! I'm so excited right now, I just have to share my testimony on this Forum.. The feeling of being loved takes away so much burden from our shoulders. I had all this but I made a big mistake when I cheated on my wife with another woman and my wife left me for over 4 months after she found out.. I was lonely, sad and devastated. Luckily I was directed to a very powerful spell caster Dr Emu who helped me cast a spell of reconciliation on our Relationship and he brought back my wife and now she loves me far more than ever.. I'm so happy with life now. Thank you so much Dr Emu, kindly Contact Dr Emu Today and get any kind of help you want.. Via Email emutemple@gmail.com or Call/WhatsApp cell number +2347012841542 Https://web.facebook.com/Emu-Temple-104891335203341