note

02 Core Reasoning Strategies

Core Reasoning Strategies

Prerequisites

Learning Goals

After completing this module, you will be able to:

  1. Apply the Generate & Test method to systematically explore solution spaces
  2. Balance responsibility between generators and testers
  3. Use Means-Ends Analysis to reduce differences between current and goal states
  4. Apply Problem Reduction to decompose complex problems
  5. Understand Production Systems as cognitive architectures
  6. Implement learning through chunking when impasses occur
  7. Design knowledge-based AI systems using rule-based reasoning

1. Generate & Test

Core Concept

Generate & Test is a fundamental problem-solving method with two components:

  1. Generator: Creates possible solutions or successor states
  2. Tester: Evaluates generated solutions and filters out invalid ones

This method systematically explores solution spaces through iterative generation and evaluation.

The Guards and Prisoners Problem Revisited

Initial State:

Generation Phase: From initial state, generator creates all possible moves:

Possible Moves:
1. Move 1 guard →
2. Move 1 guard + 1 prisoner →
3. Move 2 guards →
4. Move 2 prisoners →
5. Move 1 prisoner →

Testing Phase: Tester removes illegal states (prisoners > guards):

Move 1: G G | G P P P  ← ILLEGAL (2G vs 3P on left)
Move 2: G G P P | G P  ← LEGAL
Move 3: G | G G P P P  ← ILLEGAL (1G vs 3P on left)
Move 4: G G G P | P P  ← LEGAL
Move 5: G G G P P | P  ← LEGAL but UNPRODUCTIVE

Result: 2 legal and productive moves remain (moves 2 and 4).

Dumb Generators vs. Smart Generators

Dumb Generator:

Smart Generator:

Dumb Testers vs. Smart Testers

Dumb Tester:

Smart Tester:

Balancing Responsibility

The key design decision: How smart should each component be?

     Generator Intelligence

        Trade-off

      Tester Intelligence

Option 1: Smart Generator + Dumb Tester

Option 2: Dumb Generator + Smart Tester

Option 3: Both Smart (Recommended)

Practical Consideration: The choice depends on:

Combinatorial Explosion

Without intelligent generation/testing, state spaces grow exponentially:

Level 0: 1 state (initial)
Level 1: 5 states
Level 2: 25 states
Level 3: 125 states
...

Problem: Even small problems create millions of states.

Solution: Smart generators and testers prune aggressively:

Level 0: 1 state
Level 1: 2 legal productive states
Level 2: 4 legal productive states
Level 3: 3 legal productive states (some paths merged)
...

Application to Ravens Matrices

Ravens problems present additional complexity:

Discrete vs. Continuous Spaces:

Guards & Prisoners: Discrete

Ravens Matrices: Continuous

Challenge: Continuous spaces require:

Example:

Transformation A → B: Circle inside → Circle outside (larger)

Applying to C → ?:
- How far outside? (1 pixel? 10 pixels? 50 pixels?)
- How much larger? (10%? 50%? 100%?)
- Solution: Generate candidates based on observed pattern,
            test similarity to original transformation

2. Means-Ends Analysis

Core Concept

Means-Ends Analysis is a goal-driven problem-solving method that:

  1. Identifies differences between current state and goal state
  2. Selects operators to reduce those differences
  3. Iteratively applies operators until goal is reached

Key Insight: Focus on reducing the distance to the goal at each step.

The Blocks World Problem

Setup:

Constraints:

Operators:

Simple Example

Initial State:

    C
    A       B
  ─────────────
     Table

Goal State:

    A
    B
    C
  ─────────────
     Table

Means-Ends Analysis Solution:

Step 1: Identify Differences

Current:  C on A,  A on Table,  B on Table
Goal:     A on B,  B on C,      C on Table

Differences:
- C should be on Table (not on A)
- B should be on C (not on Table)
- A should be on B (not on Table)

Step 2: Select Operator to Reduce Difference First difference: C should be on Table → Operator: Move(C, Table)

