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 / omega-llm / tools / combined / experiment / predict.om

104 lines · 1315 bytes Raw Blame History
1text tPrintLine "prl\n"
2note Harness only. Usage: predict KIT SCRATCH OMC PROMPT BODY INPUTS.
3note INPUTS contains arguments alone. Each run prints one result row per input in bench-out.
4fn emitInput p ulong q ulong sh ulong to void
5width = sh
6if ge sh 4
7width = 9
8end
9p = skipsp p q
10if ne nwords p q width
11die badinput 65
12end
13if le sh 3
14gtx gprv
15gtx gcall
16for j ulong width
17w = wordend p q
18gtx gsul
19gu canonical p w
20p = skipsp w q
21end
22gc 10
23else
24w = wordend p q
25n = canonical p w
26if gt n 8
27die badinput 65
28end
29p = skipsp w q
30for j ulong 8
31w = wordend p q
32gtx setarr
33gu j
34numberarg canonical p w
35gc 10
36p = skipsp w q
37end
38if eq sh 4
39gtx gprv
40end
41gtx gcall
42gtx garrul
43gu n
44gc 10
45if eq sh 5
46gtx gpra
47end
48end
49gtx tPrintLine
50end
51
52
53fn main to int
54if ne argcnt 7
55die badinput 2
56end
57put st 26 2
58put st 27 3
59readprompt
60pclr
61parg 5
62b = cbLoad 65535
63e = get st 6
64z = bodyend b e
65if eq z 0
66ret 1
67end
68if or more sub z 1 e not mathbody b e
69ret 1
70end
71put st 2 0
72gmem get cfg 1 sub get cfg 2 get cfg 1
73gc 10
74gmem b sub e b
75gc 10
76gtx gpre
77gtx gmain0
78validateNames
79sh = get cfg 3
80if ge sh 4
81gtx garr0
82end
83pclr
84parg 6
85p = cbLoad 65535
86e = get st 6
87while lt p e bound 65536
88q = lend p e
89emitInput p q sh
90p = add q 1
91end
92gtx gmainz
93rc = compile
94if eq rc 127
95die failure 70
96end
97if ne rc 0
98ret 1
99end
100if ne runp true 0
101ret 2
102end
103ret 0
104end