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