aisp
AISP 5.1 document validation library — AI Symbolic Protocol with <2% ambiguity.
Overview
AISP (AI Symbolic Protocol) is a formal specification language designed for high-density, low-ambiguity AI-to-AI communication. This crate provides:
- Validation: Validate AISP documents with semantic density scoring
- Streaming: Process large documents with streaming validation
- Quality Tiers: Automatic tier classification (⊘, ◊⁻, ◊, ◊⁺, ◊⁺⁺)
- No-std Support: Works without std (disable default features)
Quick Start
use ;
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;
assert!;
assert!;
println!;
Features
| Feature | Description | Default |
|---|---|---|
std |
Standard library support | ✓ |
streaming |
Streaming validation for large docs | |
serde |
Serialization support | |
wasm |
WebAssembly optimization |
# Enable streaming
[]
= { = "0.1", = ["streaming"] }
# Minimal no-std
[]
= { = "0.1", = false }
Streaming Validation
For documents larger than available memory:
use StreamValidator;
let mut validator = new;
// Feed chunks as they arrive
validator.feed?;
validator.feed?;
// ... more chunks
let result = validator.finish;
Quality Tiers
| Tier | Symbol | Density (δ) | Description |
|---|---|---|---|
| Reject | ⊘ | < 0.20 | Invalid, insufficient formalization |
| Bronze | ◊⁻ | ≥ 0.20 | Minimum valid AISP |
| Silver | ◊ | ≥ 0.40 | Basic formal specification |
| Gold | ◊⁺ | ≥ 0.60 | Well-structured specification |
| Platinum | ◊⁺⁺ | ≥ 0.75 | Complete, proof-carrying spec |
API Reference
Core Functions
// Full validation with metrics
let result = validate;
// Quick boolean check
let is_valid = is_valid;
// Get tier only
let tier = get_tier;
// Get density only
let delta = get_density;
Symbol Operations
use ;
// Check if character is AISP symbol
assert!;
assert!;
// Count AISP symbols in text
let count = count_symbols;
// Look up symbol by glyph
let id = lookup_symbol.unwrap;
Required Blocks
Valid AISP documents must contain these 5 blocks:
| Block | Purpose |
|---|---|
⟦Ω⟧ |
Meta/Foundation |
⟦Σ⟧ |
Types/Glossary |
⟦Γ⟧ |
Rules/Inference |
⟦Λ⟧ |
Functions |
⟦Ε⟧ |
Evidence |
Supported Extensions
.aisp- Primary AISP format.md- Markdown with embedded AISP.txt- Plain text AISP.spec- Specification files.aisp5- AISP 5.x format
Size Limits
| Limit | Size |
|---|---|
| Default max | 64 KB |
| Absolute max | 1 MB |
| WASM kernel | 1 KB |
Author
Bradley Ross — GitHub @bar181
License
Dual licensed under MIT OR Apache-2.0.
Links
- Repository: https://github.com/bar181/aisp-open-core
- Documentation: https://docs.rs/aisp
- AISP Specification: See
AI_GUIDE.mdin repository