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-om1.om
| 1 | note SPDX-License-Identifier: Apache-2.0 |
| 2 | note OM-1 TWIN of unroll-growth-rolled.om for the pinned compiler 734f0a39: same exit status. |
| 3 | note Contract section 4 lines 109-111: a function's emitted words after unrolling are at most 65536, |
| 4 | note else error 14 (obligation=growth). Two nested unroll 64 loops make 4096 copies of a 12-statement |
| 5 | note body of unsigned ops on run-time values (each statement at least two instructions, so at least |
| 6 | note 98304 words). Each loop alone is within the 64-copy bound; the word bound refuses it. |
| 7 | note Twin unroll-growth-diag.om checks the om2 diag record. |
| 8 | note OM-1 unit: this line replaces the om2 line |
| 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 |
| 15 | for j ulong 64 |
| 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 |