Expand description
AISP 5.1 Document Validation Library
AISP (AI Symbolic Protocol) is a formal specification language designed for precise AI-to-AI communication with <2% ambiguity.
§Features
- Validation: Validate AISP documents with semantic density scoring
- Streaming: Process large documents with streaming validation (feature:
streaming) - Quality Tiers: Automatic tier classification (⊘, ◊⁻, ◊, ◊⁺, ◊⁺⁺)
- No-std Support: Works without std (disable default features)
§Quick Start
use aisp::{validate, Tier};
let doc = r#"
𝔸1.0.example@2026-01-16
γ≔test
⟦Ω:Meta⟧{ ∀D:Ambig(D)<0.02 }
⟦Σ:Types⟧{ T≜ℕ }
⟦Γ:Rules⟧{ ∀x:T:x≥0 }
⟦Λ:Funcs⟧{ f≜λx.x }
⟦Ε⟧⟨δ≜0.75;φ≜100;τ≜◊⁺⁺⟩
"#;
let result = validate(doc);
assert!(result.valid);
assert!(result.tier >= Tier::Silver);§Streaming Validation
For large documents, use the streaming API:
ⓘ
use aisp::streaming::StreamValidator;
let mut validator = StreamValidator::new();
validator.feed(chunk1);
validator.feed(chunk2);
let result = validator.finish();Structs§
- Density
Metrics - Detailed density metrics
- Symbol
- Symbol entry in the glossary
- Symbol
Id - Symbol identifier (2 bytes)
- Validation
Result - Validation result
Enums§
Constants§
- ABSOLUTE_
MAX_ SIZE - Absolute maximum document size (1MB)
- DEFAULT_
MAX_ SIZE - Maximum default document size (64KB)
- REQUIRED_
BLOCKS - Required blocks for a valid AISP document
- SUPPORTED_
EXTENSIONS - Supported file extensions
Statics§
- AISP_
SYMBOLS - Core AISP symbols (subset of Σ_512 for size optimization)
Functions§
- count_
symbols - Count AISP symbols in a string
- count_
tokens - Count non-whitespace tokens in a string
- get_
density - Get the semantic density of a document
- get_
glyph - Get the glyph string for a symbol ID
- get_
tier - Get the quality tier of a document
- is_
aisp_ char - Check if a character is an AISP symbol
- is_
extension_ supported - Check if a file extension is supported
- is_
valid - Quick validation check (returns only boolean)
- lookup_
symbol - Look up symbol by glyph string
- starts_
with_ symbol - Check if string starts with an AISP symbol Returns (SymbolId, byte length) if found
- validate
- Validate an AISP document