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 / unroll-growth-rolled.om

35 lines · 1104 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0
2note Control for unroll-growth.om with unroll removed: the same body is valid OM-2 and runs; exit
3note status oracle/s3s4 (python3): grow 5 mod 256. Shows the refusal is the word bound, not the body.
4note Contract section 4 lines 109-111: a function's emitted words after unrolling are at most 65536,
5note else error 14 (obligation=growth). Two nested unroll 64 loops make 4096 copies of a 12-statement
6note body of unsigned ops on run-time values (each statement at least two instructions, so at least
7note 98304 words). Each loop alone is within the 64-copy bound; the word bound refuses it.
8note Twin unroll-growth-diag.om checks the om2 diag record.
9om2
10fn grow a ulong to ulong
11x = a
12s = add a 1
13t = add a 2
14u = add a 3
15for i ulong 64
16for j ulong 64
17x = add mul x 3 add s add i j
18s = xor s shr x 7
19t = add t mul s x
20u = xor u shl t 3
21x = add x mul u 5
22s = add s xor x t
23t = xor t shr s 11
24u = add u mul t 9
25x = xor x add u s
26s = mul s add x 1
27t = add t xor u 13
28u = xor u add s t
29end
30end
31ret xor xor x s xor t u
32end
33fn main to int
34ret int and grow 5 255
35end