The Holographic Reasoning Engine leverages Hyperdimensional Computing (HDC) as the primary mechanism for finding candidate proofs and query answers. It uses vector similarity to rapidly identify likely solutions, then validates them with symbolic proof for correctness.

Design Philosophy

Core Principle: HDC similarity for candidate discovery, symbolic reasoning for validation. Combine the speed of vector operations with the precision of logical proof.

The holographic engine prioritizes:

Architecture Overview

Holographic Engine Pipeline
Query/Goal Input AST Build Vector HDC encoding HDC Similarity Search KB Bundle scan Top-K candidates Answer = KB BIND Query⁻¹ Candidates [sim: 0.92, 0.87...] Symbolic Validation Verify each candidate ProofEngine.prove() Validated Results HDC + Symbolic proof Symbolic Fallback If HDC finds nothing Full symbolic search no candidates? Final Result Confidence + Steps HDC Chain Search Transitive relations BFS with HDC edges isA/locatedIn? HDC Rule Search Match conclusion Check conditions Legend: HDC operations Symbolic validation Fallback

HDC-First Proof Strategy

HolographicProofEngine follows this pipeline:

Step Operation Description
1 Build Goal Vector Encode goal as HDC vector using positional binding
2 Check Negation Verify goal isn't explicitly negated in KB
3 HDC Direct Search Scan KB for similar vectors (threshold: HDC_MATCH)
3b Synonym Matching Try ComponentKB synonym expansion if no direct match
4 Symbolic Validation Verify HDC candidate with ProofEngine
5 HDC Transitive Search BFS through HDC-similar edges for transitive relations
6 HDC Rule Search Match rule conclusions via similarity, check conditions
7 Symbolic Fallback If HDC fails, run full symbolic proof search

Core Classes

HolographicProofEngine

Drop-in replacement for ProofEngine. Same interface, different strategy.

import { HolographicProofEngine } from './reasoning/holographic/prove-hdc-first.mjs';

const engine = new HolographicProofEngine(session, {
  maxDepth: 10,
  timeout: 5000
});

// Prove using HDC-first approach
const result = engine.prove({
  type: 'Statement',
  operator: { name: 'isA' },
  args: [{ name: 'Tweety' }, { name: 'Animal' }]
});

// Result includes method information
console.log(result);
// {
//   valid: true,
//   confidence: 0.91,
//   method: 'hdc_transitive_validated',  // HDC found it, symbolic validated
//   steps: [...],
//   reasoningSteps: 3
// }

Key Methods

Method Description
prove(goal) Main entry. HDC search first, symbolic validation, then fallback.
hdcDirectSearch(vec, str) Scan KB bundle for similar vectors. Returns candidates.
hdcTransitiveSearch(goal, vec) BFS through HDC edges for transitive chains.
hdcRuleSearch(goal, vec) Match rule conclusions via similarity, verify conditions.
validateWithSymbolic(goal) Confirm HDC candidate with full symbolic proof.

HolographicQueryEngine

HDC-first query resolution using the unbind operation.

import { HolographicQueryEngine } from './reasoning/holographic/query-hdc-first.mjs';

const engine = new HolographicQueryEngine(session);

// Query: "What can Tweety do?" (can Tweety ?action)
const result = engine.execute({
  type: 'Statement',
  operator: { name: 'can' },
  args: [
    { name: 'Tweety', type: 'Identifier' },
    { name: 'action', type: 'Hole' }
  ]
});

// HDC unbind finds candidates, symbolic validates
console.log(result);
// {
//   success: true,
//   bindings: Map { 'action' => { answer: 'Fly', similarity: 0.94, method: 'hdc_validated' } },
//   confidence: 0.94,
//   allResults: [...]
// }

HDC Query Pipeline

  1. Parse Query: Identify holes (unknowns) and knowns
  2. Build Partial Vector: Encode knowns with positions
  3. HDC Unbind: Answer = KB BIND QueryPartial⁻¹ BIND Position⁻¹
  4. Top-K Vocabulary: Find most similar entities
  5. Symbolic Validation: Prove each candidate
  6. Merge with Symbolic: Combine HDC + fallback results

HolographicCSPSolver

Constraint Satisfaction with HDC-guided heuristics.

import { HolographicCSPSolver } from './reasoning/holographic/csp-hdc-heuristic.mjs';

const solver = new HolographicCSPSolver(session, {
  hdcWeight: 0.7,     // Weight for HDC heuristic
  maxSolutions: 100
});

// Same interface as CSPSolver
solver.addVariable('Alice', ['Table1', 'Table2', 'Table3']);
solver.addVariable('Bob', ['Table1', 'Table2', 'Table3']);
solver.addNoConflict('Alice', 'Bob');

const result = solver.solve();
// HDC guides domain ordering for faster search

CSP HDC Heuristics

Constraint Satisfaction Vectors

Build HDC vectors representing valid assignment states. Bundle all valid configurations.

// Valid state: Alice at T1, Bob at T2
const state = bind(
  bind(AliceVec, Table1Vec),
  bind(BobVec, Table2Vec)
);
csBundle = bundle([...validStates]);

Domain Ordering

Order domain values by HDC similarity to constraint satisfaction bundle.

// Score hypothetical assignment
const score = scoreCandidate(
  session,
  hypotheticalAssignment,
  csBundle
);
// Higher similarity = try first

Early Pruning

Skip candidates with low similarity to valid states.

// In backtracking search
if (score < VERIFICATION_THRESHOLD) {
  stats.hdcPruned++;
  continue;  // Skip this branch
}

The HDC Master Equation

Answer = KB BIND Query⁻¹

The holographic query equation leverages HDC's algebraic properties:

Result vector is similar to the missing component(s).

