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 / om / meaning / test / vectors

230 lines · 7261 bytes Raw Blame History
1# om/meaning/test/vectors: input of om/meaning/test/driver.om (record formats in the driver header).
2# Expected values: K table, coefficient lines (K) and the counting argument come from Wolfram Language
3# evaluations quoted in spec/program-identity.md section 9; program_id goldens (I) are the C goldens of
4# tests/language/golden/v0.txt lines 24 and 27. Programs are numbered in order of their D lines.
5#
6# 0..3 x+1+1, x+2, 2+x, x+3 (w 64)
7D 64 x 1 add 1 add
8D 64 x 2 add
9D 64 2 x add
10D 64 x 3 add
11# 4..7 x(x+1), x*x+x, x(x+1) + 2^63 x(x-1) (2^63 x(x-1) is a null polynomial mod 2^64), x^2
12D 64 x x 1 add mul
13D 64 x x mul x add
14D 64 x x 1 add mul 0x8000000000000000 x mul x 1 sub mul add
15D 64 x x mul
16# 8 x(x-1)...(x-65) (66 factors: divisible by 66!, v2(66!) = 64), 9 the constant 0,
17# 10 x(x-1)...(x-64) (65 factors: v2(65!) = 63, nonzero at x = 65)
18D 64 x x 1 sub mul x 2 sub mul x 3 sub mul x 4 sub mul x 5 sub mul x 6 sub mul x 7 sub mul x 8 sub mul x 9 sub mul x 10 sub mul x 11 sub mul x 12 sub mul x 13 sub mul x 14 sub mul x 15 sub mul x 16 sub mul x 17 sub mul x 18 sub mul x 19 sub mul x 20 sub mul x 21 sub mul x 22 sub mul x 23 sub mul x 24 sub mul x 25 sub mul x 26 sub mul x 27 sub mul x 28 sub mul x 29 sub mul x 30 sub mul x 31 sub mul x 32 sub mul x 33 sub mul x 34 sub mul x 35 sub mul x 36 sub mul x 37 sub mul x 38 sub mul x 39 sub mul x 40 sub mul x 41 sub mul x 42 sub mul x 43 sub mul x 44 sub mul x 45 sub mul x 46 sub mul x 47 sub mul x 48 sub mul x 49 sub mul x 50 sub mul x 51 sub mul x 52 sub mul x 53 sub mul x 54 sub mul x 55 sub mul x 56 sub mul x 57 sub mul x 58 sub mul x 59 sub mul x 60 sub mul x 61 sub mul x 62 sub mul x 63 sub mul x 64 sub mul x 65 sub mul
19D 64 0
20D 64 x x 1 sub mul x 2 sub mul x 3 sub mul x 4 sub mul x 5 sub mul x 6 sub mul x 7 sub mul x 8 sub mul x 9 sub mul x 10 sub mul x 11 sub mul x 12 sub mul x 13 sub mul x 14 sub mul x 15 sub mul x 16 sub mul x 17 sub mul x 18 sub mul x 19 sub mul x 20 sub mul x 21 sub mul x 22 sub mul x 23 sub mul x 24 sub mul x 25 sub mul x 26 sub mul x 27 sub mul x 28 sub mul x 29 sub mul x 30 sub mul x 31 sub mul x 32 sub mul x 33 sub mul x 34 sub mul x 35 sub mul x 36 sub mul x 37 sub mul x 38 sub mul x 39 sub mul x 40 sub mul x 41 sub mul x 42 sub mul x 43 sub mul x 44 sub mul x 45 sub mul x 46 sub mul x 47 sub mul x 48 sub mul x 49 sub mul x 50 sub mul x 51 sub mul x 52 sub mul x 53 sub mul x 54 sub mul x 55 sub mul x 56 sub mul x 57 sub mul x 58 sub mul x 59 sub mul x 60 sub mul x 61 sub mul x 62 sub mul x 63 sub mul x 64 sub mul
21# 11 fn mask(x: u64) -> u64 { x & 0xff }; 12 fn transform requires true ensures result >= 1 { x * 2 + 1 }
22D 64 x 255 and
23D 64 x 2 mul 1 add ; true ; result >= 1
24# 13 the same body without the contract, 14 2(x+1) - 1
25D 64 x 2 mul 1 add
26D 64 x 1 add 2 mul 1 sub
27# 15..18 w 8: x and 255, x, x(x-1)...(x-8) (9 factors, v2(9!) = 7 < 8: zero on 0..8, 8! at 9... nonzero), 0
28D 8 x 255 and
29D 8 x
30D 8 x x 1 sub mul x 2 sub mul x 3 sub mul x 4 sub mul x 5 sub mul x 6 sub mul x 7 sub mul x 8 sub mul
31D 8 0
32# 19..21 coefficient vectors computed by Wolfram
33D 8 x x mul x mul 3 mul x 5 mul add 7 add
34D 16 x x mul x mul x mul x mul 7 mul x x mul 200 mul add 13 add
35D 8 x x mul 255 mul 254 add
36# 22..24 w 8: x+2, x+1+1, x+3 (exhaustive proofs)
37D 8 x 2 add
38D 8 x 1 add 1 add
39D 8 x 3 add
40# 25..28 w 64: x and (2^63-1) (outside the fragment), x and all-ones, x, x-1+1
41D 64 x 0x7fffffffffffffff and
42D 64 x 0xffffffffffffffff and
43D 64 x
44D 64 x 1 sub 1 add
45# 29, 30 w 16: x^2, x(x-1)+x
46D 16 x x mul
47D 16 x x 1 sub mul x add
48# 31..33 one-bit constant differences: x + 2^63 vs x; 2^62 x vs 3 2^62 x
49D 64 x 0x8000000000000000 add
50D 64 x 0x4000000000000000 mul
51D 64 x 0xc000000000000000 mul
52# 34..37 reassociation and commutation of add: (x+3)+5, x+(5+3), 3+(x+5), x+8
53D 64 x 3 add 5 add
54D 64 x 5 3 add add
55D 64 3 x 5 add add
56D 64 x 8 add
57# 38, 39 (x x) x vs x (x x); 40, 41 (x+3) 5 vs 5x + 15
58D 64 x x mul x mul
59D 64 x x x mul mul
60D 64 x 3 add 5 mul
61D 64 x 5 mul 15 add
62# 42, 43 w 64 or: x or 0 = x; and 0 = 0
63D 64 x 0 or
64D 64 x 0 and
65# 44 the outside program 25 with its operands swapped (another body: the fallback id differs),
66# 45, 46 x and 1 (not a polynomial function for w >= 2: outside the fragment)
67D 64 0x7fffffffffffffff x and
68D 64 x 1 and
69D 8 x 1 and
70#
71# must collapse
72C 0 1
73C 0 2
74C 1 2
75C 4 5
76C 4 6
77C 5 6
78C 8 9
79C 12 14
80C 15 16
81C 26 27
82C 27 28
83C 29 30
84C 34 35
85C 34 36
86C 34 37
87C 38 39
88C 40 41
89C 42 27
90C 43 9
91C 22 23
92# must not collapse (one-bit constant differences and near misses)
93N 1 3
94N 31 27
95N 32 33
96N 10 9
97N 17 18
98N 4 7
99N 25 27
100N 11 27
101N 22 24
102N 15 22
103N 16 27
104N 25 44
105N 45 27
106# the same body twice: same FUNCTION_ID (12 and 13 differ only in the contract)
107C 12 13
108# classes
109F 0 1
110F 8 1
111F 11 2
112F 25 2
113F 15 1
114F 26 1
115F 42 1
116F 43 1
117F 44 2
118F 45 2
119F 46 2
120# canonical coefficients (Wolfram)
121K 4 0 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
122K 7 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
123K 6 0 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
124K 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
125K 19 7 8 9 3 0 0 0 0 0 0
126K 20 13 207 305 175 70 7 0 0 0 0 0 0 0 0 0 0 0 0
127K 21 254 255 127 0 0 0 0 0 0 0
128# program_id v2 goldens (tests/language/golden/v0.txt)
129I 11 e180baf4807d890dc1ba22472e847da76e877ee04d59b0762f6dfc26b2af62ff
130I 12 83bd39597742d3bb83e5140c662532c0a2ecb59e5f868e38be16276981644543
131# FUNCTION_ID goldens: sha256sum of the section 9.3 preimage built byte by byte in run.sh
132H 0 11b8858ec5c305c0160d84eb2f30786c9429731bc6a88516d530ecefc819bef2
133H 2 11b8858ec5c305c0160d84eb2f30786c9429731bc6a88516d530ecefc819bef2
134H 8 96cb6ace92436b94aa6f49967d967b900f069c6c34b9cf73f7ce2d7d773cc1fa
135H 9 96cb6ace92436b94aa6f49967d967b900f069c6c34b9cf73f7ce2d7d773cc1fa
136H 19 89877bca66e566c52e7dbc92df7fc3bacb25542066df417a3641f504e1d216eb
137# K(w) for w = 1..64 (Wolfram: least k with IntegerExponent[k!, 2] >= w)
138W 1 2
139W 2 4
140W 3 4
141W 4 6
142W 5 8
143W 6 8
144W 7 8
145W 8 10
146W 9 12
147W 10 12
148W 11 14
149W 12 16
150W 13 16
151W 14 16
152W 15 16
153W 16 18
154W 17 20
155W 18 20
156W 19 22
157W 20 24
158W 21 24
159W 22 24
160W 23 26
161W 24 28
162W 25 28
163W 26 30
164W 27 32
165W 28 32
166W 29 32
167W 30 32
168W 31 32
169W 32 34
170W 33 36
171W 34 36
172W 35 38
173W 36 40
174W 37 40
175W 38 40
176W 39 42
177W 40 44
178W 41 44
179W 42 46
180W 43 48
181W 44 48
182W 45 48
183W 46 48
184W 47 50
185W 48 52
186W 49 52
187W 50 54
188W 51 56
189W 52 56
190W 53 56
191W 54 58
192W 55 60
193W 56 60
194W 57 62
195W 58 64
196W 59 64
197W 60 64
198W 61 64
199W 62 64
200W 63 64
201W 64 66
202# refused programs (negative controls): constant not below 2^w, missing operand, two results, widths
203V 4 8 x 256 add
204V 5 8 x add
205V 7 8 x x
206V 1 0 x
207V 1 65 x
208V 4 1 x 2 add
209# graph proofs: exhaustive equal (w 8 and 16), exhaustive differ, witness found, no witness
210E 22 23 0
211E 29 30 0
212E 22 24 1
213X 1 3 1
214X 25 27 1
215X 26 27 0
216X 4 7 1
217# queries: class of x+1+1 is {x+1+1, x+2, 2+x}; class of w 8 x+2 is {x+2, x+1+1}
218Q 0 3
219Q 22 2
220Q 9 3
221Q 11 1
222P 0 4
223P 3 3
224# randomized differential: FUNCTION_ID equal iff value signatures equal (both in the fragment)
225R 1 64 3
226R 3 300 5
227R 8 300 12345
228R 16 120 777
229R 64 300 99
230G