Core Principle
Epistemic Types = Meaning TypesTypes in AXON track what information means and how reliable it is, not how many bytes it occupies in memory.
Opinion from being used where a FactualClaim is required, or propagating Uncertainty through computations to maintain epistemic honesty.
The Partial Order Lattice
AXON’s type system is formalized as a partial order lattice(T, ≤), where ≤ represents the subsumption relationship between types.
Lattice Structure
Subsumption Rule
Examples:CitedFact ≤ FactualClaim— A cited fact is a factual claimHighConfidenceFact ≤ CitedFact— A high-confidence fact is a cited factOpinion ≤ Any— An opinion is some form of informationOpinion ≰ FactualClaim— An opinion cannot satisfy a factual claim requirement
Type Categories
1. Epistemic Types (Reliability)
Track the epistemic status of information — how certain, verifiable, or grounded it is.FactualClaim
FactualClaim
Information presented as objectively verifiable fact.Subsumption:
Cannot contain:
FactualClaim ≤ AnyCannot contain:
Opinion, SpeculationCitedFact
CitedFact
A factual claim with explicit source attribution.Subsumption:
CitedFact ≤ FactualClaim ≤ AnyHighConfidenceFact
HighConfidenceFact
A cited fact with confidence score ≥ 0.85 (configurable).Subsumption:
Use case: Medical, legal, or financial domains requiring high certainty.
HighConfidenceFact ≤ CitedFact ≤ FactualClaim ≤ AnyUse case: Medical, legal, or financial domains requiring high certainty.
Opinion
Opinion
Subjective judgment or interpretation.Critical:
Opinion ≰ FactualClaim — opinions never satisfy factual requirements.Uncertainty
Uncertainty
Lack of sufficient information to make a determination.
Speculation
Speculation
Conjecture without evidence.Subsumption:
Speculation ≤ Any but incompatible with most epistemic types.2. Content Types (Data)
Represent structured or unstructured information that flows through pipelines.| Type | Description | Example Use |
|---|---|---|
Document | Raw text document | Contract PDFs, emails |
Chunk | Segmented portion of a document | Paragraph, section |
EntityMap | Extracted structured entities | Parties, dates, obligations |
Summary | Condensed representation | Executive summary |
Translation | Language-translated content | EN → ES |
Example: Content pipeline
3. Analysis Types (Metrics)
Quantitative or qualitative assessments with bounded ranges.Range Constraints: Analysis types have built-in validation. Values outside the declared range raise
ValidationError.4. Structural Types (User-Defined)
Custom types for domain-specific entities.contract_analyzer.axon
Type Checking
AXON performs semantic type checking at compile time via theTypeChecker module.
Compatibility Matrix
The type checker uses anEpistemicLattice class to determine type compatibility:
type_checker.py
Validation Rules
Runtime Validation
While theTypeChecker catches structural issues at compile time, semantic validation happens at runtime via the SemanticValidator.
How It Works
- Step Execution — Model produces output
- Semantic Classification — Runtime determines epistemic type
- Lattice Check — Validator checks
actual_type ≤ declared_type - Action — Pass, raise
ValidationError, or triggerrefine
semantic_validator.py
Special Type Rules
Optional Types
Use? suffix for optional fields:
List Types
Range Types
Union Types (Planned)
Type Inference
AXON performs limited type inference for intermediate values:Design Choice: Step outputs require explicit type declarations for clarity and safety. Intermediate expressions support inference.
Comparison with Other Type Systems
| Feature | TypeScript | Python | Haskell | AXON |
|---|---|---|---|---|
| Structural types | ✅ | ❌ | ❌ | ✅ |
| Epistemic types | ❌ | ❌ | ❌ | ✅ |
| Runtime validation | ❌ | Partial | ❌ | ✅ |
| Uncertainty propagation | ❌ | ❌ | ❌ | ✅ |
| Semantic subsumption | ❌ | ❌ | Partial | ✅ |
Next Steps
Cognitive Primitives
Learn about the 12 core primitives
Error Handling
See how type errors are handled
Compilation Pipeline
Understand type checking in the compiler
Examples
See types in real programs
