DEVELOPMENT EDITION · 769442725406
Verification Manual
On this page

Trust, assumptions, and proof provenance

An obligation is proved relative to hypotheses. Some follow from checked language rules or other proved operations; some are external assumptions. Good verification work makes that distinction visible and records which implementation/toolchain supplied the evidence. No amount of solver effort turns an inaccurate external contract into a fact about C, hardware, or an unverified library implementation.

Explicit assumptions

pragma Assume (Condition) in Vada, the corresponding Varc assumption statement, and Vibe assume(condition) tell proof to take the condition as true. They do not establish it. Batch analysis emits B8002 for explicit assumptions; downstream obligations can depend on them. A false assumption can prove an impossible claim, and a contradictory assumption can make every consequence vacuous.

Use an assertion when the program is expected to establish the fact. Use a precondition when it is a justified caller obligation. Use an external contract when the boundary is actually external. For a deliberate assumption, record the reason, scope, external evidence, owner, and circumstances invalidating it. Do not put assumptions in a helper simply to remove a difficult diagnostic from the visible caller.

An assumption is not tested when the program runs. A test of a nearby assertion is evidence for the tested execution, not proof of the assumption for all inputs. Proof reports each assumption as B8002, a warning; --no-assume makes them errors (a pragma Assume, an import from C, a trusted enclave, a Logical_Equal function), which is what a release build should use. It covers the program being proved; the predefined library's contracts remain trusted. veradic trust lists all of these at once, with the checks justified by review, the proofs made outside Verada and the raised proof budgets (the command), so the inventory need not be built by hand:

assumed, not proved:
  main.vadb:4: this `pragma Assume` is assumed, not proved
justified by review, not proved: none
proved outside Verada: none
proof budgets raised: none
the predefined library:
  its contracts are trusted by its clients; its bodies are proved when Verada is built, except the C run-time's (Verada.Strings.Texts.To_Text assumes what it keeps)

Why Verada's proofs can be relied on at all, and what Verada itself trusts (the solvers, the tools that build it, its run-time), is argued in the soundness case.

Imported code and exported entry points

Contracts on imported C subprograms are assumed. The compiler checks calls against their declared inputs and effects, but it cannot derive their postconditions from absent C bodies. Global => null must accurately describe external state use; it does not suppress a real effect in the foreign function. A wrong Depends/postcondition can corrupt reasoning about subsequent Verada code even when the call itself executes successfully.

For each foreign operation, review representation/ABI, symbol identity, valid buffer sizes, lifetime/ownership, aliasing, initialization, failure behavior, global effects and numeric range assumptions. Link the declaration to the reviewed foreign source/version and tests. Do not generalize successful execution of one imported function to arbitrary callbacks or representations.

An exported Verada operation's precondition is still a premise. An arbitrary C caller is not proved to obey it merely because the Verada body was verified. A strict build can omit checks proved under that premise. At an untrusted foreign entry, use a supported wrapper that checks/validates the raw inputs before crossing into the preconditioned API, and verify the wrapper's actual behavior and ABI. The Toolchain C integration reference covers supported mechanics.

Embedded libraries and runtime

A program's proof takes the predefined library's specifications as trusted interfaces and does not prove the library's bodies again; they are proved when Verada itself is released. The C run-time routines beneath some units are reviewed and tested rather than proved, as veradic trust says.

Library evidence has distinct layers:

Evidence What it can support
Public API contract What callers may rely on in the proof model
Body proof under recorded assumptions Implementation obligations discharged for that body/revision
Mathematical-model axioms or special proof encoding The model used by generated obligations, requiring validation of the encoding
Runtime/C implementation review Confidence in operations outside ordinary Verada body proof
Differential/native/JIT tests Agreement for actual tested programs and environments
Skipped/unavailable oracle comparison No comparison evidence from that run

For example, copyable text uses runtime-managed immutable storage; its API contract and the runtime implementation of converting and storing characters are different evidence layers. Ghost functional models are not executable containers. The Library Reference gives each unit's contracts and resource limits.