Step 3: Apply Operator

New State:
    A       B       C
  ─────────────────────
        Table

Step 4: Repeat

Differences now:
- B should be on C (not on Table)
- A should be on B (not on Table)

Select: Move(B, C)

New State:
    A       B
            C
  ─────────────
     Table

Differences now:
- A should be on B (not on Table)

Select: Move(A, B)

Final State:
    A
    B
    C
  ─────────────
     Table  ✓ GOAL REACHED

Complex Example: Four Blocks

Initial State:

A  B  C
   D
─────────
  Table

Goal State:

A
B
C
D
─────────
  Table

Step 1: Calculate Differences

Current Goal State:
A: on Table → should be on B (1 difference)
B: on D      → should be on C (1 difference)
C: on Table  → should be on D (1 difference)
D: on Table  → should be on Table (0 differences)

Total: 3 differences

Step 2: Generate Possible Moves

Can move: A (nothing on top)
          B (nothing on top)
          C (nothing on top)

Possible next states:
1. Move A onto B
2. Move A onto C
3. Move A onto D
4. Move B onto A
5. Move B onto C
6. Move C onto A
7. Move C onto B
8. Move C onto D

Step 3: Evaluate Each Move (Count Remaining Differences)

Move A onto D:  Still 3 differences
Move B onto C:  Only 2 differences remaining ✓ Best choice
Move C onto D:  Only 2 differences remaining ✓ Also good

Step 4: Select Best Operator Choose Move(B, C) - reduces differences from 3 to 2

Iteration: Continue until differences = 0 (goal reached)

Hitting an Obstacle

Sometimes means-ends analysis gets stuck:

Problem Scenario:

Initial: A on B, B on C, C on Table
Goal:    C on B, B on A, A on Table

Direct path blocked: Can't move A onto Table
                     (would temporarily increase differences)

Solution: Sometimes you must make moves that temporarily don’t reduce differences, or even increase them, to reach the goal.

This is where Problem Reduction becomes necessary.


3. Problem Reduction

Core Concept

Problem Reduction decomposes a complex problem into simpler subproblems:

  1. Break hard problem into multiple easier problems
  2. Solve each subproblem independently
  3. Compose subsolutions into a solution for the whole problem

Key Insight: The right decomposition, guided by knowledge, makes complex problems tractable.

Application to Blocks World

Stuck Situation:

Initial:
    D
A   B   C
─────────
  Table

Goal:
A
B
C
D
─────────
  Table

Using Means-Ends Analysis alone:

Using Problem Reduction:

Step 1: Decompose Goal Break goal into subgoals in reverse order:

Subgoal 1: Get D on Table
Subgoal 2: Get C on D
Subgoal 3: Get B on C
Subgoal 4: Get A on B

Step 2: Solve Each Subgoal

Subgoal 1: Get D on Table
  Current: D on B
  Action: Move(D, Table)

State after subgoal 1:
A   B   C   D
─────────────
    Table

Subgoal 2: Get C on D
  Current: C on Table
  Action: Move(C, D)

State after subgoal 2:
        C
A   B   D
─────────
    Table

Subgoal 3: Get B on C
  Current: B on Table
  Action: Move(B, C)

State after subgoal 3:
        B
        C
A       D
─────────
    Table

Subgoal 4: Get A on B
  Current: A on Table
  Action: Move(A, B)

Final State:
        A
        B
        C
        D
─────────────
    Table  ✓ GOAL REACHED

Step 3: Compose Solution Complete sequence: Move(D,Table), Move(C,D), Move(B,C), Move(A,B)

Why Problem Reduction Works

Advantages:

  1. Simplification: Each subproblem is easier than the original
  2. Clear Progress: Each subgoal provides measurable progress
  3. Knowledge-Driven: Decomposition uses domain knowledge
  4. Avoids Local Minima: Subgoals guide through temporarily worse states

