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 / f-ok.om
| 1 | note S3 fresh: accepted flows. Straight-line writes, both arms of an if/else, an arm that returns (the |
| 2 | note join takes the other arm), an unrolled loop covering every element before a run-time get, writes |
| 3 | note made before a rolled loop kept after it, and an inline callee writing the elements. Exit 0 when |
| 4 | note every value read back is right, else the failing check's number. |
| 5 | om2 |
| 6 | fn fill4 t edit uchar 8 b uchar to void inline |
| 7 | for i ulong 4 unroll |
| 8 | put t add i 4 add b uchar i |
| 9 | end |
| 10 | end |
| 11 | fn f s edit uchar 8 fresh c ulong k ulong to ulong |
| 12 | put s 0 1 |
| 13 | if eq c 1 |
| 14 | put s 1 2 |
| 15 | else |
| 16 | put s 1 3 |
| 17 | end |
| 18 | if eq c 9 |
| 19 | ret 99 |
| 20 | else |
| 21 | put s 2 4 |
| 22 | end |
| 23 | for j ulong 2 |
| 24 | put s 3 5 |
| 25 | end |
| 26 | fill4 s 10 |
| 27 | put s 3 get s 1 |
| 28 | ret add add ulong get s 2 ulong get s k ulong get s 3 |
| 29 | end |
| 30 | fn main to int |
| 31 | a = new uchar 8 0 |
| 32 | if ne f a 1 7 19 |
| 33 | ret 1 |
| 34 | end |
| 35 | if ne f a 2 0 8 |
| 36 | ret 2 |
| 37 | end |
| 38 | ret 0 |
| 39 | end |