Expand description
Execution engine — runs contracts deterministically in a sandbox
The executor evaluates preconditions, runs operations in an isolated environment, verifies postconditions, and logs all state transitions.
§Architecture
ICL is a specification language, not a scripting language. Operations define typed state transitions with preconditions and postconditions expressed as natural-language strings. The executor:
- Maintains typed state matching DataSemantics.state
- Validates inputs against operation parameter types
- Evaluates simple condition patterns against state
- Applies state transitions (parameter values → state fields)
- Verifies postconditions and invariants hold
- Enforces resource limits (memory, timeout)
- Logs every transition in an immutable provenance log
§Determinism
The executor is pure — no I/O, no randomness, no system time. All operations are deterministic: same state + same inputs = same result.
Structs§
- Execution
Result - Result of executing a full contract
- Execution
State - The mutable state of a contract during execution. Uses BTreeMap for deterministic field ordering.
- Executor
- The contract executor — runs operations deterministically in a sandbox
- Expression
Evaluator - Evaluates simple condition patterns against execution state.
- Operation
Result - Result of executing a single operation
- Provenance
Entry - A single entry in the provenance log — records one state transition
- Provenance
Log - Immutable append-only provenance log
- Sandbox
- Isolated execution environment with resource limits
- State
Change - A single field change within a state transition
Enums§
- Sandbox
Mode - Sandbox isolation levels from spec §1.6
- Value
- A typed runtime value in the execution state
Functions§
- execute_
contract - Execute a contract with given inputs (convenience function — public API)