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 / seed / qualification / om2 / sec / s3s4 / ce-view-om1.om

66 lines · 1250 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0
2note OM-1 approximation of ce-view.om for the pinned compiler 734f0a39 (OM-1 has no unsized views and
3note no part): each selector copies the same elements of b into a SIZED array and passes it to a sized
4note view; the 5-read loop is rolled, so the index past the end is a run-time value that OM-1 checks
5note (OMEGESE 9.4, trap 3). D reads v[6] through a run-time index. Same expectations as ce-view.om
6note per selector (oracle/s3s4/exp/ce-view-*.out), cross-checking the oracle under OM-1 now.
7fn sumv4 v view ulong 4 to ulong
8s = ulong 0
9for i ulong 5
10s = add s get v i
11pu s
12end
13ret s
14end
15fn sumv5 v view ulong 5 to ulong
16s = ulong 0
17for i ulong 5
18s = add s get v i
19pu s
20end
21ret s
22end
23fn getc4 v view ulong 4 to ulong
24x = ulong 6
25ret get v x
26end
27fn main to int
28sb = new uchar 1 0
29r = read 0 sb 0 1
30k = get sb 0
31b = new ulong 8 0
32a4 = new ulong 4 0
33a5 = new ulong 5 0
34f4 = new ulong 4 0
35p = ulong 1
36for j ulong 8
37put b j p
38p = mul p 10
39end
40for j ulong 4
41put a4 j get b j
42put f4 j get b add j 3
43end
44for j ulong 5
45put a5 j get b j
46end
47if eq k 65
48pu sumv4 a4
49end
50if eq k 66
51pu sumv4 a4
52end
53if eq k 67
54pu sumv4 a4
55end
56if eq k 68
57pu getc4 a4
58end
59if eq k 69
60pu sumv5 a5
61end
62if eq k 70
63pu sumv4 f4
64end
65ret 0
66end