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 / seed / qualification / om2 / sec / s0s2 / s0 / names-fn.om

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