Module tms

Module tms 

Source
Expand description

Truth Maintenance System (TMS)

This module implements a Truth Maintenance System similar to CLIPS and Drools.

Key features:

  • Justification tracking: Track WHY facts exist
  • Logical assertions: Facts derived by rules vs. explicitly asserted
  • Automatic retraction: Auto-retract derived facts when premises change
  • Dependency chains: Track support relationships between facts

Example:

// Rule derives a fact
rule "InferPremium" {
    when Customer.spent > 10000
    then logicalAssert(Customer.tier = "Premium");
}
 
// When Customer.spent changes to 5000:
// → TMS auto-retracts Customer.tier = "Premium"

Structs§

Justification
Justification records WHY a fact exists
TmsStats
TMS statistics
TruthMaintenanceSystem
Truth Maintenance System

Enums§

JustificationType
Type of justification for a fact