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 / tests / checker2 / lrat / p03_clamp.osc

8 lines · 211 bytes Raw Blame History
1// prove: clamp
2// expect: holds
3// narrowing cast is in range on every path.
4fn clamp(x: i16) -> i8 ensures result <= 100 {
5 if x > 100 { return 100; }
6 if x < -100 { return -100; }
7 return x as i8;
8}