Contracts
Contracts let you state intent next to the function. The body — often AI-written — is checked against that intent at run time (Tier 1). Static / SMT proving is not implemented.
fn withdraw(balance: int, amount: int) -> int requires amount > 0 requires amount <= balance ensures result >= 0{ return balance - amount;}requires— evaluated before the bodyensures— evaluated after a successful return;resultis the return value- Multiple clauses are allowed
Try it
Section titled “Try it”vow run tests/lang/withdraw.vow # ok (repo clone)vow run tests/lang/withdraw_bad.vow # traps on violationA violation aborts with a structured message, for example:
contract violation: requires amount <= balance at line …Machine-readable compile errors
Section titled “Machine-readable compile errors”Unused Result values are a type error (strictness), independent of contracts:
vow check tests/lang/ignored_result.vow --json