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
omega-mv / tests / checker2 / lrat / p03_clamp.osc
| 1 | // prove: clamp |
| 2 | // expect: holds |
| 3 | // narrowing cast is in range on every path. |
| 4 | fn 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 | } |