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 / examples / semantic-codebook / dispatch-v0.om

68 lines · 1467 bytes Raw Blame History
1note SPDX-License-Identifier: AGPL-3.0-only
2note SEM-1 research smoke only. 256-bit root from codebook-v0.txt, untrusted caller.
3note This source does not validate the canonical program IDs, signatures, or capabilities.
4note A 16-bit return is 0x00vv for a successful u8 result, or 0xffNN for refusal.
5note First-party executable syntax is seeded Omega .om, not legacy .osc.
6
7struct Root a ulong b ulong c ulong d ulong end
8
9fn dispatch root view Root code uchar epoch uchar x uchar p uchar to ushort
10if ne get root a 6739245970865574820
11ret 65283
12end
13if ne get root b 9146405468906863133
14ret 65283
15end
16if ne get root c 2389306260950466872
17ret 65283
18end
19if ne get root d 17559557173790906796
20ret 65283
21end
22if ne epoch 9
23ret 65281
24end
25if gt code 2
26ret 65282
27end
28if eq code 0
29ret ushort add x 1
30end
31if eq code 1
32ret ushort mul x 2
33end
34ret ushort add mul x 2 p
35end
36
37fn main to int
38root = new Root 6739245970865574820 9146405468906863133 2389306260950466872 17559557173790906796
39if ne dispatch root 0 9 41 0 42
40ret 1
41end
42if ne dispatch root 1 9 21 0 42
43ret 2
44end
45if ne dispatch root 2 9 20 2 42
46ret 3
47end
48if ne dispatch root 0 9 255 0 0
49ret 4
50end
51if ne dispatch root 1 9 128 0 0
52ret 5
53end
54if ne dispatch root 2 9 127 2 0
55ret 6
56end
57if ne dispatch root 0 8 41 0 65281
58ret 7
59end
60if ne dispatch root 3 9 41 0 65282
61ret 8
62end
63bad = new Root 6739245970865574820 9146405468906863133 2389306260950466872 17559557173790906797
64if ne dispatch bad 0 9 41 0 65283
65ret 9
66end
67ret 0
68end