interplane.Get Omega
Read in your language

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

branch main Branches Tags History

omega-mv / om / runtime / rx_skillroute_core.om

36 lines · 923 bytes Raw Blame History
1om2
2note rx_skillroute_core.om -- Skill Router rejection-class bitmask and
3note digest-zero check in pure OM-2.
4note Replaces why_of and digest_zero in src/runtime/rx_skillroute.c.
5
6export fn rx_sr_digest_zero d view uchar 32 to ulong
7 acc = uchar 0
8 for i ulong 32
9 acc = or acc get d i
10 end
11 if eq acc 0
12 ret 1
13 end
14 ret 0
15end
16
17note counts[10]:
18note 0 rejected_dead -> 0x001
19note 1 rejected_unavailable -> 0x002
20note 2 rejected_authority -> 0x004
21note 3 not_a_skill -> 0x008
22note 4 not_executable -> 0x010
23note 5 digest_mismatch -> 0x020
24note 6 remote_refused -> 0x040
25note 7 pin_mismatch -> 0x080
26note 8 machine_mismatch -> 0x100
27note 9 machine_unknown -> 0x200
28export fn rx_sr_why_of counts view ulong 10 to ulong
29 w = ulong 0
30 for i ulong 10
31 if ne get counts i 0
32 w = or w shl ulong 1 i
33 end
34 end
35 ret w
36end