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 / p02_avg_u8.osc

6 lines · 195 bytes Raw Blame History
1// prove: avg
2// expect: holds
3// overflow-free average of two bytes; never below their common bits.
4fn avg(a: u8, b: u8) -> u8 ensures result >= (a & b) {
5 return (a & b) + ((a ^ b) >> 1);
6}