veradic stubs
Generate Python typing declarations for Vibe's support module and imported Vada/Varc packages.
veradic [GLOBAL OPTIONS] stubs [-o DIR | --output DIR] [FILES...]
DIR defaults to stubs. No inputs are required: the command always generates verada/__init__.pyi. For supported Vada/Varc library packages among explicit inputs it writes lowercased package paths (A.B becomes a/b.pyi). .vb inputs are ignored because Vibe source already is Python syntax; they do not receive generated per-module stubs.
veradic stubs -o stubs docs/manuals/examples/first-proof/vada/after/bounded.vads
veradic stubs -o stubs docs/manuals/examples/first-proof/varc/after/bounded.vaDirectories are created and existing same-named outputs overwritten. Stale files from older runs are not removed. The command parses inputs, not full semantic/proof analysis. Use a fresh output directory to audit exactly what was generated. No solver or C compiler is invoked. Read/parse errors normally exit 1; prelude and other valid outputs may still be written. Success exits 0 and lists each file on stdout; listings also precede JSON diagnostic arrays.
Use with Python type checkers
For a project-local stubs directory, a pyrightconfig.json can contain:
{
"include": ["src"],
"stubPath": "stubs"
}With mypy, set an explicit stub search path for the invocation:
MYPYPATH="$PWD/stubs" mypy srcThese recipes follow Pyright's configuration reference and mypy's stub documentation.
The stubs give a Python type checker the names and types of Vibe's verada module and of the packages. A type checker's verdict is about Python's typing only: it does not prove contracts or ownership, which veradic prove does.
A package's procedures are written as Vibe calls them: their out parameters, and their in out parameters of a scalar type, are the call's results (imported scalar outputs), so procedure Split (N : Integer; Low, High : out Integer) is def split(n: int) -> tuple[int, int] and procedure Increment (X : in out Integer) is def increment(x: int) -> int. An in out parameter of another type stays a parameter, which the call changes. A scalar type is Standard's or one the package declares, as the stubs are written from the package alone.
Natural, Positive, and the classes of RangeInt and Modular are classes of int there, with their bounds T.first and T.last (and a modular class's modulus); their arithmetic gives their own type, as Verada's does, where Verada proves the result in range. A checker treats them as Python treats any subclass of int: a plain int (a literal, or another int variable) is not one of them to it, while Verada converts it and proves it in range. Array classes have their bounds (first, last, first_index(k), last_index(k), indices(k)), @ and T; an enclave's enclave(), Ref, Seq and Cells, @ghost, apl("...") and @dataclass(limited=True) are there too.
Stubs are not a Python runtime
.pyi declares types; it does not supply executable implementations of requires, result, owners, containers or imported package functions. Do not put generated stubs on a runtime path and infer that CPython can execute the application. Provide and validate an actual compatible runtime/helper when doing CPython comparison. A test helper that makes contracts no-ops is not independent proof evidence. See translation compatibility.