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 / seed / omc / om2 / s3 / a-ok.om
| 1 | note S3 abstract: an inlined exact constructor, values passed through a function, a uint-based abstract |
| 2 | note type with no invariant, xor/rotr/rotl/and/or where listed. Exit 0 when every opened value is right. |
| 3 | om2 |
| 4 | abstract dup32 ulong ops rotr rotl xor |
| 5 | holds dup32 dup32 |
| 6 | abstract tag uint ops and or |
| 7 | fn dup32mk x uint to dup32 inline |
| 8 | ret seal dup32 or shl ulong x 32 ulong x |
| 9 | end |
| 10 | fn tagmk x uint to tag |
| 11 | ret seal tag x |
| 12 | end |
| 13 | fn pass d dup32 n ulong to dup32 |
| 14 | ret rotl rotr d n 3 |
| 15 | end |
| 16 | fn main to int |
| 17 | d = dup32mk 0x80000001 |
| 18 | e = pass d 8 |
| 19 | if ne open e 0x0c0000000c000000 |
| 20 | ret 1 |
| 21 | end |
| 22 | if ne open xor e d 0x8c0000018c000001 |
| 23 | ret 2 |
| 24 | end |
| 25 | t = or tagmk 12 tagmk 3 |
| 26 | u = and t tagmk 5 |
| 27 | if ne open u 5 |
| 28 | ret 3 |
| 29 | end |
| 30 | ret 0 |
| 31 | end |