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/fold-guard-rolled.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 / fold-guard-rolled.om` 42 lines ยท 1045 bytes Raw Blame History 1 note SPDX-License-Identifier: Apache-2.0 2 note TWIN of fold-guard.om with every unroll and inline removed (section 4 lines 91, 97): OM-2 unit, 3 note same expected stdout. 4 note Contract section 4 lines 102-104: inside unrolled or inlined bodies only, all-constant operations 5 note fold with OM-1 arithmetic; an operation that would trap is not folded, so a guarded 6 note if ne i 0 / div 100 i compiles and behaves as before (no compile error at the i = 0 copy). 7 note Lines: unsigned div, unsigned rem, signed long div under the guard, and an inlined guard q. 8 note Twin fold-guard-rolled.om (unroll and inline removed) has the same expected stdout: 9 note oracle/s3s4/exp/fold-guard.out (python3, oracle/s3s4/oracle.py). 10 om2 11 fn q a ulong b ulong to ulong 12 if eq b 0 13 ret 0 14 end 15 ret div a b 16 end 17 fn main to int 18 s = ulong 0 19 for i ulong 4 20 if ne i 0 21 s = add s div 100 i 22 end 23 end 24 pu s 25 r = ulong 0 26 for i ulong 4 27 if ne i 0 28 r = add r rem 101 i 29 end 30 end 31 pu r 32 t = long 0 33 for i long 4 34 if ne i 0 35 t = add t div `1000000` i 36 end 37 end 38 pu ulong t 39 pu q 100 0 40 pu q 100 7 41 ret 0 42 end