Memra

Inference rules: modus ponens, modus tollens, instantiation; sound & complete

◈ 4 cards

Apply modus ponens, modus tollens, And-elimination/introduction, and universal instantiation; define sound and complete; work the Socrates syllogism.

Deriving new truths mechanically

An inference rule is a syntactic pattern that produces a new sentence from existing ones. A proof procedure is an inference rule plus an algorithm that decides when and where to apply it. The rules below are the practical toolkit for rule-based AI.

  • Modus ponens (MP) — from and , infer . ("The way that affirms by affirming.") This is the basis of forward chaining (Module 5, exam Q8).
  • Modus tollens (MT) — from and , infer . (Affirms by denying — work backward from a false consequent.)
  • And-Elimination — from , infer (or infer ).
  • And-Introduction — from and separately, infer .
  • Universal Instantiation (UI) — from , infer for any constant in the domain.

Watch the fallacy: from and you may not infer — that is affirming the consequent (abduction), which is unsound. Wet ground does not prove it rained.

Sound vs complete

Two correctness properties measure an inference system:

  • Sound — every sentence the rule produces from a set logically follows from . A sound rule never derives a falsehood from truths.
  • Complete — the rule can produce every sentence that logically follows from . A complete rule misses nothing.

The two are independent. Modus ponens alone is sound but not complete (it cannot derive everything that follows — e.g. it does not do proof by cases). Resolution (Module 9) is both sound and complete. Heuristic and probabilistic reasoners (Modules 4, 7) deliberately relax soundness to gain speed under uncertainty.

Worked example: the Socrates syllogism

Knowledge base: the rule and the fact . Derive in two steps:

  1. Universal Instantiation — substitute for in the rule, giving the ground implication .
  2. Modus Ponens — we now have both this implication and the fact (its antecedent), so MP yields .

This two-step pattern — instantiate a general rule to a ground case, then fire MP — is the heartbeat of predicate-calculus inference. (Unification, Lesson 6, automates step 1 by finding the substitution {socrates/X} mechanically.) The Python engine below applies MP to a fixpoint and derives mortal(socrates).

rulefactmortal(socrates)by modus ponensman(socrates) → mortal(socrates)by UI, {socrates/X}∀X (man(X) → mortal(X))the general ruleman(socrates)known
The heartbeat of predicate-calculus inference: <strong>instantiate a general rule to a ground case, then fire MP</strong>. Read it downward — the two premises at the leaves, the conclusion at the top. Unification (Lesson 6) is what finds the substitution <code>{socrates/X}</code> mechanically.
rulefrominfermodus ponensP → Q, PQmodus tollensP → Q, ¬Q¬PAnd-eliminationP ∧ QPAnd-introductionP, QP ∧ Quniversal instantiation∀X p(X)p(a)affirming the consequentP → Q, QP — unsoundThe first five are sound. The sixth is the fallacy (abduction), not a rule.
Each rule is a purely syntactic pattern — match the shape, write the conclusion. The last row is the one that looks like modus ponens and is not: from P → Q and Q you may <strong>not</strong> infer P. Wet ground does not prove it rained.
NORMAL ~/memra/learn/comp-456/inference-rules-soundness-completeness utf-8 LF