Reasoning Strategies
There are two main approaches to logical reasoning: forward chaining
(data-driven) and backward chaining (goal-driven). Each has
its advantages and use cases.
Key Distinction:
- Forward Chaining: Start with known facts, derive new facts
- Backward Chaining: Start with goal, work backwards to find support
- Resolution: Complete inference method using contradiction
Forward Chaining (Data-Driven)
Forward chaining starts with known facts and applies
inference rules to derive new facts until the goal is reached or no more facts can be derived.
Forward Chaining Algorithm:
- Start with known facts in KB
- Find rules whose premises are satisfied
- Apply rules to derive new facts
- Add new facts to KB
- Repeat until goal reached or no more facts
Advantages:
- Natural: Mimics human reasoning from observations
- Complete: Will find all derivable facts
- Efficient: Good for multiple queries
- Incremental: Can add new facts easily
Disadvantages:
- Inefficient: May derive irrelevant facts
- No Focus: Doesn't target specific goals
- Memory Intensive: Stores all derived facts
Backward Chaining (Goal-Driven)
Backward chaining starts with a goal and works backwards
to find the facts and rules needed to support it.
Backward Chaining Algorithm:
- Start with goal to prove
- Find rules whose conclusion matches goal
- Try to prove premises of those rules
- Recursively apply to subgoals
- Stop when all subgoals are facts
Advantages:
- Focused: Only derives relevant facts
- Efficient: Good for specific queries
- Memory Efficient: Doesn't store all facts
- Goal-Oriented: Directly targets the question
Disadvantages:
- Incomplete: May miss some derivable facts
- Complex: Requires sophisticated control
- Redundant: May re-derive same facts
Resolution: Complete Inference Method
Resolution is a complete inference method that works by
assuming the negation of what we want to prove and showing it leads to a contradiction.
Resolution Principle:
If we have P ∨ Q and ¬P ∨ R, then we can derive Q ∨ R. This eliminates
complementary literals and combines the remaining information.
Resolution Example:
Goal: Prove Q from {P → Q, P}
- Convert to CNF: {¬P ∨ Q, P}
- Add negation of goal: {¬P ∨ Q, P, ¬Q}
- Apply resolution:
4. Q (from P and ¬P ∨ Q)
5. ⊥ (from Q and ¬Q)
- Contradiction found, so Q must be true
Modus Ponens and Variants
Modus Ponens is the fundamental inference rule that
forms the basis of many reasoning systems.
Modus Ponens
P → Q, P ⊢ Q
If P implies Q, and P is true, then Q is true
Modus Tollens
P → Q, ¬Q ⊢ ¬P
If P implies Q, and Q is false, then P is false
Hypothetical Syllogism
P → Q, Q → R ⊢ P → R
Chain implications together
Disjunctive Syllogism
P ∨ Q, ¬P ⊢ Q
If P or Q is true, and P is false, then Q is true
Efficiency Considerations
Real-world reasoning systems must balance expressiveness with computational efficiency:
Performance Factors:
- Knowledge Base Size: Larger KBs require more computation
- Rule Complexity: Complex rules are harder to match
- Query Specificity: Specific queries are more efficient
- Inference Strategy: Choice of forward vs backward chaining
Trade-offs:
- Expressiveness vs Efficiency: More expressive languages are slower
- Completeness vs Speed: Complete methods may be very slow
- Memory vs Time: Can trade memory for speed
- Accuracy vs Approximation: May need to approximate for speed
Practical Applications
Different reasoning techniques are suited for different applications:
Forward Chaining:
- Expert systems
- Monitoring systems
- Data analysis
- Real-time reasoning
Backward Chaining:
- Question answering
- Theorem proving
- Diagnostic systems
- Planning systems
Resolution:
- Automated theorem proving
- Logic programming
- Verification systems
- Constraint satisfaction
Key Takeaways
Forward Chaining:
- Data-driven reasoning
- Good for multiple queries
- Finds all derivable facts
- Memory intensive
Backward Chaining:
- Goal-driven reasoning
- Good for specific queries
- Focused and efficient
- May miss some facts
Resolution:
- Complete: Can prove any true statement
- Sound: Only derives true conclusions
- Efficient: Good for automated systems
- Versatile: Works with any logical language