Alpha. Vary is under active development and not ready for production use. Syntax, APIs, performance, and behaviour may change between releases.
Other verification tools
The closest relatives
Vary copies the established automatic, contract-based recipe: you write contracts and a few annotations, and an SMT solver does the rest.
| Tool | What it is | How it relates to Vary |
|---|---|---|
| Dafny | A language designed for verification, with requires, ensures, loop invariants, decreases, ghost code and lemmas. Verifies through Boogie and Z3 and compiles to several targets | The main model for the design and the annotation vocabulary. In Dafny verification is the point of the language and a failed proof is a compile error. In Vary it is optional |
| SPARK (Ada) | A verifiable subset of Ada. GNATprove generates conditions through Why3 and uses several SMT solvers. Used in avionics, rail and security-critical systems | The industrial proof that this approach scales. Like Vary, it proves contracts that also exist as run-time checks. It has far more history, tooling and proven fragment |
| Why3 | A platform and intermediate language (WhyML) for deductive verification with many solver back-ends. SPARK, Frama-C and Creusot build on it | Vary has its own small pipeline instead of an intermediate verifier. That keeps the back end small and means Vary does not inherit Why3's breadth |
| Frama-C (WP) | Verification of C using ACSL annotations in comments | The same contract idea applied to an unsafe language. The contracts live outside the language, so they are not run-time checks |
| Eiffel (AutoProof) | The language that popularised Design by Contract, with a static verifier | in and out blocks are Design by Contract. Eiffel's contracts were checked at run time first, as Vary's were |
| Java: JML, OpenJML, KeY | Contract annotations for Java with static tools | Vary targets the same VM. JML lives in comments and is not part of the language |
Different approaches
| Tool | Approach | Contrast with Vary |
|---|---|---|
| Liquid Haskell | Refinement types: types carry logical predicates, checked with an SMT solver | The proof lives in the type. Vary keeps ordinary types and puts the logic in contracts |
| F* | A dependently typed language with SMT-assisted proofs and extraction of verified code. Used for verified cryptography | More expressive and much harder to learn. Vary aims for low-ceremony contracts |
| Lean, Coq, Isabelle | Interactive proof assistants. A person writes every proof step and a small kernel checks it | The strongest guarantees and the highest effort. Vary does not compete here. It exports a goal to Lean when the SMT solver gives up |
| Rust: Prusti, Creusot, Kani | Prusti and Creusot verify annotated Rust deductively. Kani uses bounded model checking | Rust's ownership rules give them strong aliasing information. Vary models aliasing itself with a per-field heap and modifies. Kani resembles vary prove --bounded |
| Python: CrossHair, Nagini | CrossHair searches for contract violations by symbolic execution. Nagini verifies a typed Python subset | The closest in spirit to bounded mode. Vary also offers unbounded proofs |
| Hypothesis, QuickCheck | Random inputs checked against a property | Cheap and statistical. A good first step, not a substitute |
| TLA+ and model checkers | Explore the states of a design or protocol | They verify designs and concurrency. Vary verifies sequential code and treats spawn and channels as opaque |
Where Vary sits
| Choice | What it means |
|---|---|
| Verification is optional and incremental | You can run Vary for years without proving anything. Contracts are run-time checks first. Dafny and SPARK users usually commit to verification up front |
| One contract language for run time and proof | The same in, out and invariant blocks are tested, mutation-tested and proven. Many tools use a separate annotation language |
| Proofs can remove run-time cost | A function whose contracts are all proven can drop its checks from the compiled program, as an opt-in |
| A tight link to mutation testing | A mutant that a proof refutes is killed without running tests, and a mutant that survives the proof flags a weak contract |
| Nothing to install | The bundled solver means vary prove works on a clean machine |
| Content-addressed proof caching | Results are cached per function by hash, consistent with the artifact system |
| A named escape hatch | When SMT cannot settle a goal, export it to Lean and import the checked proof back |
| Counterexamples are replayed | A refuted result is a real failure on the real program, not a solver artifact |
| JVM-faithful integers | Int is a 64-bit wrapping long and overflow is an explicit obligation, instead of being ignored or assumed away |
Limits
| Limit | Detail |
|---|---|
| Maturity | Dafny and SPARK have years of industrial use, large libraries of verified code and trained users. The Vary prover is new and has no external production track record yet |
| Breadth of the proven part | SPARK and Dafny cover far more of their languages. Vary reports some types and builtin behaviours as unsupported or models them only by axiom |
| Solver strength out of the box | The bundled solver cannot decide products of two variables. Z3 can, as an optional download |
| Concurrency | spawn, task_group and channels are opaque. Vary does not verify concurrent code |
| Classes | Classes live in a heap model with aliasing, not as solver datatypes, because they are mutable and compared by reference. data values compare by field |
| Guarantee strength | Lean, Coq and F* give a small trusted kernel. Vary's guarantees rest on its encoder and the solver. Replaying counterexamples and the Lean hand-off reduce that risk but do not remove it |
Vary does not try to replace Dafny or Lean. It aims to make most of verification cheap for ordinary application code: add a contract, run vary prove, get either a proof or a concrete bug, and leave everything else as normal Vary.