Forward Chaining Example: Step-by-Step Implementation

By Danielle

Forward chaining is a reasoning technique used in artificial intelligence and expert systems to draw conclusions from a set of facts and rules. It's a powerful method that allows systems to infer new information based on existing data, making it an essential component in many decision-making processes. Let's explore an example of forward chaining to understand its workings better.

Backward Chaining - Use Chaining - Section G-8
Backward Chaining - Use Chaining - Section G-8

Imagine a simple expert system designed to help farmers decide whether to water their crops based on weather conditions. The system has the following facts and rules:

Backward Chaining: Moving Upward The Supply Chain
Backward Chaining: Moving Upward The Supply Chain

Facts

The system knows the current temperature and humidity levels. For instance, today's temperature is 25°C, and the humidity is 60%.

Client Challenge
Client Challenge

It also knows the weather forecast for the next 24 hours, which predicts no rain and a steady temperature between 22°C and 28°C.

Rules

12 Heartwarming Ways to Start a Pay it Forward Chain
12 Heartwarming Ways to Start a Pay it Forward Chain

The system follows these rules to decide whether to water the crops:

Rule 1: Watering needed

If the temperature is above 25°C and the humidity is below 70%, then watering is needed.

All About Chaining: Definition + Examples and More
All About Chaining: Definition + Examples and More

This rule suggests that when it's hot and dry, the crops require water to prevent dehydration.

Rule 2: No watering needed

If the temperature is below 20°C or the humidity is above 80%, then no watering is needed.

Forward Loop Chain: an Alternative to Standard Chain Stitch (with Limpet Variations and Tutorial)
Forward Loop Chain: an Alternative to Standard Chain Stitch (with Limpet Variations and Tutorial)

This rule indicates that when it's cold or humid, the crops don't require additional water as there's enough moisture in the air or soil.

Forward Chaining in Action

Fun ways to teacher food chains to younger students
Fun ways to teacher food chains to younger students
Forward Integration
Forward Integration
the types of food chain in an ecosystem info graphic on white background
the types of food chain in an ecosystem info graphic on white background
Three Types of Chaining in ABA
Three Types of Chaining in ABA
a woman with chains around her neck and hands
a woman with chains around her neck and hands
Chaining Procedures Guide | ABA Task Analysis Study Sheet | Forward Chaining Backward Chaining | RBT Study Guide
Chaining Procedures Guide | ABA Task Analysis Study Sheet | Forward Chaining Backward Chaining | RBT Study Guide
a close up of a metal chain on a brick wall with bricks in the background
a close up of a metal chain on a brick wall with bricks in the background
a man standing on top of a mountain with his arms wide open and chains in the air
a man standing on top of a mountain with his arms wide open and chains in the air
a drawing of a chain that has been drawn on the screen, with an arrow pointing to
a drawing of a chain that has been drawn on the screen, with an arrow pointing to
a man standing in the middle of chains
a man standing in the middle of chains
Chain Tattoo
Chain Tattoo
a black and white drawing of two chained chains with the words freedom written below them
a black and white drawing of two chained chains with the words freedom written below them
Breaker Of Chains
Breaker Of Chains
a drawing of two chains that are connected to each other, with one being held by another
a drawing of two chains that are connected to each other, with one being held by another
two hands holding onto each other with chains on them
two hands holding onto each other with chains on them
Breaking chain symbolizing freedom and overcoming obstacles with fiery determination Stock Photo
Breaking chain symbolizing freedom and overcoming obstacles with fiery determination Stock Photo
⠀⠀⠀⠀⠀⠀⠀ ꒰ ᩧ⠀⠀ 𓈒 ⠀⠀ chain breaking meme ⠀⠀
⠀⠀⠀⠀⠀⠀⠀ ꒰ ᩧ⠀⠀ 𓈒 ⠀⠀ chain breaking meme ⠀⠀
two hands holding chains with the words preparing my life written on them in black ink
two hands holding chains with the words preparing my life written on them in black ink
Chains ⛓️
Chains ⛓️
two metal chains connected to each other in the sky
two metal chains connected to each other in the sky

Now, let's apply forward chaining to determine if the crops need watering today:

Step 1: Start with known facts

The system begins with the given facts: temperature = 25°C, humidity = 60%, no rain forecasted, and steady temperature between 22°C and 28°C.

It also has the two rules mentioned earlier.

Step 2: Apply rules to facts

The system applies Rule 1 to the current facts: temperature (25°C) is above 25°C, and humidity (60%) is below 70%.

Since both conditions are met, the system infers that watering is needed.

With forward chaining, the expert system has successfully determined that the crops require watering based on the current weather conditions. This example demonstrates how forward chaining can be used to make decisions by drawing conclusions from a set of facts and rules.

In the realm of artificial intelligence, forward chaining is widely employed in various applications, such as expert systems, recommendation engines, and predictive analytics. By continuously updating facts and refining rules, these systems can provide accurate and timely insights to support informed decision-making.