Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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 TABLE schema directly and check whether foreign keys, UNIQUE, and CHECK constraints actually enforce your business rules.
  • Design changes: Compare two versions of a model with elinvar diff to 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

This guide explains how to use Elinvar; the specifications decide edge cases. Where the two disagree, the specification wins.