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 / contrast / with-example.om

65 lines · 1187 bytes Raw Blame History
1note with-example PROMPT OMC SAMPLER MERGES EXAMPLE_MAIN CK [CK ...]
2note EXAMPLE_MAIN defines a seeded main that returns 77 for success. Use a fresh working directory.
3text genfile "sample.raw"
4text okmsg "accepted checkpoint "
5text none "no generated answer passed the example\n"
6fn draw p view uchar * j ulong a edit uchar * to ulong
7fd = fdesc genfile 577
8wdkclr
9wdka 3
10wdkt samplecmd
11wdka add 6 j
12wdkt seedval
13wdkt limitval
14wdkt tempval
15wdkt p
16wdka 4
17rc = wdwait wdspawn -1 fd -1
18cl = fclose fd
19if ne rc 0
20exit 73
21end
22ret pickread fdesc genfile 0 a
23end
24fn accepted p view uchar 4096 a view uchar * n ulong c view uchar 65536 to bool
25for i ulong n
26if terminates part a 0 n i
27if eq compile p part a 0 add i 1 c 0
28r = strict
29if or eq r 125 eq r 126
30exit 70
31end
32if eq r 77
33wdwrall 1 a add i 1
34wdwrall 1 lf 1
35ret true
36end
37break
38end
39end
40end
41ret false
42end
43fn main to int
44if lt argcnt 7
45ret 2
46end
47p = new uchar 4096 0
48a = new uchar 8192 0
49c = new uchar 65536 0
50pn = pickload 1 p
51put lengths 0 pn
52put lengths 2 pickload 5 c
53for j ulong sub ulong argcnt 6
54n = draw part p 0 pn j a
55if accepted p a n c
56wdot okmsg
57wdod add j 1
58wdot lf
59wdoflush 2
60ret 0
61end
62end
63wdwrall 2 none len none
64ret 3
65end