Skip to content

Examples gallery

Clone the repository to run these models; the Python package installation does not place the examples in your working directory:

git clone https://github.com/angru/analint
cd analint
uv sync --frozen
uv run analint check examples/cloak/

Each example has a README describing its assumptions and intended result. examples/expectations.toml records verdicts separately from the detailed regression snapshots. A deliberately failing model is a successful demonstration when it exposes the documented defect.

Start here

Example What to learn Intended verdict
E-commerce Single-file actions, constraints, scenarios and payload templates PASS
Taskboard Multi-file composition, explicit contracts and terminal lifecycles PASS
Cloak of Darkness A game walkthrough found through reachability; recoverability through NoDeadEnd PASS
Trollbridge All scenarios pass, but exploration finds a softlock and negative health FAIL, deliberate

Larger models and domain evidence

Example What to learn Intended verdict
Fulfillment State-chained order saga with compensations and reachable settlement PASS
Branch protection A finite model of GitHub protected-branch policy and requirement changes PASS
OAuth Scoped clients, token provenance, replay revocation and a Quint comparison PASS
Kubernetes ReplicaSet Bounded Pods, quota, presence, aggregates and ownership provenance PASS
Broker Verification, accounts and payments composed from contracts; property slicing PASS

Fulfillment requirement-change trial

This trial uses the 0.1.0 check-selection API.

This repository-example trial exercises check selection with one shared model. The baseline customer cancellation window closes at payment capture. The additive hypothesis permits cancellation while the shipment is in transit, with cancellation and refund in one atomic model action. Cancellation after delivery is rejected. The original pre-dispatch cancellation policy remains.

Run from the repository checkout:

uv run python scripts/trial_fulfillment.py --output /tmp/fulfillment-trial
uv run analint check examples/fulfillment \
  --what-if benchmarks/fulfillment_cancellation.py \
  --check flow:cancel_in_transit --check query:no_money_for_nothing \
  --max-states 20000 -f json

The runner leaves the baseline example unchanged. It saves the baseline inspection, exact before/after/control hypotheses, full and compact reports, CLI exit codes, witnesses with state changes, and a source-hashed summary under --output. CI compares fresh verdicts, per-query state counts, flow outcomes and action counts with the committed measurement record. Timings, byte sizes and historical source metadata are excluded. If behavior intentionally changes, review and update both the record and this guide; do not regenerate the baseline merely to make CI pass. The same guard runs from the source archive against the built wheel. The extended model is an additive what-if revision, not a new root for each flow. Within each revision, all selections reuse the same prepared Spec; the runner checks membership identity and unchanged declarations. Every original action is retained, including delivery, loss and compensations.

Model revision Full check Selected flows Selected payment safety Exact states per property
Baseline PASS No flows declared PASS in full run 34
Old model plus new requirement probes FAIL Cancellation fails; delivery passes PASS (14 projected states) 34
Cancellation with atomic refund PASS PASS separately and together PASS (14 projected states) 36
Above plus an alternative cancellation without refund FAIL PASS separately and together FAIL 38

The old-model probe fails because the new journey is blocked, not because the old model is inconsistent. The negative control adds cancel_without_refund outside both flows. Property exploration finds it after supplier_restock → reserve_stock → authorize_payment → confirm_order → capture_payment → dispatch → cancel_without_refund. The order is cancelled while payment stays captured; settlement_always_reachable also fails because no recovery is possible. Both explicit flows still pass: their coverage is executed_steps_only. The control intentionally has one structural.no_scenarios warning; that warning is retained and is not the cause of the non-strict FAIL.

All 44 cases agree between sliced and whole-model verification at a 20,000-state budget. CLI/library results, check/trace action paths, and cold/warm cache reports also agree (excluding timings and the requested cache-option metadata). The passing selected safety proof needs no supporting invariant; the failing control falls back to the constrained path with delivered_means_paid as support. No query is INCONCLUSIVE and no original action is removed.

The two passing selected safety checks use the over-approx model relation. The projection explores 14 states in each revision. The exact slices explore 34 and 36 states respectively. An earlier Python 3.14 run measured about 4.3 ms for full validation, 4.0 ms for the exact safety selection, and 1 ms per individual flow, excluding preparation. See the committed measurement record for source hashes and all measurements.

Bounds: one order, one payment, one shipment and a warehouse capacity of two. Refund is atomic with cancellation; payment-provider latency, physical returns, continued carrier activity after cancellation, retries and concurrent orders are outside the model. NoDeadEnd establishes reachable settlement, not eventual completion. This is an invented repository example and does not close the external real-spec trial or establish production conformance. No engine change or new DSL primitive was needed.

Games and comparison models

Example What to learn Intended verdict
Coin Quint tutorial translated into the DSL; reproduces a supply-overflow counterexample FAIL, deliberate
Mafia Declarative initial role assignments, finite quantifiers and parameterized actions PASS
Sunless Crypt One model both verified and played using the example runner PASS

PASS describes the declared finite abstraction. It does not claim that a real OAuth deployment, Kubernetes cluster or broker implementation has been verified. Read each model's assumptions before reusing its properties.

Scaling benchmarks

benchmarks/broker/m4.py, m5.py and m6.py extend the broker baseline with risk, partner restrictions and bounded multiplicity. They are experimental benchmark entries, separate from the example-intent gallery. Their composed explorations can exhaust their budget and remain INCONCLUSIVE; executable fixture scenarios do not replace a complete canonical proof. See the broker benchmark notes for bounds, measurements and the separate settlement abstractions.

The verification concepts explain how to distinguish a counterexample, an expected rejection and an unfinished exploration.