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 / tests / turing / origsel-test.om

105 lines · 1540 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0
2note omega-mv#700 ORIGSEL evaluator in-process tests (caller unit after origsel.om): ub golden
3note values of CODER_SPEC s.8, splitmix64 outputs, binomials, ceil log2, gamma and enumerative
4note code lengths, permutation index, order ties, the F1 row rule. Exit 0 = pass, else the
5note number of the first failing check.
6text TPASS "ORIGSEL_TEST_PASS checks=17\n"
7
8fn tchk1 to ulong
9if ne tqub 1 16000000
10ret 1
11end
12if ne tqub 32768 1000000
13ret 2
14end
15if ne tqub 43481 591903
16ret 3
17end
18if ne tqub 46819 485194
19ret 4
20end
21if ne tqub 13107 2321950
22ret 5
23end
24if ne tqub 13108 2321840
25ret 6
26end
27if ne tqub 65536 0
28ret 7
29end
30ret 0
31end
32
33fn tchk2 to ulong
34put TQZ 30 20261025
35if ne tqsm 10346940957598392952
36ret 8
37end
38if ne tqsm 10284689419445729823
39ret 9
40end
41if or ne tqbin 10 4 210 ne tqbin 3 4 0
42ret 10
43end
44if or ne tqclg 1 0 ne tqclg 5 3
45ret 11
46end
47if or ne tqpidx tqidp 0 ne tqpidx 4660 119
48ret 12
49end
50ret 0
51end
52
53fn tchk3 to ulong
54k = new long 5 0
55put k 0 3
56put k 1 1
57put k 2 1
58put k 3 5
59put k 4 0
60note expected order 4, 1, 2, 0, 3
61if ne tqord5 k 197140
62ret 13
63end
64tqwclr
65tqgam 1
66tqgam 9
67if ne get TQZ 7 8
68ret 14
69end
70for i ulong 200
71put TQN i 0
72end
73tqrow 1 0
74if or ne get TQQ 20 13108 ne get TQQ 24 13107
75ret 15
76end
77tqwclr
78tqwrow 1 0
79if ne get TQZ 7 1
80ret 16
81end
82put TQN 20 3
83put TQN 24 2
84tqwclr
85tqwrow 1 0
86if ne get TQZ 7 add 5 tqclg tqbin 9 4
87ret 17
88end
89ret 0
90end
91
92fn main to int
93e = tchk1
94if eq e 0
95e = tchk2
96end
97if eq e 0
98e = tchk3
99end
100if ne e 0
101ret int e
102end
103w = write 1 TPASS 0 len TPASS
104ret 0
105end