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-sized-rolled.om
| 1 | note SPDX-License-Identifier: Apache-2.0 |
| 2 | note TWIN of ce-sized.om with unroll removed (OM-2 unit). |
| 3 | note Contract section 4 lines 105-106: an index into a SIZED array that is a constant after unrolling |
| 4 | note or folding is checked at compile time; inside the array it is accepted (no error 21) and runs. |
| 5 | note a = 1 11 21 31 written with put a i, read back with get a i and the folded get a sub 3 i. |
| 6 | note Twin ce-sized-rolled.om has the same stdout: oracle/s3s4/exp/ce-sized.out (python3). |
| 7 | om2 |
| 8 | fn main to int |
| 9 | a = new ulong 4 0 |
| 10 | for i ulong 4 |
| 11 | put a i add mul i 10 1 |
| 12 | end |
| 13 | s = ulong 0 |
| 14 | for i ulong 4 |
| 15 | s = add mul s 100 get a i |
| 16 | end |
| 17 | pu s |
| 18 | t = ulong 0 |
| 19 | for i ulong 4 |
| 20 | t = add mul t 100 get a sub 3 i |
| 21 | end |
| 22 | pu t |
| 23 | ret 0 |
| 24 | end |