Epistemic Type Checker
The AXON Type Checker validates semantic type constraints before IR generation. It enforces epistemic rules that distinguish between different categories of information.What Makes It Epistemic?
Unlike traditional type systems that track memory layout and control flow, AXON’s type system tracks the nature and reliability of information:| Traditional | Epistemic |
|---|---|
String | FactualClaim |
Object | Opinion |
Number | Uncertainty |
| Control flow | Information flow |
Opinion can never satisfy a FactualClaim, even if they have the same string representation.
Type Checker Architecture
Overview
Built-in Semantic Types
Epistemic Types (Mutually Exclusive)
Opinion cannot be used where a FactualClaim is expected.
Content Types
Analysis Types (with Ranges)
The Epistemic Lattice
AXON uses a partial order lattice to define type subsumption relationships:Type Hierarchy
Subsumption Examples
Type Compatibility Checking
Basic Compatibility
Uncertainty Propagation
Uncertainty is contagious — it propagates through computations:Graded Monads (Uncertainty)
AXON supports graded uncertainty types that track confidence levels:Validation Rules
1. Name Resolution
Rule: All referenced names must be declared.2. Persona Field Validation
Rule: Tone must be from the valid set.3. Confidence Threshold Validation
Rule: Confidence must be in range [0.0, 1.0].4. Anchor Completeness
Rule: Anchors withon_violation: raise must specify an error type.
5. Flow Step Dependencies
Rule: Step names must be unique within a flow.Symbol Table
Structure
Registration Phase
Error Reporting
AxonTypeError Structure
Example Error Output
Validation Workflow
Next Steps
AST to IR
See how validated AST is lowered to model-agnostic IR
Runtime Validator
Learn how semantic types are enforced at runtime
