Introduction
Elinvar finds holes in software designs before you write code.
You describe the things in your system (users, roles, orders, states), the links between them, and the rules. Then you state a promise that should never break. Elinvar exhaustively searches every small case up to a size you choose and either confirms that nothing breaks the promise up to that size, or hands you the smallest concrete counterexample showing exactly how it breaks.
It is a single Rust binary (and Rust library) inspired by Alloy, with no Java or runtime dependencies, built to be just as easy for people and AI coding agents to run.
What Elinvar helps you catch
- Permissions and access control: Can a user still read or edit a resource after losing a role or unfollowing an owner?
- Workflows and state machines: Is there a 3-step sequence of actions that leaves an order, lease, or lock in a broken state?
- Database schemas: Import your SQL
CREATE TABLEschema directly and check whether foreign keys,UNIQUE, andCHECKconstraints actually enforce your business rules. - Design changes: Compare two versions of a model with
elinvar diffto see whether a change tightened, loosened, or diverged from the old rules. - Over-constrained rules: Catch contradictory rules (
vacuous) instead of being fooled by a false “passes”, and see which rules actually did the work with--explain.
Where to start
- Want to try it right now? Start with the Quick start.
- Want real-world patterns? Browse Practical examples (permissions, state machines, SQL schemas, diffs, and vacuity traps).
- Using the CLI? See the Command-line reference.
- Testing designs in Rust? Read Checking designs in Rust.
- Connecting Claude Code, Cursor, or Codex? Read Using Elinvar with coding agents.
- New to formal design checking? Read Finding holes in a design.
- Coming from Alloy? Read Alloy, and what Elinvar takes from it.
- Contributing to Elinvar? Read the architecture overview, the design, the logic, and AGENTS.md.
This guide explains how to use Elinvar; the specifications decide edge cases. Where the two disagree, the specification wins.