Skip to content
Road to Intelligence

Concept · Chapter 1: What Is Artificial Intelligence?

Logic and Rules

Must knowUnderstand15 minDifficulty

Rule-based AI stores knowledge as if–then rules and derives conclusions by chaining them together, forward from facts or backward from goals.

The problem

How can a machine reach conclusions it wasn't told directly?

The solution

Encode knowledge as logical rules and let an inference engine apply them mechanically to known facts.

The consequence

Conclusions come with a traceable explanation — but only as good as the rules, which must be written and maintained by hand.

You should understand first

  1. The Turing Test
  2. Symbolic AI
  3. Logic and Rules

Tiny example

  1. Facts

    Tweety is a bird. Tweety is not a penguin.
  2. Rule

    IF x is a bird AND x is not a penguin THEN x can fly.
  3. Inference

    Match the rule to the facts → conclude: Tweety can fly.
  4. The catch

    Ostriches. Kiwis. Birds with broken wings. Dead birds. Each needs another rule or exception — and so on without end.

How it works

A knowledge base holds facts and rules; an inference engine applies them. Forward chaining starts from known facts and fires every rule it can, adding conclusions until nothing new appears. Backward chaining starts from a goal ("can Tweety fly?") and works back to the facts that would establish it — the strategy MYCIN used when questioning doctors.

Languages like Prolog (1972) made this style of programming direct: you state facts and rules, and the system searches for proofs.

Why it matters today

The strength — every answer has an explanation — is exactly what many learned models lack. The weakness — every exception must be written by hand — is the reason AI moved toward learning. Try writing spam rules yourself in Write the Rules.

What to remember

  • Knowledge base (facts + rules) + inference engine = rule-based system.
  • Forward chaining: facts → conclusions. Backward chaining: goal → the facts needed.
  • Every conclusion can be explained by the rules that produced it.
  • Classical logic is all-or-nothing; real knowledge is uncertain and full of exceptions.

Key papers