On this page
Initialization, effects, and abstract state
Flow analysis establishes the structure needed for proof: which objects are initialized, which state an operation reads/writes, what outputs depend on, and whether ownership/aliasing rules permit the uses. These checks run before solving verification conditions. A flow error is not a solver timeout, and advisory proof policy does not make it disappear.
Start with a useful flow check
Use the complete project so dependencies and hidden effects are visible:
veradic check --project verada.toml
veradic check --show-flow --project verada.tomlThe second command prints inferred user Global/Depends information where available. Treat it as a review aid for the implementation, not as a functional postcondition or a complete externally trusted-state inventory. Keep machine-readable diagnostics in a separate invocation when inspection flags would prepend text to JSON stdout.
Definite initialization
An object must be initialized before it is read. Establish that fact on every path, including branch alternatives, exception handlers and calls with output parameters. A default value or whole-object aggregate is often the clearest starting point for records/arrays.
Filling an unmarked array component by component is not automatically a whole-object initialization proof. Choose a default/whole aggregate when the initial values are immaterial, or use supported Relaxed_Initialization and 'Initialized reasoning when the algorithm really needs partially initialized state. The latter turns relevant initialization facts into proof obligations; it does not legalize reading arbitrary unset storage.
For a local used after a branch, declare it in the correct outer scope and assign it on all required paths. Vibe's first-assignment scope is a statement-list scope, not unrestricted Python function-wide local rebinding. Parameters can have mode-specific initialization requirements. An out actual supplies the necessary type/shape information but need not provide the incoming scalar value an ordinary in argument requires.
When initialization fails, identify the first possible read, then trace its incoming paths. Do not add a dummy assignment solely to hide a missing intended initialization; choose a value satisfying the subsequent operation's actual contract.
Global effects
An operation's Global contract names nonlocal state it may use. Input state is read; output state is established; input/output state is both read and written; proof-only input is used for proof reasoning. Global => null excludes nonlocal state use, not mutation of an explicit writable parameter.
Effects are transitive through calls. Moving a print into a helper does not remove the caller’s dependence on the output file state. A function cannot acquire ordinary writes because a helper performs them on its behalf. An import without an implementation needs an accurate declared effect contract; a solver cannot infer what the C function secretly does.
The flow corpus exposes a counter, running total and last step. Step reads/updates the running values and establishes Last_Step without requiring its incoming value. Its ghost step count is also explicit state for analysis. The body’s actual reads/writes must match the contract.
When an inferred effect surprises you, follow the evidence through the call graph. Look for implicit finalization/adjustment, library I/O, model calls and shared state accesses as well as assignments in the visible body. Reclamation can contribute effects even when the source contains no explicit release call.
Data dependencies
Depends constrains where each output's information may come from. It is more specific than merely listing reads/writes. A new total may depend on its old value and an amount; a last-step output may depend only on that amount. The self-dependency shorthand includes the incoming value of an output where the syntax permits it.
Use dependency contracts to review information flow, initialization and API stability. They do not assert a numeric equation such as Total = Total'Old + Amount; that relation belongs in a postcondition. A declared output depending on too little is incorrect; an unexpected extra dependency can reveal a hidden state coupling or overly broad specification. Read the exact missing/unused dependency diagnostic instead of treating every mismatch as a harmless formatting difference.
Abstract and refined state
A package can expose a public abstract state name while keeping concrete variables private. Clients then state effects in terms of the abstraction. Refined_State relates it to the implementation constituents; Part_Of associates state constituents; supported Refined_Global/Refined_Depends forms connect public effects with body effects.
This is an information-hiding boundary, not a mechanism for concealing real effects from callers. Trace every concrete write to its corresponding public state. Private children, subunits and implicit finalizers can all matter. The ledger example and its associated private-state units illustrate an interface stated without exposing its storage.
For external state, also establish which environment actions can change it and which reads are effects. External, volatile and asynchronous properties must match the implementation; an abstract name alone does not make repeated hardware reads stable.
Elaboration and initialization contracts
Package elaboration initializes library state in dependency order before ordinary use. Initializes describes which supported state is established and is checked against that process. Do not read an object during elaboration merely because some later operation would initialize it. Cyclic dependencies and hidden initialization calls require the complete unit closure, not a single client snippet.
Default_Initial_Condition concerns a type's default initialization, whereas a package's Initial_Condition is proved to hold once the package is elaborated (B5110). Similar names are not interchangeable proof features. The aspect/pragma catalog distinguishes recognized names from effective implemented semantics.
Aliasing and ownership are part of the first gate
Writable actuals cannot overlap illegally with each other or with globals the callee uses. When nonoverlap depends on runtime values, the compiler can generate an obligation rather than deciding solely from syntax. For example, two array-element actuals may require proving their indices differ. A definite forbidden overlap is a flow/legality problem, not an opportunity to increase the proof budget.
Ownership tracks moved parts and temporary borrowers/observers. Reading a whole object can also read a moved field; freeing an owner must not leave its designated children lost. Those rules are developed in ownership. Fix the conflicting object/lifetime structure before adding assumptions about its arithmetic values.
A practical repair sequence
First decide whether the diagnostic is an uninitialized read, incorrect declared effect, missing dependency, hidden-state boundary or alias/move conflict. Find the smallest call path or branch that causes it. Correct the declaration/body so its interface matches the actual intended behavior, then rerun check and review inferred flow. Only after that gate passes should you investigate functional or numeric proof failures.
When changing a body, compare inferred modes/effects with its previous API. A Vibe component mutation can change an inferred input into a writable argument; a new finalizer can add an effect; a helper refactor can expose a different dependency. Reprove affected callers and review compatibility rather than treating the edit as invisible because output tests match.