Each glowing sphere is a fact in the knowledge base; each box is a rule of the form "IF antecedent facts THEN consequent fact". In forward chaining, known facts (leftmost layer) ignite every rule whose antecedents are satisfied, which asserts new facts, which ignite the next layer of rules, and so on until nothing new can be derived. In backward chaining the search runs in reverse: starting from the goal, the engine asks which rule could prove it, then recursively asks whether that rule's antecedents are known or provable, tracing all the way back to base facts.
New Facts = Facts ∪ {consequent(r) : r ∈ Rules, antecedents(r) ⊆ Facts}
fires(r) = antecedents satisfied AND random() < confidence
- Symptoms — which base facts are asserted true: a medical pattern (fever + cough), an electrical pattern (high temperature + excess current), both at once, or none.
- Chain speed — how long each hop across the rule network takes to animate; the underlying logic is instant, this only paces the visualisation.
- Rule confidence — the probability a satisfied rule actually fires, modelling the uncertainty and incomplete evidence real expert systems must tolerate. Low confidence can stall the chain even when the facts are present.
- Mode — forward chaining sweeps left→right from facts to conclusion; backward chaining sweeps right→left from the goal, verifying subgoals down to base facts.
Real-world relevance: this rule-firing loop is the inference engine at the heart of classic diagnostic expert systems — medical (MYCIN-style symptom→disease rules) and industrial (fault→cause rules) alike.