icl-core
Canonical Rust implementation of the Intent Contract Language (ICL) specification.
icl-core is the core library that implements the full ICL processing pipeline: parsing, normalization, verification, and execution. All logic is written once in Rust and compiled to every target (native, Python/PyO3, JavaScript/WASM, Go/cgo).
Features
- Parser — Tokenizer + recursive descent parser producing a typed AST
- Normalizer — Canonical form generation with SHA-256 content hashing
- Verifier — Type checking, invariant validation, determinism proof, coherence checks
- Executor — Sandboxed execution with provenance tracking
- Deterministic — Same input always produces identical output, guaranteed
Usage
use parser;
use normalizer;
use verifier;
use executor;
let source = read_to_string.unwrap;
// Parse ICL source into AST
let ast = parse.unwrap;
// Normalize to canonical form
let canonical = normalize.unwrap;
// Compute semantic hash
let hash = compute_semantic_hash;
// Verify all properties (types, invariants, determinism, coherence)
let result = verify;
assert!;
// Parse into high-level Contract and execute
let contract = parse_contract.unwrap;
let output = execute_contract.unwrap;
Architecture
ICL Text → Parser → AST → Normalizer → Canonical Form
↓
Verifier → Type Check + Invariants + Determinism
↓
Executor → Sandboxed Execution
Testing
203 tests covering every pipeline stage plus determinism proofs:
License
MIT — See LICENSE for details.