// For query: "isA Tweety ?what"
// Query vector encodes: operator=isA, pos1=Tweety, pos2=?

const queryPartial = bind(
  isAVec,
  bind(Pos1Vec, TweetyVec)
);

// Unbind from KB to get what's at position 2
const answerVec = unbind(
  unbind(kbBundle, queryPartial),
  Pos2Vec
);

// Find most similar in vocabulary
const candidates = topKSimilar(answerVec, vocabulary, 10);
// → [{ name: 'Bird', similarity: 0.94 }, ...]

Synonym-Aware Matching

The holographic engine integrates with ComponentKB for semantic matching:

// KB contains: isA Rex Dog
// Query: isA Rex Canine
// ComponentKB knows: Dog synonymOf Canine

const result = engine.prove(parseGoal("isA Rex Canine"));
// {
//   valid: true,
//   confidence: 0.95,
//   method: 'synonym_match',
//   matchedFact: 'isA Rex Dog',
//   steps: [{ operation: 'synonym_match', synonymUsed: 'Canine <-> Dog' }]
// }

Configuration Thresholds

HDC thresholds are strategy-dependent (dense-binary vs sparse-polynomial vs metric-affine/EMA vs EXACT):

// From constants.mjs - holographic-specific thresholds
const holographicThresholds = {
  // Query unbind
  UNBIND_MIN_SIMILARITY: 0.3,    // Minimum to consider as candidate
  UNBIND_MAX_CANDIDATES: 15,     // Top-K limit

  // Proof search
  HDC_MATCH: 0.85,               // Direct KB match threshold
  CONCLUSION_MATCH: 0.7,         // Rule conclusion similarity
  VERIFICATION: 0.6,             // Symbolic validation threshold

  // Behavior flags
  FALLBACK_TO_SYMBOLIC: true,    // Allow symbolic fallback
  VALIDATION_REQUIRED: true      // Require symbolic validation
};

Some concrete implications:

Statistics Tracking

Additional stats specific to holographic mode:

session.reasoningStats = {
  // HDC queries
  holographicQueries: 0,
  hdcUnbindAttempts: 0,
  hdcUnbindSuccesses: 0,

  // HDC proofs
  holographicProofs: 0,
  hdcProofSuccesses: 0,

  // Validation
  hdcValidationAttempts: 0,
  hdcValidationSuccesses: 0,

  // Fallbacks
  symbolicProofFallbacks: 0,

  // CSP
  holographicCSP: 0,
  cspBundleBuilt: 0,
  cspSymbolicFallback: 0
};

Transitive Chain Discovery

HDC-guided BFS for transitive relations:

// Finding: isA Tweety Animal
// KB: isA Tweety Bird, isA Bird Animal

// 1. Start at Tweety, find HDC-similar "isA Tweety ?" edges
const edges = findHDCEdges('isA', 'Tweety');
// → [{ to: 'Bird', similarity: 0.96 }]

// 2. BFS continues from Bird
const edges2 = findHDCEdges('isA', 'Bird');
// → [{ to: 'Animal', similarity: 0.95 }]

// 3. Found target! Build chain
const chain = [
  { from: 'Tweety', to: 'Bird', similarity: 0.96 },
  { from: 'Bird', to: 'Animal', similarity: 0.95 }
];

// 4. Validate each step symbolically
for (const step of chain) {
  if (!symbolicEngine.prove(`isA ${step.from} ${step.to}`).valid) {
    return { valid: false };
  }
}

// 5. Return validated chain proof
return {
  valid: true,
  confidence: computeChainConfidence(chain.length),
  method: 'hdc_transitive_validated',
  steps: chain.map(...)
};

Comparison with Symbolic Engine

Aspect Symbolic Holographic
Primary mechanism Rule/pattern matching Vector similarity
Search strategy Priority-ordered strategies HDC candidates + validation
KB access pattern Targeted lookups Bundle similarity scan
False positive risk None (exact match) Mitigated by validation
Fuzzy matching Limited (synonyms only) Native (similarity)
CSP heuristics Standard backtracking HDC-guided ordering
Best for Strict correctness Large/noisy KBs

When Holographic Shines

Large Knowledge Bases

HDC bundle operations scale sub-linearly. Finding candidates in 100K facts is nearly as fast as 1K facts.

Noisy/Incomplete Data

Similarity-based search finds relevant facts even with spelling variations or incomplete information.

Similarity Queries

Native support for "find things similar to X" without explicit rules.

Complex CSP Problems

HDC heuristics can dramatically reduce search space in constraint satisfaction.

Limitations

Important: Holographic mode doesn't replace symbolic reasoning. It accelerates candidate discovery while relying on symbolic validation for correctness guarantees.

Example: Complete HDC Proof Trace

// Query: prove "can Tweety Fly"
// KB: isA Tweety Bird, can Bird Fly

const result = engine.prove(parseGoal("can Tweety Fly"));

// Trace:
// 1. Build goal vector: bind(canVec, bind(Pos1, TweetyVec), bind(Pos2, FlyVec))
// 2. HDC direct search: best similarity = 0.72 (below threshold)
// 3. Synonym check: no synonyms for 'can'
// 4. HDC rule search:
//    - Found rule: "If isA ?x Bird Then can ?x Fly"
//    - Conclusion similarity: 0.89
//    - Check condition "isA Tweety Bird": HDC finds it (0.96)
//    - Validate condition symbolically: ✓
// 5. Validate rule application symbolically: ✓

// Result:
{
  valid: true,
  confidence: 0.85,
  method: 'hdc_rule_validated',
  goal: 'can Tweety Fly',
  rule: 'BirdCanFly',
  steps: [
    {
      operation: 'rule_application',
      rule: 'BirdCanFly',
      confidence: 0.85
    }
  ],
  reasoningSteps: 4
}