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/semhash/cases/inv_reorder.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 / semhash / cases / inv_reorder.om` 71 lines ยท 1135 bytes Raw Blame History 1 om2 2 note semhash fixture: the base unit every case is diffed against 3 const lim ulong 7 4 global buf uchar 16 5 struct pt px uint py uint end 6 layout lay 8 7 field fa uchar at 0 little 8 field fb ushort at 1 little 9 end 10 fn main to int 11 c = new uchar 8 0 12 put c 1 9 13 p = new pt 3 4 14 t = add top 1 other 2 15 t = add t psub 9 4 16 t = add t useconst 1 17 t = add t useglob 2 18 t = add t callargs 5 19 t = add t rdlay c 1 20 t = add t sumpt p 21 if iseven t 22 t = add t 64 23 end 24 ret int rem t 251 25 end 26 fn isodd n ulong to bool 27 if eq n 0 28 ret false 29 end 30 ret iseven sub n 1 31 end 32 fn sumpt p view pt to ulong 33 q = ulong get p px 34 ret add q ulong get p py 35 end 36 fn leaf a ulong b ulong to ulong 37 ret add a b 38 end 39 fn top n ulong to ulong 40 r = mid n 41 ret add r 1 42 end 43 fn mid x ulong to ulong 44 y = leaf x 3 45 ret mul y 2 46 end 47 fn iseven n ulong to bool 48 if eq n 0 49 ret true 50 end 51 ret isodd sub n 1 52 end 53 fn other s ulong to ulong 54 ret xor s 5 55 end 56 fn rdlay c view lay i ulong to ulong 57 ret ulong get c i 58 end 59 fn psub a ulong b ulong to ulong 60 ret sub a b 61 end 62 fn callargs u ulong to ulong 63 ret psub u 2 64 end 65 fn useglob i ulong to ulong 66 put buf 0 uchar i 67 ret len buf 68 end 69 fn useconst v ulong to ulong 70 ret add v lim 71 end