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 / omegese45 / translate / otmsg.om

42 lines · 933 bytes Raw Blame History
1note SPDX-License-Identifier: AGPL-3.0-only
2note otmsg: glue from the translator to the contract lane's codec and
3note validator (native/omegese45/vocab.om and msg.om, concatenated before
4note this file). The translator never re-implements the R45 grammar: every
5note G and P line is validated by ocsetgl / ocvline.
6
7note Copy otin[o, o+n) into the contract input buffer ocin. False when the
8note line does not fit.
9fn otcopy o ulong n ulong to bool
10if gt n len ocin
11ret false
12end
13for i ulong n
14put ocin i get otin add o i
15end
16ret true
17end
18
19note Append the contract reason word for -v (v < 0 from ocvline/ocsetgl).
20fn otprs v long to void
21r = ulong neg v
22if or lt r 1 gt r 20
23otpdec r
24ret
25end
26o = mul sub r 1 8
27for j ulong 8
28c = get ocrtx add o j
29if ne c 32
30otpb c
31end
32end
33end
34
35note Append the surface word of vocabulary id.
36fn otpword id ulong to void
37ocvinit
38o = get ocwo id
39for j ulong get ocwl id
40otpb get ocvtsv add o j
41end
42end