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 / apps / aienos-site / om / omega-reference / vendor / examples / contracts_ok.om

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