Requirements:

  1. Good Decomposition: Subproblems must be truly simpler
  2. Independence: Solving one subproblem shouldn’t undo others (or know how to handle it)
  3. Composability: Subsolutions must combine into a complete solution

Integration with Means-Ends Analysis

Combined Approach:

  1. Use Means-Ends Analysis to make progress when possible
  2. When stuck (no move reduces differences), use Problem Reduction
  3. Decompose the problem into subgoals
  4. Apply Means-Ends Analysis to each subgoal
  5. Compose the subsolutions

This creates a powerful, hierarchical problem-solving method.


4. Production Systems

What is a Cognitive Architecture?

A cognitive architecture is a fixed system structure that processes variable knowledge content to produce behavior:

Architecture + Content = Behavior

Key Principle: Keep architecture constant, change content (knowledge) to get different behaviors.

Analogy: Computer architecture:

For Cognitive Systems:

Fundamental Assumptions

Cognitive architectures assume:

  1. Goal-Oriented: Agents have goals and take actions to achieve them
  2. Rich Environment: Agents operate in complex, dynamic environments
  3. Knowledge-Based: Agents use knowledge of the world to pursue goals
  4. Abstraction: Knowledge is at an appropriate abstraction level
  5. Symbolic: Knowledge is captured in symbols at that abstraction
  6. Flexible: Behavior depends on and adapts to the environment
  7. Learning: Agents constantly learn from experience

Structure of Production Systems

A production system consists of:

1. Working Memory

2. Long-Term Memory Contains three types of knowledge:

a) Procedural Knowledge (Production Rules)

IF <conditions>
THEN <actions>

Example:

IF batter is left-handed
   AND first base is empty
   AND second base has runner
THEN pitch inside

b) Semantic Knowledge (Conceptual Knowledge)

c) Episodic Knowledge (Experiences)

The Baseball Pitcher Example

Situation:

- 7th inning, top half
- Score: Tie game
- Runners on 2nd and 3rd base
- 2 outs
- Batter: Parra (left-handed)
- First base: Empty

Working Memory (Current State):

┌─────────────────────────────┐
│ inning: 7th                 │
│ half: top                   │
│ runners: 2nd, 3rd          │
│ outs: 2                     │
│ batter: Parra              │
│ batter-hand: left          │
│ first-base: empty          │
│ score: tied                │
│ goal: escape-inning        │
└─────────────────────────────┘

Production Rules (Procedural Knowledge):

Rule 1:
IF runners on 2nd AND 3rd
   AND first base empty
   AND batter is strong
THEN suggest walk-batter

Rule 2:
IF runners on 2nd AND 3rd
   AND batter is strong
THEN suggest pitch

Rule 3:
IF batter is left-handed
   AND pitch suggested
THEN dismiss throw-fastball

Rule 4:
IF throw-fastball dismissed
   AND pitch suggested
THEN suggest throw-curveball

Production System Execution Cycle

1. Match Rules to Working Memory

2. Select Rule(s) to Fire

3. Execute Rule Actions

4. Update Working Memory

5. Repeat (or stop if goal achieved)

Detailed Example:

Cycle 1:

Cycle 2:

Action Selection

When multiple operators are suggested:

Option 1: Meta-Rules

Option 2: Priorities

Option 3: Specificity

Option 4: Learning (Chunking)


5. Chunking: Learning in Production Systems

What is Chunking?

Chunking is a learning mechanism that creates new production rules when the system reaches an impasse.

Impasse: Situation where the system cannot make a decision because:

How Chunking Works

Step 1: Detect Impasse

Working Memory shows:
- Operator 1 suggested: walk-batter
- Operator 2 suggested: pitch (throw-fastball or throw-curveball)
- Cannot choose between them

Step 2: Search Episodic Memory Look for past experiences similar to current situation:

Episodic Memory:
┌──────────────────────────────────────────┐
│ Episode: Previous Game (5th inning)     │
│ - Weather: windy                         │
│ - Batter: Parra (left-handed)           │
│ - Situation: Similar (runners on base)  │
│ - Action: Threw fastball                │
│ - Result: HOME RUN (bad outcome)        │
└──────────────────────────────────────────┘

