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