DEVELOPMENT EDITION · 769442725406
Diagnostics Reference
On this page

Warnings, assumptions and trust

A warning can suggest a small improvement, report a setting that has no effect, or mark something a proof relies on without proving it. Read the code and its notes to tell which.

Review assumptions first

B8002 marks assumptions and imported contracts. Decide who establishes the fact, under what environment conditions it remains valid, and how it is checked or reviewed. An assumption is not checked when the program runs: where a value comes from outside, check it in code. The predefined library's contracts are trusted too, without a warning each time a program uses them; veradic trust lists everything a proof relies on.

B8003 identifies an impossible precondition. Checks under an impossible premise can prove because the body is unreachable for every valid caller. Demonstrate useful allowed inputs, then repair the contract or algorithm rather than counting the vacuous proof as application evidence.

B8008 reports a rejected certificate. A changed source or solver can make a stored certificate no longer apply; the prover then proves the check again instead of trusting the certificate.

B8009 reports a check left unproved with a reviewed justification (pragma Annotate (Verada, False_Positive | Intentional, "pattern", "reason") after its statement). Unlike an assumption, it adds no fact: later checks are proved without it, and the check itself stays in the code and is checked at run time. --no-assume makes it an error.

Compatibility and runtime expectations

B8004 means SPARK_Mode => Off does not exempt code from Verada's analysis: every body is analysed and proved. B8006 means a when others handler does not handle failed language checks, which are proved not to happen; it handles the exceptions the program raises.

B8007 marks a contract that cannot be checked at run time because it calls ghost code a --no-prove build leaves out. Leaks, variants, assumptions and the predefined library's assertions are not checked at run time either; only a proof covers them, and in advisory mode the warning for an unproved leak or variant says it has no run-time check. A postcondition's X'Old read through an access value (C.V'Old) is the value on entry, taken when the subprogram is entered and checked at run time like any other. See mode guarantees.

B8012 counts the checks a cached build (--proof cached, the default for run in a project) kept as run-time checks because the proof cache did not know them to be proved. Nothing is wrong with the program: prove it, or let the editor's background prover catch up, and the next cached build leaves those checks out.

Proof warnings

B8010 marks code that no path reaches, which prove --proof-warnings reports. B8011 marks a check proved only with another of the solver's random seeds, under a budget larger than quick: the proof holds but is fragile, so state the step it needs.

Source maintenance warnings

B8001 reports an unknown pragma, which is ignored. If the program depends on it, correct its name or use an aspect or pragma the aspects and pragmas table lists.

B8005 recommends making an unchanged local variable constant. Apply the change if the value is intended to stay fixed and review any suggested edit. This warning is different in consequence from an assumed foreign contract, even though both use warning severity. Build review should distinguish these meanings by stable code.

Advisory mode turns failed proof checks into warnings and keeps them as run-time checks. They are unproved, not proved: keep a full proof, and a reviewed list of assumptions, for delivery. The adoption guidance explains how to introduce that practice without confusing development execution with verified release evidence.