Checking Specs
intent check <file>
The check command parses a .intent file and runs six semantic analysis passes:
- Collect definitions — gather all entity, action, and invariant names; detect duplicates
- Resolve type references — verify that all types are either built-in or defined as entities
- Validate quantifier bindings — ensure
forall/existsbind to valid entity or action types - Validate edge case actions — check that edge case handlers reference valid operations
- Validate field access — verify dotted field access on entity-typed parameters
- Constraint validation — check
old()placement and detect tautological comparisons
Success output
$ intent check examples/transfer.intent
OK: TransferFunds — 7 top-level item(s), no issues found
Error output
Errors include source spans, labels, and actionable help via miette:
intent::check::undefined_type
× undefined type `Customer`
╭─[5:13]
4 │ id: UUID
5 │ ╭─▶ customer: Customer
6 │ ├─▶ items: List<LineItem>
· ╰──── used here
7 │ }
╰────
help: define an entity named `Customer`, or use a built-in type
intent::check::old_in_requires
× `old()` cannot be used in a `requires` block
╭─[13:21]
12 │ requires {
13 │ ╭─▶ from.balance == old(from.balance)
14 │ ├─▶ }
· ╰──── used here
╰────
help: `old()` references pre-state values and is only meaningful in `ensures` blocks