interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / si / mcp / data / examples / contracts.om

16 lines · 316 bytes Raw Blame History
1om2
2note requires and ensures form a function's prefix; invariant forms a loop body's prefix;
3note result is the returned value inside ensures
4fn step x uint to uint
5requires lt x 10
6ensures eq result add x 1
7ret add x 1
8end
9fn main to int
10i = uint 0
11while lt i 3
12invariant le i 3
13i = step i
14end
15ret int sub i 3
16end