Compiler, solvers, and backend

Verada's shared representation helps keep the program analyzed and the program compiled aligned. The trusted path still includes source lowering, semantic analysis, Core lowering, VC generation and simplification, solver interpretation, proved-check identification, code generation/optimization, linking, runtime and target behavior. A common representation is a design advantage, not a mechanical proof of all these transformations.

Proof certificates contain unsat cores re-checked by a solver against regenerated VCs. They are useful replay evidence; they do not remove the solver, the VC generator or the compiler from the trusted base. veradic prove --check-proofs goes further for the solver: cvc5 writes a step-by-step proof of each proved check and Carcara, an independent proof checker, checks it, so a check Carcara accepts no longer rests on Z3, cvc5 or Yices; veradic trust counts them (see proofs checked independently). See operations, and the soundness case for how Verada argues for each.

Test oracles must be used within a matching subset. GNAT accepting and running a compatible Vada program, GNATprove proving a supported property, and CPython matching a Vibe program's output provide different evidence. Under CPython, Vibe's contracts are not checked, and tasking programs have no CPython equivalent. Do not report an unavailable tool or an inapplicable program as a pass.

Runtime resource limits

Ordinary proof does not establish that the target has enough stack, heap, task slots, lock slots or operating-system resources for every permitted input. Leak freedom and resource capacity are distinct properties: freeing every owned object does not imply that the peak number of simultaneously live objects fits available memory.

The run-time's limits are:

Resource Limit
In-process JIT/REPL entry stack A dedicated thread uses a 64 MiB stack area with a guard region; supported guarded failures return to the host runner
Secondary stack Grows by chunks (1 MiB, then each twice the last) per thread as it is needed; used for supported dynamically sized temporary/result values
Heap and library-level allocation Allocation depends on available host memory and reports storage failure when allocation fails
Task/protected tables Grow as they are elaborated; host memory and thread limits apply
Executable big integer Arbitrary precision, as the proof model; a result memory cannot hold raises Storage_Error

These are run-time limits, not language guarantees or proof budgets. A native executable's primary stack/environment differs from the in-process runner. Supported host recovery from a failed input does not roll back completed I/O, external calls or mutations, and does not establish exception-safe cleanup for arbitrary faults. Resource failure is not a user exception automatically covered by an Exceptional_Cases contract.

Review maximum object sizes, nesting/recursion, peak live allocations, dynamically sized strings/results, task count and external resource needs for the actual deployment. Use execution/resource tests for those requirements and keep target configuration with their results. Runtime debug counters can help investigate allocation balance; they do not turn proof-only leak obligations into universal dynamic enforcement. See the implementation limits and runtime artifact reference.

Nonvacuity and adequate specifications

Review B8003 unsatisfiable-precondition warnings and obvious contradictions. A function whose precondition permits no input can satisfy every postcondition vacuously. A reachable body can also have a postcondition too weak to say anything useful, such as only that a result has its declared type.

Tests are useful here: construct representative inputs that should satisfy the interface, including boundaries and exceptional outcomes, and check the behavior the domain requires. Those tests do not replace proof; they help expose mistaken specifications and modeling assumptions. Ask whether a proposed precondition repair excludes a case the application must handle. The contract repair deliberately strengthens the guarantee rather than excluding more callers.

Retain a useful provenance record

For a significant result, keep the source/project revision, compiler executable identity, proof mode, effective per-operation budgets, selected interface, solver versions and optional engine availability, relevant environment/watchdogs, cache/certificate policy, diagnostic output/exit status, assumption inventory, and executed tests/oracles. Include target/runtime details when the claim involves ABI, numeric properties or tasking.

veradic --version prints the compiler's revision and each solver's version and path; keep its output. Preserve the full project and dependencies required to regenerate obligations. Cached counts or the existence of an executable from an earlier run are not an adequate substitute for a successful reviewed proof invocation.