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 / unroll-growth.om
| 1 | note SPDX-License-Identifier: Apache-2.0 |
| 2 | note Contract section 4: two nested unroll 64 loops make 4096 copies of a 12-statement body of unsigned |
| 3 | note ops on run-time values (each statement at least two instructions, so at least 98304 words). Each |
| 4 | note loop alone is within the 64-copy bound. Through omc f4fa7951 the 65536-word bound of a function |
| 5 | note refused it (error 14, obligation=growth); since 2026-11-11 a function has no word bound (OMEGESE |
| 6 | note 9.6), so it compiles and gives exactly the rolled twin's output (unroll-growth-rolled). |
| 7 | note Twin unroll-growth-diag.om checks the om2 diag record. |
| 8 | om2 |
| 9 | fn grow a ulong to ulong |
| 10 | x = a |
| 11 | s = add a 1 |
| 12 | t = add a 2 |
| 13 | u = add a 3 |
| 14 | for i ulong 64 unroll |
| 15 | for j ulong 64 unroll |
| 16 | x = add mul x 3 add s add i j |
| 17 | s = xor s shr x 7 |
| 18 | t = add t mul s x |
| 19 | u = xor u shl t 3 |
| 20 | x = add x mul u 5 |
| 21 | s = add s xor x t |
| 22 | t = xor t shr s 11 |
| 23 | u = add u mul t 9 |
| 24 | x = xor x add u s |
| 25 | s = mul s add x 1 |
| 26 | t = add t xor u 13 |
| 27 | u = xor u add s t |
| 28 | end |
| 29 | end |
| 30 | ret xor xor x s xor t u |
| 31 | end |
| 32 | fn main to int |
| 33 | ret int and grow 5 255 |
| 34 | end |