Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/blob/main/seed/qualification/om2/sec/s3s4/unroll-sum.om # 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 Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / seed / qualification / om2 / sec / s3s4 / unroll-sum.om` 36 lines ยท 1080 bytes Raw Blame History 1 note SPDX-License-Identifier: Apache-2.0 2 note Contract section 4 lines 87-92: for i T K unroll emits the body K times with i bound to 0..K-1, 3 note and removing unroll leaves behaviour unchanged (twin unroll-sum-rolled.om, same expectation). 4 note K = 1 (uint), 4 (uchar), 64 (ulong). Each loop folds i into an order-sensitive accumulator and 5 note the K = 64 loop also writes a[i] of a 65-element array, so K-1 or K+1 copies, a wrong binding of i 6 note or a reordering changes the printed lines (a K+1 copy writes a[64], read back below, never out of 7 note range). Expected stdout: oracle/s3s4/exp/unroll-sum.out (python3, oracle/s3s4/oracle.py). 8 om2 9 fn main to int 10 h = ulong 7 11 for i uint 1 unroll 12 h = add mul h `1000003` add ulong i 11 13 end 14 pu h 15 s = ulong 0 16 for i uchar 4 unroll 17 s = add mul s 131 add ulong i 3 18 end 19 pu s 20 a = new uchar 65 0 21 t = ulong 0 22 c = ulong 0 23 for i ulong 64 unroll 24 t = add mul t `6364136223846793005` add i `1442695040888963407` 25 c = add c 1 26 put a i uchar and add mul i 37 5 255 27 end 28 pu t 29 pu c 30 q = ulong 0 31 for k ulong 65 32 q = add mul q 257 ulong get a k 33 end 34 pu q 35 ret 0 36 end