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/profile/cases/ok-unit.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 / profile / cases / ok-unit.om` 45 lines ยท 714 bytes Raw Blame History 1 note Positive unit: every rule satisfied, with each annotation form. 2 const LIM ulong 16 3 global buf uchar 64 4 text path "build/profile-ok" 5 note p10 pure 6 fn twice x ulong to ulong 7 ret add x x 8 end 9 note p10 effect 10 fn save n ulong to ulong 11 fd = fopen path 0 len path 577 384 12 if lt fd 0 13 ret 1 14 end 15 w = write int fd buf 0 n 16 note p10 allow E1 the write status is reported; a close error after it is not 17 cl = fclose int fd 18 if ne w long n 19 ret 2 20 end 21 ret 0 22 end 23 fn walk depth ulong to ulong 24 nd = add depth 1 25 if gt nd LIM 26 ret 0 27 end 28 ret walk nd 29 end 30 fn main to int 31 s = ulong 0 32 for i ulong len buf 33 s = add s twice i 34 end 35 k = ulong 0 36 while lt k 10 bound 10 37 k = add k 1 38 end 39 r = save 8 40 if ne r 0 41 ret 1 42 end 43 d = walk 0 44 ret int add d s 45 end