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-diag.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-diag.om` 37 lines ยท 1188 bytes Raw Blame History 1 note SPDX-License-Identifier: Apache-2.0 2 note unroll-sum.om under om2 diag: the artifact must equal that of unroll-sum.om (section 4 line 116). 3 note Contract section 4 lines 87-92: for i T K unroll emits the body K times with i bound to 0..K-1, 4 note and removing unroll leaves behaviour unchanged (twin unroll-sum-rolled.om, same expectation). 5 note K = 1 (uint), 4 (uchar), 64 (ulong). Each loop folds i into an order-sensitive accumulator and 6 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 7 note or a reordering changes the printed lines (a K+1 copy writes a[64], read back below, never out of 8 note range). Expected stdout: oracle/s3s4/exp/unroll-sum.out (python3, oracle/s3s4/oracle.py). 9 om2 diag 10 fn main to int 11 h = ulong 7 12 for i uint 1 unroll 13 h = add mul h `1000003` add ulong i 11 14 end 15 pu h 16 s = ulong 0 17 for i uchar 4 unroll 18 s = add mul s 131 add ulong i 3 19 end 20 pu s 21 a = new uchar 65 0 22 t = ulong 0 23 c = ulong 0 24 for i ulong 64 unroll 25 t = add mul t `6364136223846793005` add i `1442695040888963407` 26 c = add c 1 27 put a i uchar and add mul i 37 5 255 28 end 29 pu t 30 pu c 31 q = ulong 0 32 for k ulong 65 33 q = add mul q 257 ulong get a k 34 end 35 pu q 36 ret 0 37 end