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 / train / aien-train / native / neuralese / nl1r-task / boundary.om

162 lines · 3075 bytes Raw Blame History
1note SPDX-License-Identifier: AGPL-3.0-only
2note Verification adapter, not a receiver or authority. Reuses unchanged NL4 functions.
3note Compose after host-proposal.om lines1..144, before pinned h/proposal/v/sha2.
4note CLI context-file predicted-bits trusted-target-bits task abstain frame-output-fd.
5note Trusted target is evaluator-owned and never flows back to sender or receiver.
6global BARG uchar 5
7global BCFG ulong 5
8fn barg ix ulong to ulong
9n = argread ix BARG 0 5
10if or le n 0 gt n 4
11exit 80
12end
13v = ulong 0
14for i ulong ulong n
15c = get BARG i
16if or lt c 48 gt c 57
17exit 80
18end
19v = add mul v 10 ulong sub c 48
20end
21ret v
22end
23fn bargs to int
24put BCFG 0 barg 2
25put BCFG 1 barg 3
26put BCFG 2 barg 4
27put BCFG 3 barg 6
28put BCFG 4 barg 5
29if or gt get BCFG 0 15 gt get BCFG 1 15
30ret 80
31end
32if or gt get BCFG 2 2 gt get BCFG 4 1
33ret 80
34end
35if or lt get BCFG 3 3 gt get BCFG 3 1023
36ret 80
37end
38if eq get BCFG 2 1
39if or gt get BCFG 0 1 gt get BCFG 1 1
40ret 80
41end
42end
43if eq get BCFG 4 1
44ret 2
45end
46if eq get BCFG 2 1
47put BCFG 2 1
48else
49put BCFG 2 2
50end
51ret 0
52end
53fn bheader frame edit uchar 1056 ctx view uchar 1025 to void
54for i ulong 1024
55put frame i get ctx i
56end
57note Fresh one-shot SYNTHETIC sequence, checked with existing lastseq0 rule.
58for i ulong 8
59put frame add 80 i uchar 0
60end
61put frame 87 uchar 1
62end
63fn bexpect e edit uint 16 value uint to void
64put e 0 3
65put e 1 value
66put e 3 1
67put e 4 1
68put e 5 1
69put e 6 4
70put e 7 1
71put e 9 1
72end
73fn bframe frame edit uchar 1056 value ulong to int
74f = new f64 4 0.0f64
75put f 0 1.0f64
76put f 1 1.0f64
77put f 2 f64 and value 1
78put f 3 f64 and shr value 1 1
79wire = new uchar 32 0
80rc = nlencode f wire
81if ne rc 0
82ret rc
83end
84for i ulong 32
85put frame add 1024 i get wire i
86end
87state = new ulong 40 0
88sha256_init state
89sha256_update state part frame 0 992
90sha256_update state part frame 1024 32
91sha256_final state part frame 992 32
92note Raw actual envelope bytes are audit output, not an execution receipt.
93z = write int get BCFG 3 frame 0 1056
94if ne z 1056
95ret 81
96end
97ret 0
98end
99fn bverify frame edit uchar 1056 ctx view uchar 1025 p edit uint 16 to int
100value = and shr get BCFG 0 mul get BCFG 4 2 3
101rc = bframe frame value
102if ne rc 0
103ret rc
104end
105now = lpbe64 ctx 64
106rc = lpvalid frame part ctx 0 1024 now 0
107if ne rc 0
108ret rc
109end
110rc = nlproposal frame p
111if ne rc 0
112ret rc
113end
114e = new uint 16 0
115sh = mul get BCFG 4 2
116want = and shr get BCFG 1 sh 3
117bexpect e uint want
118if not nlmatch p e
119ret 49
120end
121ret 0
122end
123fn main to int
124if ne argcnt 7
125ret nlfail 80
126end
127rc = bargs
128if ne rc 0
129ret nlfail rc
130end
131ctx = new uchar 1025 0
132frame = new uchar 1056 0
133props = new uint 32 0
134rc = nlcontext ctx
135if ne rc 0
136ret nlfail rc
137end
138bheader frame ctx
139p = new uint 16 0
140q = new uint 16 0
141for chunk ulong get BCFG 2
142put BCFG 4 chunk
143for i ulong 16
144put p i uint 0
145end
146rc = bverify frame ctx p
147if ne rc 0
148ret nlfail rc
149end
150for i ulong 16
151put props add mul chunk 16 i get p i
152end
153end
154note Every chunk must verify BEFORE any pure execution or execution receipt.
155for chunk ulong get BCFG 2
156for i ulong 16
157put q i get props add mul chunk 16 i
158end
159nlexec q
160end
161ret 0
162end