Entailment & Inference Demo

Interactive Exploration of Logical Entailment and Sound Reasoning

Back to Lecture Overview

Understanding Entailment

Definition:

Entailment (α ⊨ β) means that β logically follows from α. In every possible world where α is true, β must also be true.

α ⊨ β ≡ In all models where α is true, β is also true
Key Properties:
  • Soundness: If we can prove β from α, then α ⊨ β
  • Completeness: If α ⊨ β, then we can prove β from α
  • Monotonicity: Adding premises preserves entailment
    If α ⊨ β, then (α ∧ γ) ⊨ β for any γ
Examples:
  • "It's raining" ⊨ "The ground will be wet"
  • "All birds fly, Tweety is a bird" ⊨ "Tweety flies"
  • "P ∧ Q" ⊨ "P" (conjunction elimination)

Understanding Monotonicity

Monotonicity Property:

In classical logic, monotonicity means that adding new premises to a valid argument never breaks the entailment. If we have α ⊨ β, then (α ∧ γ) ⊨ β for any additional premise γ.

If α ⊨ β, then (α ∧ γ) ⊨ β for any γ
Example 1: Simple Case
Original:
P ∧ Q ⊨ P
From "P and Q", we can conclude P
After Adding Premise R:
P ∧ Q ∧ R ⊨ P
From "P and Q and R", we can still conclude P
Example 2: Real World
Original:
"It's raining" ⊨ "Ground is wet"
Rain makes the ground wet
After Adding "It's windy":
"It's raining AND windy" ⊨ "Ground is wet"
Rain still makes ground wet, even if it's also windy
Why Monotonicity Matters
  • Reasoning Stability: Once we establish a valid conclusion, learning new facts won't invalidate it
  • Knowledge Accumulation: We can safely add new information to our knowledge base
  • Logical Consistency: The reasoning system remains coherent as it grows
  • Distinguishes Classical Logic: Non-monotonic systems (like default reasoning) can retract conclusions when new info arrives
⚠️ Note: This property distinguishes classical logic from human reasoning, where new information can sometimes lead us to change our conclusions (e.g., "Birds fly" + "Penguins are birds" + "Penguins don't fly").

Entailment vs Implication

Entailment (⊨)
  • Semantic relationship
  • About truth in all possible models
  • α ⊨ β: "In every model where α is true, β is true"
  • External to the logic system
P ∧ Q ⊨ P
This is always true, regardless of truth values
Implication (→)
  • Logical connective
  • Part of propositional logic syntax
  • P → Q: "If P then Q"
  • Can be true or false depending on truth values
P → Q
This can be true or false depending on P and Q
Key Difference: Entailment is a meta-logical concept about the relationship between formulas, while implication is a logical operator within formulas. You can have: (P ∧ (P → Q)) ⊨ Q (modus ponens entailment).

Model-Theoretic Approach

Models and Interpretations:

A model (or interpretation) assigns truth values to all propositional variables. Entailment is defined in terms of models: α ⊨ β if every model that satisfies α also satisfies β.

Example: P ∧ Q ⊨ P
P Q P∧Q P Valid?
T T T T
T F F T N/A
F T F F N/A
F F F F N/A
Only the first row matters - where P∧Q is true, P is also true
Counter-example: P ⊭ P ∧ Q
P Q P P∧Q Valid?
T T T T
T F T F
F T F F N/A
F F F F N/A
Row 2 is a counterexample - P is true but P∧Q is false

Consistency & Satisfiability

Satisfiability

A set of formulas Γ is satisfiable if there exists at least one model that makes all formulas in Γ true.

SAT(Γ) ≡ ∃ model M : M ⊨ γ for all γ ∈ Γ

Examples:

  • {P, Q} is satisfiable (P=T, Q=T)
  • {P, ¬P} is unsatisfiable
Consistency

A set of formulas is consistent if it doesn't lead to contradictions. In classical logic, consistency = satisfiability.

CONSISTENT(Γ) ≡ SAT(Γ)

Connection to Entailment:

  • Γ ⊨ α iff Γ ∪ {¬α} is unsatisfiable
  • This is the basis for proof by contradiction

Entailment in AI Systems

Entailment Check Algorithm:

To determine if KB ⊨ α (knowledge base entails α):

  1. Model Checking: Check all possible models where KB is true, verify α is true in all
  2. Proof by Contradiction: Show that KB ∪ {¬α} is unsatisfiable
  3. Resolution: Convert to CNF and apply resolution until contradiction or no new clauses
Complexity
  • Propositional: Co-NP complete
  • First-order: Semi-decidable
  • Real systems use heuristics and restrictions
Applications
  • Query answering in knowledge bases
  • Automated theorem proving
  • Planning and reasoning
  • Expert systems
Practical Issues
  • Computational complexity
  • Incomplete information
  • Non-monotonic reasoning
  • Uncertainty handling

Interactive Entailment Explorer

Select a scenario below to explore different entailment relationships:

Modus Ponens

Classic valid inference rule

Conjunction

Properties of AND operations

Logical Fallacy

Example of invalid reasoning

Monotonicity Demo

Adding premises preserves entailment

More Examples to Explore

Valid Entailments:
P ∧ Q ⊨ P
P ⊨ P ∨ Q
P → Q, P ⊨ Q
¬¬P ⊨ P
Invalid Entailments:
P ⊭ P ∧ Q
P ∨ Q ⊭ P
P → Q, Q ⊭ P
P → Q ⊭ Q → P

Educational Notes

Why Entailment Matters:
  • Foundation of logical reasoning
  • Ensures conclusions are trustworthy
  • Distinguishes valid from invalid arguments
  • Essential for knowledge-based systems
Common Mistakes:
  • Confusing ⊨ (entailment) with → (implication)
  • Assuming correlation implies causation
  • Affirming the consequent fallacy
  • Denying the antecedent fallacy

Complete Concept Coverage

✅ This demo now covers all essential entailment concepts:
Core Concepts:
  • Definition of Entailment - α ⊨ β semantic relationship
  • Model-Theoretic Approach - Truth in all models
  • Soundness & Completeness - Proof system properties
  • Monotonicity - Adding premises preserves entailment
  • Entailment vs Implication - Meta-logic vs logic operator
Advanced Topics:
  • Satisfiability & Consistency - Model existence
  • Counterexamples - How to disprove entailment
  • Truth Table Analysis - Systematic verification
  • AI Applications - Knowledge bases and reasoning
  • Complexity Issues - Computational challenges
Interactive Examples:
  • Valid Inference Rules - Modus Ponens, Conjunction Elimination
  • Logical Fallacies - Affirming the Consequent
  • Monotonicity Demo - Adding premises example
  • Truth Table Verification - Step-by-step checking
Practical Applications:
  • Knowledge Base Queries - KB ⊨ α checking
  • Automated Reasoning - Algorithm approaches
  • Error Detection - Common reasoning mistakes
  • System Design - AI reasoning architecture
🎯 Learning Objectives Achieved:

After working through this demo, students should be able to:

  1. Define entailment formally and distinguish it from implication
  2. Use truth tables and model checking to verify entailment relationships
  3. Understand the role of entailment in knowledge-based AI systems
  4. Recognize common logical fallacies and invalid reasoning patterns
  5. Apply entailment concepts to practical AI reasoning problems