Validation in AGISystem2 is the process of verifying that knowledge and reasoning results satisfy consistency constraints. The ValidationEngine performs checks at multiple levels: individual assertions, reasoning chains, and global theory coherence.

Input ASSERT / ASK 1. Syntactic Valid DSL syntax? Concepts exist? Relations defined? 2. Semantic Dimension ranges? No self-loops? Type constraints? 3. Consistent No conflicts with existing knowledge Validation Checks Local (per assertion) A IS_A B → A ⊆ B? Chain (reasoning path) A→B→C implies A→C? Global (whole theory) No cycles? No orphans? Conflict Detection ASSERT Dog IS_A Mammal ASSERT Dog IS_A Fish ⚠ Mammal ∩ Fish = ∅ → CONFLICT Valid Update ASSERT Dog IS_A Mammal ASSERT Dog IS_A Animal ✓ Mammal ⊆ Animal → OK

The ValidationEngine processes input through three stages: syntactic checks (valid DSL), semantic checks (valid dimensions and types), and consistency checks (no conflicts with existing knowledge). Conflicts are detected when assertions would place a concept in incompatible regions.

What Gets Validated

Check TypeWhat It VerifiesExample Failure
Syntactic DSL grammar, concept names exist "UnknownConcept IS_A Animal"
Dimension bounds Int8 values in [-128, +127] Property value 200 (out of range)
Containment IS_A implies geometric containment Dog IS_A Fish when Mammal ∩ Fish = ∅
Cycle detection No circular IS_A chains A IS_A B, B IS_A C, C IS_A A
Axiological Value dimensions consistent GOOD and EVIL on same concept

Implementation

The ValidationEngine exposes three main methods:

// Validate a single assertion before committing
const result = validationEngine.validateAssertion(assertion, context);
// result: { valid: true } or { valid: false, reason: "..." }

// Check consistency of a reasoning chain
const chainResult = validationEngine.validateChain(steps);

// Full theory consistency check
const globalResult = validationEngine.validateTheory(theoryStack);

When validation fails, the engine returns a detailed error with the conflict location and suggested fix.

Validation Modes

ModeBehaviorUse Case
Strict Reject on any inconsistency Production, safety-critical
Warn Log warning, allow operation Development, exploration
Repair Auto-adjust to fix conflicts Learning, incremental updates

Related Documentation