DEVELOPMENT EDITION · 769442725406
Examples
On this page

Verification Manual worked projects

These complete projects support the Verification Manual. Each verada.toml selects the sources in its own directory; choose exactly one syntax and one version. The compiler does not need to combine the three equivalent presentations.

Family Before After Successful output
contract/{vada,varc,vibe} Increment's body is correct but its interface has no result relation; the client assertion cannot prove (B5105) Add the result postcondition and prove the unchanged client answer: 42
loop/{vada,varc,vibe} Counting loop has no relationship between counter and loop position; overflow/postcondition proof fails (including B4101) Add the inductive relationship; safety and exact count prove count: 10
runtime-overflow/{vada,varc,vibe} One increment exceeds Natural when the program runs Deliberately has no repaired version: shows a check kept at run time under --advisory or --no-prove Execution fails with B4101
assumption/vada pragma Assume (False) is warned about (B8002) but not checked when the program runs Deliberately has no repaired version: shows a trust boundary, not a premise to release with continued, with B8002

For example, from the repository root:

veradic check --project docs/manuals/examples/verification/loop/vibe/before/verada.toml
veradic prove --no-cache --project docs/manuals/examples/verification/loop/vibe/before/verada.toml
veradic prove --no-cache --project docs/manuals/examples/verification/loop/vibe/after/verada.toml
veradic run --project docs/manuals/examples/verification/loop/vibe/after/verada.toml

The second command fails on purpose. An unrepaired proof is different from a failing execution: both unrepaired algorithms run correctly for the shown inputs under --advisory. Read the diagnostic qualification and the explanation in contract repair or loop repair.

The runtime-overflow project intentionally fails when executed. The assumption project intentionally contains an invalid assumption to make the absence of runtime enforcement observable without performing an unsafe operation. Do not copy that assumption as a repair.

Checking these projects

validate.py in this directory proves and runs every project on temporary copies and checks each expected result:

python3 docs/manuals/examples/verification/validate.py --compiler "$(command -v veradic)"