ThinkViz LogoThinkViz
← Back to Explorer

Forward Chaining

Forward Chaining is a data-driven reasoning approach. It starts with known facts in working memory, matches rule conditions (IF parts), resolves conflicts between candidate rules, and fires actions to infer new facts until no further conclusions can be drawn.

Category:Rule-Based Systems
•
Difficulty:Beginner
•
Time complexity:O(R * F)
•
Space complexity:O(F)
Interactive VisualizationForward Chaining Visualizer
PHASE: INITIALIZEDData-driven inference (matching IF conditions to derive new facts)
Resolution Strategy:

Knowledge Base (Rules)

Production rules structured as IF (antecedents) → THEN (consequent)

4 Rules
R1
IFfeverANDcough
THENflu_suspected
R2
IFflu_suspectedANDbody_ache
THENflu_likely
R3
IFflu_likely
THENadvise_rest
R4
IFrash
THENallergy

Working Memory

Known facts in the current state

0 Facts
Working memory is empty.

Conflict Set

Matching rules ready to fire

No rules in conflict set.
0/0
Step Trace & Explanation-
Action:Click 'Run Inference' to start simulation.
Forward Chaining Pseudocode
1.repeat
2. conflictSet = rules whose IF part matches working memory
3. if conflictSet is empty: stop
4. rule = resolve(conflictSet)
5. fire(rule): add its THEN fact to working memory
6.until no rule matches
Real-time Telemetry HUD
Live Stream
Nodes Explored
0
Frontier (Open Set)
0
Optimal Cost g(n)
—
Total Step Frames
0