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 / collective / admit / a1emit-main.om

72 lines · 1392 bytes Raw Blame History
1note SPDX-License-Identifier: AGPL-3.0-only
2note DRA-15 / aien-train#26 P0 admission observation tail. Appended after every
3note line of native/collective/admit_p0.om before its fn main, byte-identical,
4note by native/collective/admit/run.sh. It replaces only the self-test main:
5note the same setcase/run sequence runs in one process and every observable is
6note printed, so an oracle the program does not contain (Wolfram,
7note expected-a1.out) can judge it. It adds no arithmetic and checks nothing.
8note Line format: A1 case status y0 y1 base_count adapter_count, then END.
9
10global Buf uchar 128
11global Pos ulong 1
12
13text ta "A1"
14text te "END\n"
15
16fn pc c ulong to void
17p = get Pos 0
18put Buf p uchar c
19put Pos 0 add p 1
20end
21
22note Appends one space and the signed decimal of v to Buf.
23fn pnum v long to void
24d = new uchar 20 0
25pc 32
26u = ulong 0
27if lt v 0
28pc 45
29u = ulong neg v
30else
31u = ulong v
32end
33n = ulong 0
34c = true
35while c bound 20
36put d n uchar add rem u 10 48
37n = add n 1
38u = div u 10
39if eq u 0
40c = false
41end
42end
43for i ulong 20
44if lt i n
45pc ulong get d sub sub n 1 i
46end
47end
48end
49
50fn flush to void
51p = get Pos 0
52put Buf p uchar 10
53k = write 1 Buf 0 add p 1
54put Pos 0 0
55end
56
57fn main to int
58for n ulong NCASE
59setcase n
60s = run
61k = write 1 ta 0 len ta
62pnum long n
63pnum s
64pnum get Yv 0
65pnum get Yv 1
66pnum long get Counts 0
67pnum long get Counts 1
68flush
69end
70k = write 1 te 0 len te
71ret 0
72end