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 / qualification / om2 / sec / s0s2 / s0 / names-fn.om
| 1 | note SPDX-License-Identifier: Apache-2.0 |
| 2 | note omegese-om2.md 0 lines 14-16: OM-1 keeps every name it has, including user functions named |
| 3 | note like the OM-2 words (rotr as in om/blake3/blake3.om:68). Each function below computes something |
| 4 | note other than its OM-2 meaning, so a compiler that applied OM-2 meaning in an OM-1 unit prints |
| 5 | note different numbers. Expected stdout: oracle/s0s2/oracle.py (names_fn). Used with lib/putu.om. |
| 6 | fn rotr x uint n uint to uint |
| 7 | ret xor x n |
| 8 | end |
| 9 | fn rotl x uint n uint to uint |
| 10 | ret sub x n |
| 11 | end |
| 12 | fn fresh a ulong to ulong |
| 13 | ret mul a 3 |
| 14 | end |
| 15 | fn at a ulong b ulong to ulong |
| 16 | ret add a b |
| 17 | end |
| 18 | fn unroll n ulong to ulong |
| 19 | s = ulong 0 |
| 20 | for i ulong n |
| 21 | s = add s i |
| 22 | end |
| 23 | ret s |
| 24 | end |
| 25 | fn inline a ulong to ulong |
| 26 | ret add a 100 |
| 27 | end |
| 28 | fn seal a ulong to ulong |
| 29 | ret xor a 255 |
| 30 | end |
| 31 | fn open a ulong to ulong |
| 32 | ret shr a 1 |
| 33 | end |
| 34 | fn part a ulong b ulong to ulong |
| 35 | ret rem a b |
| 36 | end |
| 37 | fn export a ulong to ulong |
| 38 | ret sub a 1 |
| 39 | end |
| 40 | fn abstract a ulong to ulong |
| 41 | ret mul a a |
| 42 | end |
| 43 | fn holds a ulong to ulong |
| 44 | ret and a 15 |
| 45 | end |
| 46 | fn layout a ulong to ulong |
| 47 | ret or a 256 |
| 48 | end |
| 49 | fn field a ulong to ulong |
| 50 | ret shl a 4 |
| 51 | end |
| 52 | fn dup32mk x uint to ulong |
| 53 | ret ulong x |
| 54 | end |
| 55 | fn main to int |
| 56 | putu ulong rotr 5 3 |
| 57 | putu ulong rotl 4000000000 7 |
| 58 | putu fresh 14 |
| 59 | putu at 20 22 |
| 60 | putu unroll 10 |
| 61 | putu inline 1 |
| 62 | putu seal 15 |
| 63 | putu open 1001 |
| 64 | putu part 100 7 |
| 65 | putu export 0 |
| 66 | putu abstract 4294967296 |
| 67 | putu holds 1234 |
| 68 | putu layout 1 |
| 69 | putu field 3 |
| 70 | putu dup32mk 7 |
| 71 | ret 0 |
| 72 | end |