Non-monotonic logic allows AGISystem2 to revise conclusions when new information arrives. Unlike classical logic where adding facts never invalidates previous conclusions, non-monotonic reasoning supports defaults, exceptions, and belief revision through theory layers.

1. Default Rule Birds typically fly DEFAULT Bird → CanFly Tweety IS_A Bird → Tweety CanFly ✓ 2. Exception Added New fact arrives: Tweety IS_A Penguin Penguin ¬CanFly 3. Revised Previous conclusion retracted: Tweety CanFly → ✗ Tweety ¬CanFly ✓ Layer-Based Revision Exception layer Default layer Higher layers override lower Monotonic vs Non-Monotonic Monotonic More facts → more conclusions Non-Monotonic More facts → may retract some Sys2DSL Syntax DEFAULT Bird CAN Fly # Default rule EXCEPTION Penguin CANNOT Fly # Override

Non-monotonic reasoning allows conclusions to be retracted when exceptions are discovered. AGISystem2 implements this through theory layers: defaults live in the base layer, and exceptions in higher layers override them. The "birds fly" default is retracted for Tweety when we learn Tweety is a penguin.

Key Concepts

ConceptDefinitionExample
Default Rule that applies unless overridden "Birds typically fly"
Exception Specific case that overrides default "Penguins don't fly"
Specificity More specific rules override general Penguin > Bird
Retraction Withdrawing a previous conclusion "Tweety flies" → retracted

How It Works

AGISystem2 implements non-monotonic logic through the TheoryStack:

  1. Defaults in base layer – General rules with DEFAULT keyword
  2. Exceptions in higher layers – Override defaults when conditions match
  3. Query resolution – Search from top layer down, first match wins
  4. Automatic retraction – Previous conclusions invalidated by new exceptions

DSL Syntax

# Define default rule
DEFAULT Bird CAN Fly

# Define exception
EXCEPTION Penguin CANNOT Fly

# Assertions
ASSERT Tweety IS_A Penguin
ASSERT Penguin IS_A Bird

# Query (non-monotonic resolution)
ASK "Tweety CAN Fly?"
# → FALSE (Penguin exception overrides Bird default)

Priority Resolution

When multiple rules apply, priority determines the winner:

# Explicit priority
DEFAULT PRIORITY=10 Employee gets=StandardBenefits
DEFAULT PRIORITY=20 Executive gets=ExecutiveBenefits  # Higher priority wins

# Specificity-based (automatic)
DEFAULT Mammal IS warm_blooded      # General
EXCEPTION Platypus IS cold_blooded   # Specific override

Validation During Revision

The ValidationEngine checks consistency during belief revision:

// Add new fact that may trigger retractions
const result = knowledge.assertWithRevision("Tweety IS_A Penguin");

// Result includes what was retracted
{
  added: ["Tweety IS_A Penguin"],
  retracted: ["Tweety flies"],
  reason: "Exception Penguin overrides default Bird"
}

Audit Trail

All retractions are logged for auditability:

{
  event: "BELIEF_RETRACTED",
  belief: "Tweety flies",
  reason: "Exception triggered by: Tweety IS_A Penguin",
  timestamp: "2024-01-15T10:30:00Z"
}

Related Documentation