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 / wasm / control.unit.om

92 lines · 1252 bytes Raw Blame History
1fn eq64 a ulong b ulong to bool
2ret eq a b
3end
4fn ne64 a long b long to bool
5ret ne a b
6end
7fn lts64 a long b long to bool
8ret lt a b
9end
10fn ltu64 a ulong b ulong to bool
11ret lt a b
12end
13fn les32 a int b int to bool
14ret le a b
15end
16fn leu32 a uint b uint to bool
17ret le a b
18end
19fn gts16 a short b short to bool
20ret gt a b
21end
22fn gtu16 a ushort b ushort to bool
23ret gt a b
24end
25fn ges8 a byte b byte to bool
26ret ge a b
27end
28fn geu8 a uchar b uchar to bool
29ret ge a b
30end
31fn booland a bool b bool to bool
32ret and a b
33end
34fn boolor a bool b bool to bool
35ret or a b
36end
37fn boolxor a bool b bool to bool
38ret xor a b
39end
40fn addone a uint to uint
41ret add a 1
42end
43fn nested a uint to uint
44ret addone addone a
45end
46fn six a uint b uint c uint d uint e uint z uint to uint
47ret add add add add add a b c d e z
48end
49fn breaks n uint to uint
50x = uint 0
51while lt x n bound 20
52y = uint 0
53while lt y n bound 20
54if eq y 2
55break
56end
57y = add y 1
58end
59x = add x y
60if eq y 0
61break
62end
63end
64ret x
65end
66fn forbreak n uint to uint
67s = uint 0
68for i uint n
69if eq i 3
70break
71end
72s = add s i
73end
74ret s
75end
76fn choose a int to int
77if lt a 0
78ret neg a
79else
80ret add a 1
81end
82end
83fn looptrap n uint to uint
84x = uint 0
85while lt x n bound 2
86x = add x 1
87end
88ret x
89end
90fn explicit to uint
91trap 9
92end