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 / one_layer / generalization / corpus / specs / clamp.spec

8 lines · 369 bytes Raw Blame History
1desc limit an unsigned 32-bit x to lo..hi: below lo gives lo, above hi gives hi, otherwise x
2pre le lo hi
3post and and ge res lo le res hi or eq res x or eq res lo eq res hi
4example 12 3 9 -> 9
5limit needs lo <= hi; with lo > hi the result is outside lo..hi (lo when x < lo, else hi when x > hi)
6limit unsigned 32-bit values only
7counter 5 9 3 -> 9
8counter 50 9 3 -> 3