Alpha. Vary is under active development and not ready for production use. Syntax, APIs, performance, and behaviour may change between releases.

Solvers

Choosing a solver

SolverHow to useStrengthsLimits
Default (SMTInterpol, then Z3)vary proveStarts with the bundled SMTInterpol. What it leaves open is run again on Z3, and the report names the solver that answeredSame as SMTInterpol when Z3 cannot be loaded
SMTInterpolvary prove --solver smtinterpolBundled and pure Java. Decides linear integer arithmetic, arrays, uninterpreted functions and datatypesA product or division of two variables is approximated with sound bounding axioms and often comes back unknown. Float is reported unsupported with a hint
Z3vary prove --solver z3Decides nonlinear goals, adds native string theory and IEEE FloatNative code, so a very hard query can run past its budget; Vary abandons it and says so
cvc5vary prove --solver cvc5Decides nonlinear goals, adds native strings and FloatOptional download. Struggles with 128-bit multiplication

Z3 is in the release archive for your platform, under lib/native/z3/. Vary checks the files against checksums built into it and loads them from there: nothing is downloaded and nothing is written to your home directory. On a platform with no bundled build, or a source build, the first --solver z3 run downloads the library into ~/.vary/z3/ instead. cvc5 is not bundled; the first --solver cvc5 run downloads it the same way and reuses it afterwards. Nothing is downloaded unless you ask.

By default Vary tries SMTInterpol first and runs only the obligations it leaves open on Z3. The default never makes an answer worse: a proven or refuted result is never replaced, and an unknown can only become proven or refuted. Set VARY_PROVE_Z3_RETRY=0 to turn the second step off.

For products of bounded variables the bundled solver now needs no help. A contract that bounds price and percent_off is enough for it to prove that price * percent_off cannot overflow and stays below price * 100. The report lists the layer of the nonlinear strategy that a proof relied on (nonlinear:bounds, nonlinear:cases, nonlinear:expand). What stays open is reasoning that needs real algebra, such as a sum of squares, and unbounded products that really can overflow; Z3 decides the first and refutes the second.

What changes between solvers

An unknown result is the sign that a different solver may help. The report says so when it knows. For example, price * percent_off is unknown on the bundled solver and proven on Z3. The answers never contradict each other: a solver can only turn an unknown into a proven or a refuted. Vary does not report proven unless the solver proves it.

ConstructBundled solverZ3 or cvc5
a * b, a // b, a % b with two variablesApproximated, often unknownDecided
String indexing, slices, startswith, endswith, strip, lower, upper, contains, find, replaceLength and equality only. The rest is opaqueNative string theory
FloatUnsupported, with a hintIEEE double (the default run uses Z3 for it when Z3 ships with the install)
Quantified list propertiesWorks, some steps may stay undecidedUsually decides

Integer models

Int is a 64-bit wrapping integer on the JVM. By default the prover models it as an unbounded mathematical integer and adds an overflow obligation for every operation that could wrap. If all overflow obligations are proven, the model is exact.

For exact 64-bit reasoning, use vary prove --solver z3 --int-model bitvector. It is slower, but it decides nonlinear goals by bit-blasting. Use it with Z3.

Time budgets

--timeout-ms sets the budget per obligation. A timeout is reported as timeout, never as proven. The report names the quantifier that was being instantiated when time ran out, which usually tells you where to add a trigger or a lemma.

Z3 and cvc5 are native code and cannot always be interrupted. Vary runs each query on its own thread and abandons it once the budget plus a short grace period has passed. Each abandoned query leaves a thread behind, so after six of them a solver stops taking new queries and the rest come back unknown, with a note naming the limit. Rerun with a larger --timeout-ms, or with the other solver.

What a solver is trusted for

A proof is only as good as the solver and the encoder. Counterexamples are always replayed on the real program before they are reported as refuted, which guards against a wrong refutation. For a goal that SMT cannot settle at all, export it to Lean and import the checked proof back.