Caesar 4.1: Soundness Fixes and Unbounded WLP
Caesar 4.1 fixes soundness bugs in @ast, @past, and @omega_invariant that could let invalid proofs pass verification.
Caesar proves bounds on probabilities, expected runtimes, and resource usage.
Write a model in Caesar’s programming language, HeyVL, and add proof annotations. Caesar verifies the stated bounds symbolically.
Probabilistic programs make random choices that affect their results and control flow. They model randomized algorithms and protocols, such as communication over an unreliable channel. Verification can establish bounds on the probability of transmission failure, the expected number of retries, or the resources consumed.
Caesar’s intermediate verification language, HeyVL, expresses probabilistic programs together with quantitative specifications and proof rules. New proof rules can be encoded in HeyVL without changing the verifier.
Read the CAV 2026 tool paper ↗Quantitative verification statements, such as assert and assume, encode proof rules as programs. HeyVL supports user-defined functions and types.
Infinite state spaces and symbolic inputs
Proof annotations let Caesar establish bounds without enumerating program states. It generates verification conditions in HeyLo, its real-valued assertion logic. HeyLo formulas map program states to non-negative reals or infinity.
Caesar simplifies verification conditions and eliminates quantitative quantifiers where possible before sending them to Z3. It can also reason about recursive functions.
Automatic analysis of finite-state models
For programs with finitely many states, Storm can calculate expected values without user-provided invariants. Caesar exports a subset of HeyVL to JANI, a format for probabilistic models that Storm can read.
Infinite-state models can also be approximated by exploring a limited number of states.
The number of iterations follows a geometric distribution: each iteration terminates the loop with probability ½, but the loop can run for arbitrarily many iterations. There are infinitely many possible execution paths. Caesar checks a supplied loop invariant to bound the expected number of iterations without enumerating these paths.
@ert
coproc geo_expected_runtime() -> (done: Bool)
pre 2
post 0
{
done = false
@invariant([!done] * 2)
while !done {
reward 1
done = flip(0.5)
}
}
Each iteration samples a fair coin with flip(0.5) and records one unit of cost with reward 1. The loop ends when done becomes true.
A coproc checks an upper bound. Here, pre 2 bounds the expected total cost by 2, and post 0 adds no cost after the loop. The @ert annotation selects expected-runtime reasoning.
The user supplies [!done] * 2 as a bound on the remaining expected cost: 2 before success and 0 afterward. One iteration preserves this bound:
1 + ½ · 0 + ½ · 2 = 2
Caesar checks that the supplied invariant establishes the specification. The expected number of iterations is at most 2. Individual executions can take more than two iterations.
The loop above has no finite worst-case iteration bound, although its expected number of iterations is at most 2. Proving this requires reasoning about the whole distribution of execution lengths, including arbitrarily long runs.
Termination itself has several meanings. A program can terminate with probability 1 and still have infinite expected runtime, as in a symmetric random walk that stops at zero. Thus, almost-sure termination and finite expected runtime require different proof arguments.
Caesar checks these arguments using invariants, martingale-based rules, and symbolic verification. Bounds can depend on program inputs, so a single proof can cover all input values satisfying its assumptions.
The Caesar extension verifies HeyVL programs directly in the editor. It also installs and updates Caesar for you.
See verification results beside the code, with errors and warnings at the relevant statements.
Inspect the computed verification conditions to understand how Caesar reasons about your program.
Locate failing proof obligations and identify which statements are needed for verification.
Use syntax highlighting, code snippets, and reference hovers for language constructs and proof annotations.

Caesar 4.1 fixes soundness bugs in @ast, @past, and @omega_invariant that could let invalid proofs pass verification.
Peer-reviewed work on Caesar, its foundations, and applications.
Mechanized foundations in Lean for the correctness of HeyVL encodings and probabilistic verification techniques.
The Caesar tool paper, covering its verification workflow, editor support, and backends.
Reward transformations for verifying higher moments, tail probabilities, and other quantitative objectives.
Proof rules for almost-sure termination under weak fairness, used to verify randomized consensus protocols.
The foundations of Caesar’s slicing diagnostics for locating errors and simplifying proofs.
HeyVL encodings of Riemann-sum approximations to verify expectation bounds for continuous distributions.
An operational semantics for HeyVL based on refereed stochastic games.
The foundations of Caesar: HeyLo, HeyVL, and encodings of probabilistic proof rules.