Step 3: Extract Relevant Features Identify what’s relevant from the episode:

Weather, inning → Less relevant

Step 4: Create New Rule (Chunk)

New Rule (Learned):
IF two operators suggested
   AND throw-fastball is one operator
   AND batter is Parra
THEN dismiss throw-fastball

Step 5: Store in Procedural Memory New rule becomes part of permanent knowledge

Step 6: Apply New Rule

Re-run production system:
- Rules 1 & 2 fire → Suggest walk-batter and pitch
- New learned rule fires → Dismiss throw-fastball
- Rule 4 fires → Suggest throw-curveball
- Decision: Throw curveball (impasse resolved!)

Characteristics of Chunking

1. Impasse-Driven

2. Experience-Based

3. Knowledge Compilation

4. Incremental

Reasoning, Learning, and Memory Integration

Chunking demonstrates the intimate connection between:

Reasoning:

Learning:

Memory:

Cycle:

Reason → Reach Impasse → Learn from Episodes →
Store New Rule → Reason Better → (repeat)

This is exactly the unified theory of cognition that KBAI aims for!


6. Application to Ravens Progressive Matrices

Using Production Systems

Approach 1: Generic Production Rules Create rules that work for any Ravens problem:

Rule: IF two figures differ by rotation
      THEN apply same rotation to test figure

Rule: IF object moves from inside to outside
      THEN apply same transformation to answer

Advantages:

Disadvantages:

Approach 2: Problem-Specific Rule Induction For each new problem, induce rules from the problem itself:

1. Receive problem (e.g., A, B, C and options)
2. Analyze A → B transformation
3. Create temporary rules encoding that transformation
4. Apply rules to C to generate expected D
5. Match against provided options

Advantages:

Disadvantages:

Learning Component

Both approaches benefit from learning:

Approach 1: Learn new generic rules from problems solved:

After solving many "rotation" problems:
  → Learn: "Rotation patterns are common in Ravens tests"
  → Prioritize checking for rotations

Approach 2: Reuse induced rules when patterns repeat:

If previously encountered "inside → outside, expand":
  → Store as case
  → Retrieve when similar problem appears
  → Adapt rule to new context

The key insight: Production rules can be learned, not just hand-coded, making the system adaptive and improving with experience.


Summary

Key Takeaways

  1. Generate & Test systematically explores solution spaces through generation of candidates and testing for validity. Balance intelligence between generator (creating candidates) and tester (evaluating them) based on problem characteristics.

  2. Means-Ends Analysis is a goal-driven method that identifies differences between current and goal states, selects operators to reduce differences, and iteratively applies them. Most effective for problems with clear distance metrics.

  3. Problem Reduction decomposes complex problems into simpler subproblems, solves each independently, and composes subsolutions. Essential when means-ends analysis alone gets stuck in local minima.

  4. Production Systems are cognitive architectures with working memory (current state) and long-term memory (procedural, semantic, episodic knowledge). They execute through match-select-execute cycles using IF-THEN rules.

  5. Chunking is a learning mechanism that creates new production rules when impasses occur, converting episodic experiences into procedural knowledge. Demonstrates the integration of reasoning, learning, and memory.

  6. Architecture + Content = Behavior principle means fixing the architecture allows us to change behavior by changing knowledge content, simplifying both design and understanding of intelligent systems.

Essential Principles

Integration of Concepts

Semantic Networks (Representation)

Generate & Test (Search)

Means-Ends Analysis (Goal-Driven)

Problem Reduction (Decomposition)

Production Systems (Architecture)

Chunking (Learning)

Each concept builds on previous ones, creating a complete cognitive system capable of reasoning and learning.


See Also


Problem-solving methods are most powerful when coupled with appropriate knowledge representations. The architecture provides the structure; knowledge provides the behavior.